[ncl-talk] using scoping to create global variables

Jon Meyer jonathan.meyer at aggiemail.usu.edu
Mon Jul 2 13:43:09 MDT 2018


Hello,

I'm hoping to streamline some automated cron job NCL code I've written that
could greatly benefit from having global variables set that the main
program and functions/procedures can all share..mainly, the directory
system I'm navigating around so I don't have to hardcode or pass directory
strings in and out of variables.

I know NCL isn't directly able to do global variables, but some reading
into this shows the ability to take advantage of NCL's scoping to
essentially create global variables.

I've looked through past ncl-talk threads but the discussion on how to
accomplish this is light other than it can be done, and the scoping
discussion on the ncl page isn't as visually helpful on how to do this.
After a few attempts, I've failed trying to follow the basic example
included in the few ncl-talk threads from the past so I'm hoping someone
can elaborate or provide an example for setting string (or other type)
variables to be accessible to functions/procedures called from main code
where the strings are set.

Any help of time is appreciated.

-- 
Jonathan D.D. Meyer, Ph.D.
Utah State University
Department of Plants, Soils & Climate
Utah Climate Center
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180702/d821afa5/attachment.html>


More information about the ncl-talk mailing list