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


5.5 Learn About a User Defined Type: NF_INQ_USER_TYPE

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

Usage

     INTEGER FUNCTION NF_INQ_USER_TYPE(INTEGER NCID, INTEGER XTYPE,
             CHARACTER*(*) NAME, INTEGER SIZE, INTEGER BASE_NF_TYPE,
             INTEGER NFIELDS, INTEGER CLASS)
NCID
The ncid for the group containing the user defined type.
XTYPE
The typeid for this type, as returned by NF_DEF_COMPOUND, NF_DEF_OPAQUE, NF_DEF_ENUM, NF_DEF_VLEN, or NF_INQ_VAR.
NAME
The name of the user defined type will be copied here. It will be NF_MAX_NAME bytes or less.
SIZE
The (in-memory) size of the user defined type will be copied here.
BASE_NF_TYPE
The base typeid will be copied here for vlen and enum types.
NFIELDS
The number of fields will be copied here for enum and compound types.
CLASS
The class of the user defined type, NF_VLEN, NF_OPAQUE, NF_ENUM, or NF_COMPOUND, will be copied here.

Errors

NF_NOERR
No error.
NF_EBADTYPEID
Bad typeid.
NF_EBADFIELDID
Bad fieldid.
NF_EHDFERR
An error was reported by the HDF5 layer.

Example

This example is from nf_test/ftst_types2.F.

     C     Check the type.
           retval = nf_inq_user_type(ncid, typeids(1), name_in, size_in,
          &     base_type_in, nfields_in, class_in)
           if (retval .ne. nf_noerr) call handle_err(retval)