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 NF_INQ_USER_TYPE.
INTEGER FUNCTION NF_INQ_TYPE(INTEGER NCID, INTEGER XTYPE, CHARACTER*(*) NAME, INTEGER SIZE)
NCID
XTYPE
NAME
SIZEP
NF_NOERR
NF_EBADTYPEID
NF_ENOTNC4
NF_ESTRICTNC3
NF_EBADGRPID
NF_EBADID
NF_EHDFERR
This example is from the test program nf_test/ftst_vars3.F, and it uses all the possible inquiry functions on an enum type.
C Check the enum type. retval = NF_INQ_TYPEIDS(ncid, num_types, typeids) if (retval .ne. nf_noerr) call handle_err(retval) if (num_types .ne. MAX_TYPES) stop 2 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 retval = nf_inq_enum_member(ncid, typeids(1), 1, member_name, & member_value) if (retval .ne. nf_noerr) call handle_err(retval) if (member_name(1:len(one_name)) .ne. one_name) stop 2