Next: , Previous: NF_INSERT_ENUM, Up: Enum Type


5.9.3 Learn About a Enum Type: NF_INQ_ENUM

Get information about a user-defined enumeration type.

Usage

     INTEGER FUNCTION NF_INQ_ENUM(INTEGER NCID, INTEGER XTYPE,
             CHARACTER*(*) NAME, INTEGER BASE_NF_TYPE, INTEGER BASE_SIZE,
             INTEGER NUM_MEMBERS)
NCID
The group ID of the group which holds the enum type.
XTYPE
The typeid for this enum type, as returned by NF_DEF_ENUM, or NF_INQ_VAR.
NAME
Character array which will get the name. It will have a maximum length of NF_MAX_NAME.
BASE_NF_TYPE
An integer which will get the base integer type of this enum.
BASE_SIZE
An integer which will get the size (in bytes) of the base integer type of this enum.
NUM_MEMBERS
An integer which will get the number of members defined for this enumeration type.

Errors

NF_NOERR
No error.
NF_EBADTYPEID
Bad type id.
NF_EHDFERR
An error was reported by the HDF5 layer.

Example

In this example from nf_test/ftst_vars3.F, an enum type is created and then examined:

           retval = nf_inq_enum(ncid, typeids(1), type_name, base_type,
          &     base_size, num_members)
           if (retval .ne. nf_noerr) call handle_err(retval)
           if (base_type .ne. NF_INT .or. num_members .ne. 2) stop 2