Next: , Previous: nf90_inq_typeid, Up: User Defined Data Types


5.4 Learn About a User Defined Type: NF90_INQ_TYPE

Given an ncid and a typeid, get the information about a type. This function will work on any type, including atomic and any user defined type, whether compound, opaque, enumeration, or variable length array.

For even more information about a user defined type NF90_INQ_USER_TYPE.

Usage

       function nf90_inq_type(ncid, xtype, name, size, nfields)
         integer, intent(in) :: ncid
         integer, intent(in) :: xtype
         character (len = *), intent(out) :: name
         integer, intent(out) :: size
         integer, intent(out) :: nfields
         integer :: nf90_inq_type
NCID
The ncid for the group containing the type (ignored for atomic types).
XTYPE
The typeid for this type, as returned by NF90_DEF_COMPOUND, NF90_DEF_OPAQUE, NF90_DEF_ENUM, NF90_DEF_VLEN, or NF90_INQ_VAR, or as found in netcdf.inc in the list of atomic types (NF90_CHAR, NF90_INT, etc.).
NAME
The name of the user defined type will be copied here. It will be NF90_MAX_NAME bytes or less. For atomic types, the type name from CDL will be given.
SIZEP
The (in-memory) size of the type (in bytes) will be copied here. VLEN type size is the size of one element of the VLEN. String size is returned as the size of one char.

Return Codes

NF90_NOERR
No error.
NF90_EBADTYPEID
Bad typeid.
NF90_ENOTNC4
Seeking a user-defined type in a netCDF-3 file.
NF90_ESTRICTNC3
Seeking a user-defined type in a netCDF-4 file for which classic model has been turned on.
NF90_EBADGRPID
Bad group ID in ncid.
NF90_EBADID
Type ID not found.
NF90_EHDFERR
An error was reported by the HDF5 layer.

Example