[ncl-talk] number variable transfer into ncl script

Mark Chan cym263 at yahoo.com
Fri Oct 10 09:38:51 MDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141010/31489534/attachment.html 


More information about the ncl-talk mailing list