Next: , Previous: NF90_INQ_USER_TYPE, Up: NF90_INQ_USER_TYPE


5.5.1 Set a Variable Length Array with NF90_PUT_VLEN_ELEMENT

Use this to set the element of the (potentially) n-dimensional array of VLEN. That is, this sets the data in one variable length array.

Usage

     INTEGER FUNCTION NF90_PUT_VLEN_ELEMENT(INTEGER NCID, INTEGER XTYPE,
             CHARACTER*(*) VLEN_ELEMENT, INTEGER LEN, DATA)
NCID
The ncid of the file that contains the VLEN type.
XTYPE
The type of the VLEN.
VLEN_ELEMENT
The VLEN element to be set.
LEN
The number of entries in this array.
DATA
The data to be stored. Must match the base type of this VLEN.

Errors

NF90_NOERR
No error.
NF90_EBADTYPE
Can't find the typeid.
NF90_EBADID
ncid invalid.
NF90_EBADGRPID
Group ID part of ncid was invalid.

Example

This example is from nf90_test/ftst_vars4.F.

     C     Set up the vlen with this helper function, since F77 can't deal
     C     with pointers.
           retval = nf90_put_vlen_element(ncid, vlen_typeid, vlen,
          &     vlen_len, data1)
           if (retval .ne. nf90_noerr) call handle_err(retval)