[Thread Prev][Thread Next][Index]

[ferret_users] Re: [ferret_users] -script, with arguments or repeat/repeat command



Ansley,

It's helpful to write a script to define the variable using the argument. Thank you.
I have one more question. Is it possible to use on ferret repeat command (range=1:12:1 name=month) with repeat over a range of values along an axis (name=day) ?
Like:
repeat/range=1:12/name=month \
repeat/range=1:365/name=day \
(...

So repeat/repeat ( day=1:365 for month=1 next day=1:365 for month=2 ... )  

Thanks so much for your answer and in advance for any ideas
Aleksander
 
 
Dnia 29 września 2011 20:23 Ansley Manke <ansley.b.manke@xxxxxxxx> napisał(a):


Hi -
The syntax for a Ferret script to use one argument is for it to refer to $1. So if your script is what you show below, you could keep it as it is and write a script to define the variable using the argument.  The short script call_new.jnl makes that one variable definition and then executes the script "new.jnl".
! call_new.jnl
let month = $1
go new
Try it from the Ferret command line.
yes? go call_new 1

Then to run your script from the command line with the -script switch,
ferret -gif -script call_new.jnl 1
By the way I think the script you show might have a typo.  It looks like maybe you intended it to end with
    frame/file=shgt11_`month`_k2.gif

Ansley

On 9/29/2011 3:47 AM, Aleksander Borowski IOPAN wrote:
Dear FerretUsers,
I try to run a script, with optional arguments. Script like:

repeat/range=3:9:1/name=day \
(use hist.Rbalt48.20030`month`0`day`.nc; \
shade/k=2/lev=(-2,10,0.2) SALT*1000; \
frame/file=shgt11_`m`_k2.gif)

I'd like to run : ferret -gif -script new.jnl with argument
[let month=1]

How to run new.jnl and add arguments to command line without
rewrite a script ?
Thank you in advance for your answer and any ideas.
Aleksander





[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement