Re: NCL_DEF_SCRIPTS_DIR

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 18 2011 - 11:51:17 MDT

Hi Oli,

I have added code to sort the contents of the NCL_DEF_SCRIPTS_DIR into standard ascii (case-sensitive) order. It will be part of NCL 6.0.0, but I'm sure that we can provide a binary if it's important for you to get it immediately. FYI, I have also looked into the problem of "load" commands within scripts in the default directory causing problems. I don't entirely understand the problem yet but I do think it is a bug. I am wondering whether you see the same symptoms as I do. If I try to start NCL interactively and a default script containing a "load" command is encountered, NCL just ends as if it thinks it has completed running a non-interactive script. Is that your experience as well?
Thanks,
 -dave

On Mar 15, 2011, at 4:53 AM, <Oliver.Fuhrer@meteoswiss.ch> <Oliver.Fuhrer@meteoswiss.ch> wrote:

> Dear NCL team,
>
> As you might know, we have developed a library of scripts we use to visualize COSMO model output. The way this works is that we set the NCL_DEF_SCRIPTS_DIR=${HOME}/ncl/startup environment variable and inside the startup directory we have the following links...
>
> 100.ncl -> /usr/lib/ncarg/nclscripts/csm/gsn_code.ncl
> 110.ncl -> /usr/lib/ncarg/nclscripts/csm/gsn_csm.ncl
> 120.ncl -> /usr/lib/ncarg/nclscripts/csm/contributed.ncl
> 200.ncl -> /usr/share/ncarg/cosmolib/src/constants.ncl
> 210.ncl -> /usr/share/ncarg/cosmolib/src/grib_keys_cosmo.ncl
> 220.ncl -> /usr/share/ncarg/cosmolib/src/utilities.ncl
> 230.ncl -> /usr/share/ncarg/cosmolib/src/cosmolib.ncl
>
> ...which load the library and its dependencies automatically when the user launches NCL. These scripts need to be loaded in alphabetical order (thus the strange names of the links) and if they are loaded in the wrong order errors will occur as certain functions will not be defined upon load. I have been seeing problems on several platforms since NCL is using the readdir() command to loop over all files in the directory set by NCL_DEF_SCRIPTS_DIR. This command does not guarantee alphabetical order (even though it usually gives alphabetical order if the links are created in alphabetical order). It seems that on several platforms, the readdir() actually gives a different order. I have tried putting the "load" commands inside the scripts being loaded, but it seems that NCL does not support recursive loads. Is there any chance we could convince NCL to parse the scripts in this directory in alphabetical order?
>
> Kind regards,
> Oli
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 18 11:51:23 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT