GETNCERR Function

Retrieves the current value of the “ncerr” variable as discussed in the error section of the NetCDF User’s Guide.

Usage

    ncerr = GETNCERR([errstr])

Input Parameters

errstr—(optional) A variable to hold the corresponding error string to the ncerr variable.

Keywords

Help—List the usage for this function.

Usage—List the usage for this function. (Same as the Help keyword.)

Return Value

ncerr—The current value of the ncerr variable.

Discussion

GETNCERR retrieves the current value of the “ncerr” variable as discussed in the Error Handling section of the NetCDF User’s Guide. This variable gets set to a non-zero value when an error occurs in a call to the NetCDF functions. A string describing the error will be returned in the optional “errstr” parameter.

Note: GETNCERR is only valid for the NetCDF functionality included in the optional PV‑WAVE HDF interface.

The value of “ncerr” does not change when a valid NetCDF function call is made.

Example

@hdf_startup
@hdf_common
; This call fails because the file does not exist.
ncid = NCOPEN("foo.nc", NC_NOWRITE) 
  ; % NCOPEN: error in HDF return status.
status = NCREDEF(ncid) 
  ; ncredef: -1 is not a valid cdfid
  ; % NCREDEF: error in HDF return status.
ncerr = GETNCERR(errstr) 
INFO, ncerr, errstr 
; PV-WAVE prints: 
;    NCERR LONG = 1 
;    ERRSTR STRING = 'Not a netcdf id'

See Also

GETNCOPTS,   SETNCOPTS

Also refer to the NetCDF User’s Guide.

For more information on using the PV‑WAVE HDF interface and the calling sequence for the entire suite of HDF base functions, refer to PV-WAVE HDF Interface.

For a complete list of the HDF convenience routines, refer to Functional Summary of Routines.