Hi Jan
> I have a perl script that calls an NCL script via the perl function
> system()
> that does not seem to be working quite right.
>
> I'm running NCL 4.2.0.a030 on Red Hat 8.
Though not relevant to answering your question, there are more recent
versions of NCL available. You can visit:
https://www.earthsystemgrid.org
and choose the "Login" tab at the top to request a login to the site.
After that, you may choose the "Scientific Data Processing and
Visualization Software" link under the "Browse Dataset Catalogs" to
download a more recent version of NCL.
> When I run the perl script from the command line everything works
> great, but
> when I set up a cron job to run the script, the resulting error
> message is:
>
> warning:Unable to Get System Resource File Name?
> warning:Unable to load System Resource File (null)
> fatal:GetSysAppDir:Unable to get a default value for the system App
> Resource
> directory
> warning:["Resources.c":721]:Unable to set appSysDir to default value -
> Using
> NULL
> fatal:GetSysAppDir:Unable to get a default value for the system App
> Resource
> directory
> warning:["Resources.c":721]:Unable to set appSysDir to default value -
> Using
> NULL
> warning:Unable to Get System Resource File Name?
> warning:WorkstationClassInitialize:Unable to access rgb color database
> -
> named colors unsupported:[errno=2]:No such file or
> directory
> warning:["Palette.c":1525]:NhlLoadColormapFiles: Invalid directory
> encountered in colormap path specification
These warning messages are indicative of your environment not having
the NCARG_ROOT environment variable set. A few other environment
variables depend on this root path being known in order to be set
properly. Please see:
http://www.ncl.ucar.edu/Document/Graphics/env.shtml
for a more complete discussion.
> The simplest possible perl script looks something like:
>
> #! /usr/bin/perl
>
> system("/home/me/script.ncl")
>
> My ncl script uses:
>
> load "/usr/local/ncarg/lib/ncarg/nclex/gsun/gsn_code.ncl"
> load "/usr/local/ncarg/lib/ncarg/nclex/gsun/gsn_csm.ncl"
>
> rather than the "load "$NCARG_ROOT/lib/ . . . " references.
>
>
> So, when run from cron with
>
> * * * * * /home/me/perlscript.pl
>
> the process generates the above message.
I would suggest obtaining the value of the NCARG_ROOT environment
variable using perl's $ENV() construct (either set it upon login, or
set it in your script) and loading files relative to that value.
-Rick.
---- Rick Grubin NCAR/CISL/SCD/VETS Visualization + Enabling Technologies grubin@ucar.edu 303.497.1832_______________________________________________ ncl-talk mailing list ncl-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Thu Aug 25 2005 - 10:10:08 MDT