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

Re: 20001128: netcdf3.4 on RedHat 6.2 Linux



>From: Gu-Xiangqian <address@hidden>
>Subject: netcdf3.4 on Linux
>Organization: CAMS
>Keywords: 200011280716.eAS7GRo27328 netCDF 3.4 RedHat 6.2 Linux

Hi Gu-Xiangqian,

> I use netcdf3.4 on Redhat Linux6.2.  I untar and uncompress
> netcdf-3.4-tar.Z, then configure and make to create
> libsrc/netlibcdf.a ( seems some errors), but I find no
> handle_error function in netcdf.h, so I cannot link
> a program containing handle_error.

The handle_error() function is not part of the netCDF interface; the
function is only used in examples in the documentation to make the
examples simpler.  Error handling can vary greatly in applications,
and it is not possible to write a single error-handling function that
will be suitable for all uses.

There is a simple example of a handle_error() function in the User's
Guide section 5.2:

  Here is an example of a simple error handling function that uses
  nc_strerror to print the error message corresponding to the netCDF
  error status returned from any netCDF function call and then exit:

  #include <netcdf.h>
     ... 
  void handle_error(int status) {
  if (status != NC_NOERR) {
     fprintf(stderr, "%s\n", nc_strerror(status));
     exit(-1);
     }
  }

You could just use this, if you want something simple, but if you want
to have your program do something more than just exit when an error is
detected (perhaps as the result of a user misspelling a variable name,
for example), then you will have to provide something more elaborate.
It's not even necessary to use a handle_error() function; you could
instead just check the error return of every netCDF function call and
do whatever is appropriate in the program that calls the netCDF
function.

> I success in compiling vis5d with the netlibcdf.a on PC+RedHat
> Linux 6.1 but fail in RAWINS of MM5V3.4

We would have to have more information about the nature of the failure
to be able to diagnose this problem.  Perhaps this is a question about
MM5 support.  Unfortunately we have no MM5 expertise here.

> I wish to know the advance in NetCDF plan and whether there is higher
> version released ( current version is 3.4 released in 1997)

Yes, there is a later version:

  ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-beta.tar.Z
or 
  ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-beta.ZIP

provide a compressed tar file or ZIP archive of source code for the
latest beta test release, version 3.5beta6, October 2000.  This is
very similar to the final release of netCDF 3.5, which will have only
a few minor additions for building netCDF on less common operating
systems and compilation environments.  If you want to know about what
has changed between version 3.4 and 3.5, see the RELEASE_NOTES in the
3.5 beta distribution.

--Russ

_____________________________________________________________________

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