Re: read a variable from another NCL script

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 03 2013 - 12:29:43 MST


Change one of the scripts into an NCL function or NCL procedure. Then just
call that script from the other script.

There are at least three ways to pass the variable. You can pass it as a
calling parameter, a function result, or a global variable. This is all
described in the reference manual:

If you will be computing the same variable with the same numbers many
times, then it would be more efficient to follow Kyle's suggestion and
write the variable to a Netcdf file, then read it from the second script.


On Tue, Dec 3, 2013 at 8:48 AM, Kyle Griffin <> wrote:
> Although I'm not overly familiar with what WRAPIT might support in this
case, usually the best way to do this is to write the variable out to a
netCDF file. It's not quite as efficient as directly passing the variable
within memory, but it will get the job done. If someone does know how to do
this with WRAPIT, or knows that it is not possible, please chime in.
> If you want help writing to netCDF, see:
> Kyle
> On Tue, Dec 3, 2013 at 1:24 AM, Yi-Chih Huang <> wrote:
>> Hello,
>> I am trying to read a variable from another NCL script. WRAPIT does
not seem to support this function from the Mini-Language Manual. What is a
simple way to read variable from another NCL script? Is there a
counterpart of Fortran subroutine on NCL?
>> Thanks much,
>> Yi-Chih

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Dec 3 12:32:08 2013

This archive was generated by hypermail 2.1.8 : Wed Dec 04 2013 - 20:42:38 MST