Next: , Previous: Variable Length Array, Up: Variable Length Array


5.7.1 Define a Variable Length Array (VLEN): NF_DEF_VLEN

Use this function to define a variable length array type.

Usage

     INTEGER FUNCTION NF_DEF_VLEN(INTEGER NCID, CHARACTER*(*) NAME,
             INTEGER BASE_TYPEID, INTEGER XTYPEP)
NCID
The ncid of the file to create the VLEN type in.
NAME
A name for the VLEN type.
BASE_TYPEID
The typeid of the base type of the VLEN. For example, for a VLEN of shorts, the base type is NF_SHORT. This can be a user defined type.
XTYPEP
The typeid of the new VLEN type will be set here.

Errors

NF_NOERR
No error.
NF_EMAXNAME
NF_MAX_NAME exceeded.
NF_ENAMEINUSE
Name is already in use.
NF_EBADNAME
Attribute or variable name contains illegal characters.
NF_EBADID
ncid invalid.
NF_EBADGRPID
Group ID part of ncid was invalid.
NF_EINVAL
Size is invalid.
NF_ENOMEM
Out of memory.

Example

This example is from nf_test/ftst_vars4.F.

     C     Create the vlen type.
           retval = nf_def_vlen(ncid, vlen_type_name, nf_int, vlen_typeid)
           if (retval .ne. nf_noerr) call handle_err(retval)