[gradsusr] Is it possible to use an earlier assigned variable to define a new variable within the grads script?

lpasmanoranjan lpasmanoranjan at gmail.com
Tue Nov 8 05:58:44 EST 2016


Dear Davide,
Thank you very much. Yes, now it worked.

On Mon, 7 Nov 2016 at 17:04 Davide Sacchetti <davide.sacchetti at arpal.gov.it>
wrote:

using "run" or not is equivalent, the difference is that using "run"
grads takes into account upper or lower case in the script name
(without "run" lower case only is considered)

Modify the script as follow and it should work:

function main(args)
ctl.1=subwrd(args,1)
ctl.2=subwrd(args,2)
ctl.3=subwrd(args,3)
ctl.4=subwrd(args,4)
ctl.5=subwrd(args,5)

model1=1
model2=5
while(model1<=model2)
'open 'ctl.model1
do some computation here
close 1
model1=model1+1
endwhile

Bye bye
Davide

Il giorno sab, 05/11/2016 alle 09.16 +0900, lpasmanoranjan ha scritto:
> Dear Jeff,
> Thank you for your suggestion. But it is not working.
>
> I am getting the following error message:
>
> Can't open the descriptor file
>
> On 5 November 2016 at 00:33, Jeff Duda <jeffduda319 at gmail.com> wrote:
> > Don't forget the keyword 'run' in your invocation of grads.
> >
> > Jeff Duda
> >
> > On Fri, Nov 4, 2016 at 5:41 AM, lpasmanoranjan <lpasmanoranjan at gmai
> > l.com> wrote:
> > > Dear GrADS users,
> > > I would like to ask you a favour.
> > >
> > > I would like to open 5 number of grads control files one by one
> > > after some computation. They are first defined in my shell script
> > > as:
> > >
> > > ctl1=temp.ctl
> > > ctl2=t.ctl
> > > ctl3=tave.ctl
> > > ctl4=t2.ctl
> > > ctl5=t2m.ctl
> > > grads -blc "temp.gs $ctl1 $ctl2 $ctl3 $ctl4 $ctl5"
> > >
> > > My grads script is:
> > >
> > > function main(args)
> > > ctl1=subwrd(args,1)
> > > ctl2=subwrd(args,2)
> > > ctl3=subwrd(args,3)
> > > ctl4=subwrd(args,4)
> > > ctl5=subwrd(args,5)
> > >
> > > model1=1
> > > model2=5
> > > while(model1<=model2)
> > > 'open ctl'model1
> > > do some computation here
> > > close 1
> > > model1=model1+1
> > > endwhile
> > >
> > > My problem is in the command 'open ctl'model1
> > >
> > > Is it possible to pass such command in grads script?
> > >
> > >
> > > --
> > > Kind Regards,
> > > Mano
> > >
> > >
> > > _______________________________________________
> > > gradsusr mailing list
> > > gradsusr at gradsusr.org
> > > http://gradsusr.org/mailman/listinfo/gradsusr
> > >
> >
> >
> >
> > --
> > Jeff Duda
> > Post-doctoral research associate
> > University of Oklahoma School of Meteorology
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20161108/8e5a6494/attachment.html 


More information about the gradsusr mailing list