Re: Possible 5.0.0 bug: ncclose/Not a valid ID

From: Rick Grubin <grubin_at_nyahnyahspammersnyahnyah>
Date: Wed, 23 Jan 2008 13:24:07 -0700

All,

A followup to this topic, first noted by Dave Allured:

> After installing NCL 5.0.0 on Mac OS 10.4.11, we are getting an
> unexpected error upon exit from several scripts. The message is:
>
> ncclose: ncid 0: NetCDF: Not a valid ID
>
> Is anyone else on Mac or other systems getting this exit message?
>
> Please see my script and log below. This is related to addfile or
> Netcdf. When the addfile statement is commented out, the spurious
> error goes away.
>
> The error occurs when the script exits, not at the time of
> addfile. The error does not occur with NCL 4.3.0. Another clue is
> that the error does not occur in a script that accesses binary data
> rather than Netcdf (fbinrecread vs. addfile).
>
> ========================================================
> Test script:
>
> begin
> f = addfile ("scrip_simple.nc", "r")
> print ("Done.")
> end
>
> (Any Netcdf data file will do.)

It's been determined that recent changes to NCL's handling of its
program exit process was interacting improperly with the OPeNDAP
library's exit process.

More technically (a little bit anyway), functions registered to be
called when NCL is exiting, and functions registered to be called when
closing a DAP connection, were being called out of order. This led
to DAP connections being closed before NCL could properly clean
up its end of the connections, leading to the message noted above.

We've changed NCL's behavior to properly account for this, and the
changes will be available in the next release of NCL.

In the meantime: this does not cause a problem in reading netCDF
files. When you write a file, however, you may have to delete the
file handler variable before you exit the script, by using the delete
procedure:
begin
   ...
   f = addfile("newfile.nc","w")
   ...write stuff to file pointed to by 'f'.
   delete(f)
end

----
Rick Grubin NCAR/TDD/CISL/VETS
Visualization + Enabling Technologies
grubin_at_ucar.edu 303.497.1832

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 23 2008 - 13:24:07 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 23 2008 - 14:19:33 MST