Re: Changing Directories in the middle of an NCL script

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Fri, 24 Apr 2009 16:00:56 -0600

As I see it, the only directory-dependent thing that you can do with
NCL is to read and write disk files. So instead of depending on the
concept of a "current directory" to get things done, why not simply
add the base directory name DIR1, DIR2 etc. onto each file name?
What else could you possibly be doing that really needs a current

   do_things_with (base+filename1, base+filename2)
   do_things_with (base+filename1, base+filename2)

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)

wcapehar wrote:
> We’re using NCL to do some processing that will require us to change
> directory “amid-script.” In other words, we’ll be doing something in
> dir1 and then needing to cd into dir2 and do something else.
> doing it this way...
> system(“cd DIR1”)
> system(“do_what_im_doing_in_DIR1”)
> system(“cd DIR2”)
> system(“do_what_im_doing_in_DIR2”)
> ...doesn’t do it...
> There is a need to do this
> There is an equivalent command in IDL, but is there one NCL? Or do I
> need to run a script in each directory, starting each with a shell command.
> ================================================================
> Bill Capehart <> Associate Professor
> Institute of Atmospheric Sciences Land Surface Processes
> 213 Mineral Industries Building Hydrometeorology
> South Dakota School of Mines and Technology Ph: +1-605-394-1994
> 501 East Saint Joseph Street Fax: +1-605-394-6061
> Rapid City, SD 57701-3995 Mobile: +1-605-484-5692
> =================== ==================
> ------------------------------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Apr 24 2009 - 16:00:56 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 27 2009 - 16:09:00 MDT