[ncl-talk] number variable transfer into ncl script

Rick Brownrigg brownrig at ucar.edu
Fri Oct 10 09:58:29 MDT 2014


Hi Mark,

I take it your $var1, $var2, etc., are shell variables?

Try      ncl timeb=\"$var1\" ....

HTH,
Rick


On Fri, Oct 10, 2014 at 9:38 AM, Mark Chan <cym263 at yahoo.com> wrote:

> Dear NCL users,
>
> I have a ncl script as in the below with name as "abc.ncl", and I would
> run it as:
>
> ncl    'timeb="'$var1'"'     'timee="'$var2'"'       'timed="'$var3'"'
> abc.ncl
>
> here var1=31; var2=32; var3=31.5  (this is examples and the values would
> be calculated)
>
> The operation above doesn't work, however the following operation works:
>
> ncl   'timeb=31'    'timee=32'    'timed=31.5'   abc.ncl
>
> Can one kindly give any suggestion?
>
> Thanks very much in advance!
> Mark
>
> -------abc.ncl--------------
> begin
>  time_bnds=new((/1,2/),"double","No_FillValue")
>  write_file=addfile("./rub.nc","w")
>  time_bnds(0,0:1) = (/timeb,timee/)
>  time = (/timed/)
>  write_file->time_bnds=time_bnds(0:0,0:1)
>  write_file->time=time
> end
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141010/8e7ed781/attachment.html 


More information about the ncl-talk mailing list