[ncl-talk] setfileoption

Mary Haley haley at ucar.edu
Mon Dec 12 10:08:58 MST 2016


Takeshi,

Thanks for reporting this bug and providing a short script.  This was an
elusive bug that we saw awhile back, but we were never able to reproduce it
and hence couldn't fix it. Your script may help us narrow down the source
of the problem.

Your script doesn't fail for us, so could you email me offline with the
following information so we can try to determine why it's not working for
you.

Which version of NCL:

 ncl -V

Did you build this NCL from source code?  If so, which compilers and their
versions did you use?
If you didn't build NCL from source code, then which binary did you
download?

What version of MacOS are you running

sw_vers -productVersion

Thanks,

--Mary




On Fri, Dec 9, 2016 at 9:42 PM, Takeshi Enomoto <takeshi at macports.org>
wrote:

> Hi,
>
> I haven’t been posted for a long time, but I regularly use NCL.
> I appreciate the efforts of development and support.
>
> A user of ncarg of MacPorts reported a problem with ESMF.
> The error appears to be cause with MacPorts’ ncl, not with the binary at
> UCAR.
>
> <https://trac.macports.org/ticket/53031>
>
> I investigated the script and found that setfileoption() wipes the symbol
> table:
> after a call to setfileoption variables become undefined.
>
> I appreciate any suggestions for fixing the problem.
>
> Regards,
>
> T.
>
> $ cat bar.ncl
> procedure curvilinear_to_SCRIP(Opt[1]:logical)
> begin
>     if (isatt(Opt,"NetCDFType").and.\
>         str_lower(Opt at NetCDFType).eq."netcdf4") then
>       setfileoption("nc","Format","netcdf4")
>       nc_file_type = "netcdf4"
>     else
>       nc_file_type = "netcdf3"
>     end if
>     print(nc_file_type)
> end     ; of curvilinear_to_SCRIP(...)
> begin
>   Opt = True
>   curvilinear_to_SCRIP(Opt)
>   Opt at NetCDFType = "netcdf4"
>   curvilinear_to_SCRIP(Opt)
>   Opt at NetCDFType = "netcdf3"
>   curvilinear_to_SCRIP(Opt)
> end
>
> $ ncl -nQ bar.ncl
>
>
> Variable: nc_file_type
> Type: string
> Total Size: 8 bytes
>             1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> netcdf3
> fatal:Variable (nc_file_type) is undefined
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 10 in
> file bar.ncl
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 16 in
> file bar.ncl
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161212/f0f141ef/attachment.html 


More information about the ncl-talk mailing list