[ncl-talk] problem with adding file

Dennis Shea shea at ucar.edu
Tue Aug 29 11:45:52 MDT 2017


Hello ... Please respond to ncl-talk and not directly to me.

Your script has:

    *f *     = addfile("precip.mon.total.v6.nc","r")
    prc    =* f*->precip({tStrt:tLast},:,:)         ; whole grid

The error message is:

fatal: file (*f*) isn't defined

I am not sure what the problem would be. Someone else will have to respond.

---
What does the following yoeld? Likely the same error.

  *f *     = addfile("precip.mon.total.v6.nc","r")
  print(*f*)

=====================================================
NOTE:
You do *not* have to load the following libraries from NCL 6.2.0 onward. So
for 6.3.0, they are *automatically loaded.*

load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

>From 6.4.0, the following are automatically loaded:

    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/bootstrap.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/csm/extval.ncl"
    "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"


On Tue, Aug 29, 2017 at 9:27 AM, Setareh Rahimi <setareh.rahimi at gmail.com>
wrote:

> dear Dennis,
>
> Thank you for your advice, but  both data file and script are in the same
> directory.
>
> Regards,
>
> On Tue 29 Aug 2017 at 19:12, Dennis Shea <shea at ucar.edu> wrote:
>
>> By default, NCL always looks in the 'current directory'.
>> My guess is that the data file is not in the same directory as the NCL
>> script.
>>
>> dirp = "/some/path/to/file/"
>> filp   = "precip.mon.total.v6.nc"
>>
>> pthp = dirp + filp
>> f       = addfile(pthp, "r")
>>
>> or
>>
>> f = addfile(dirp + filp, "r")
>>
>>
>> On Tue, Aug 29, 2017 at 8:26 AM, Setareh Rahimi <setareh.rahimi at gmail.com
>> > wrote:
>>
>>> Dear all,
>>>
>>> Once I put my NCL command line in NCL environment, it returns me an
>>> error.
>>>
>>>  Please have a look at the attached files, which contain a screenshot of
>>> the error and my script.
>>>
>>> Please help me as soon as possible.
>>>
>>> Best wishes,
>>> --
>>> S.Rahimi
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>> --
> S.Rahimi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170829/16e55090/attachment.html>


More information about the ncl-talk mailing list