Grads scripting language

Mandelli Alessandro mandelli.alessandro at TISCALI.IT
Tue Jan 31 15:06:33 EST 2006


Tom Pollard ha scritto:
> didn't seem to be possible
> to load one script from another, which prevents you from building up
> libraries of reusable functions.

This is not true. E.g.

function main(args)
if (args = '')
   prompt 'Enter forecast date (yyyymmddhh) --> '
   pull date
   prompt 'Enter longitude --> '
   pull hilon
   prompt 'Enter latitude --> '
   pull hilat
   prompt 'Metric units? [y/n] --> '
   pull metric
   if (metric='n' | metric='N') ; _units='e' ; endif
   prompt 'Enter location Name --> '
   pull name
else
   name  = subwrd(args,1)
   date  = subwrd(args,2)
   hilon = subwrd(args,3)
   hilat = subwrd(args,4)
  _units = subwrd(args,5)
endif
return

and of course you can call a function within a script or from outside a
given script.
The above example is pulled from meteogram.gs, credits of Dirmeyer et
al. Please, have a look.

I feel confortable enough with grads scripting, as far as plotting
gridded data is concerned.

Cheers



More information about the gradsusr mailing list