[esp-r] Re: bash script, clm module problem

Dimitrios Sfakianakis dimitrios.sfakianakis at strath.ac.uk
Fri Dec 13 12:15:08 GMT 2013


Dear all, 

Thank you all for your replies.

@Jon Hand: I updated to the latest development branch version and this is what I noticed: When I select a new climate file that exists in the climatelist file, I get to choose whether I want to open with clm or just use it, which is what I was looking for. However when I select a user defined climate file I don't get to choose the next action and the clm module opens automatically. However, if I open climate file in the climatelist first, choose the "Use it" option and then select the user defined climate file, clm does not open. My guess is that a variable stores whether the clm module opens or not and while the user gets to set this variable when choosing a file from the climate list, he is not offered the choice when selecting a user defined climate file. If that is the case I will search for that variable and default it to "Use it".

@Olivier Bounhoure: Your solution seems quite elegant. I was thinking of changing the .cfg file however my scripting capabilities are limited and it would take me some time to figure out how to accomplish that. Thanks a lot!

@Andy Cowie: My problem is that once I select a new climate file, clm open automatically in a new command line and it does not accept the commands in the script. I don't want to do anything in clm, I just want to close it!

Kind regards,

Dimitrios Sfakianakis MEng
Research Assistant, Dept. Naval Architecture and Marine Engineering, University of Strathclyde
Kelvin Hydrodynamics Laboratory, Acre Road, Glasgow, G20 0TL
T: +44 (0) 141 330 2648 (Ext 2648)
M: +44 07514271592
E: dimitrios.sfakianakis at strath.ac.uk
The University of Strathclyde is a charitable body, registered in Scotland, with registration number SC015263.

________________________________________
From: Jon Hand
Sent: 12 December 2013 21:57
To: Dimitrios Sfakianakis; esp-r at lists.strath.ac.uk
Subject: RE: bash script, clm module problem

If you just want to alter the name of the weather file held in the model cfg file
and do not need to actually open the clm module - newer versions of the project manager
provide an option to just select the file and not start the clm module.  This should
make your automation much easier.

So you should update to the latest version of ESP-r either by checking out the
current development_branch and compiling it or using a recent installer for
Windows.  If you need the latter I can provide a link.

-Jon Hand
________________________________________
From: esp-r-bounces at lists.strath.ac.uk [esp-r-bounces at lists.strath.ac.uk] on behalf of Dimitrios Sfakianakis [dimitrios.sfakianakis at strath.ac.uk]
Sent: 12 December 2013 19:49
To: esp-r at lists.strath.ac.uk
Subject: [esp-r]  bash script, clm module problem

Dear List,

I am currently developing a bash script to automate a process. I'm opening the file in text mode and when selecting a different climate file, the clm module opens in a new window (a new command line where clm is in text mode). In this new command line the commands in my script are not executed.

Has anyone encountered this problem? Do you know if it's possible to input in this new command window?

Here is the script. The problem appears on the 12th line.

#!/bin/bash

for i in `ls /home/dsfakianakis/Elyros/ClimateFiles/*.clm`
do

prj -mode text -file Elyros.cfg << XZZ
b
a
b
<
$i
#at this point the clm module open in a new window and I have to manually close it for the script to continue.

-
y
y
-
-
XZZ

done


Thanks again for the support!!

Kind regards,

Dimitrios Sfakianakis MEng
Research Assistant, Dept. Naval Architecture and Marine Engineering, University of Strathclyde
Kelvin Hydrodynamics Laboratory, Acre Road, Glasgow, G20 0TL
T: +44 (0) 141 330 2648 (Ext 2648)
M: +44 07514271592
E: dimitrios.sfakianakis at strath.ac.uk
The University of Strathclyde is a charitable body, registered in Scotland, with registration number SC015263.

_______________________________________________
esp-r mailing list
esp-r at lists.strath.ac.uk
http://lists.strath.ac.uk/mailman/listinfo/esp-r



More information about the esp-r mailing list