[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20010305: portable use of NetCDF 3.x return values



>To: <address@hidden>
>From: Keith Lindsay <address@hidden>
>Subject: portable use of NetCDF 3.x return values
>Organization: UCAR/CGD
>Keywords: 200103051842.f25IgeL15522 netCDF Fortran return values

Hi Keith,

> I would like to know how I can portably use the return values from NetCDF
> 3.x library calls. I am using the Fortran 77 interface and do not see in
> the User's Guide documentation on how to interpret the return values.
> 
> A concrete example is checking to see if a variable has a missing_value
> attribute. I currently do this by calling nf_get_att_... and compare the
> return value against nf_enotatt. (I probably should be calling nf_inq_att,
> but that is tangential to my main question.) I feel uneasy using
> nf_enotatt though because it is not documented in the User's Guide, which
> is the only documentation of the interface that I am aware of. So I feel
> that I am relying on library implementation details that could change from
> one version of the library to another.
> 
> Apart from nf_noerr, I cannot find in the documentation a portable way to
> interpret the return values. Is this just a shortcoming of documentation?
> Is there portable way to do this?

It's a shortcoming of the documentation, which should include an
appendix listing the possible error returns.  The Fortran include file
netcdf.inc is intended to be as formal a definition of the Fortran 77
interface as is possible in Fortran 77.  In particular, all the
parameter definitions there (except for those labeled "advisory
maximums") including the error codes are intended to be an eternal
part of the interface, which we reserve the right to add to but never
change.  And any other faithful implementation of the netCDF interface
should use the same values for all the error codes.

I'll put the creation of an appendix for error returns in the User's
Guide on my "to do" list.  Thanks for the suggestion.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu