Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Previous: NF_INQ_GRP_PARENT, Up: Groups



3.9 Create a New Group: NF_DEF_GRP

Create a group. Its location id is returned in new_ncid.

Usage

     INTEGER FUNCTION NF_DEF_GRP(INTEGER PARENT_NCID, CHARACTER*(*) NAME,
             INTEGER NEW_NCID)
PARENT_NCID
The group id of the parent group.
NAME
The name of the new group.
NEW_NCID
The ncid of the new group will be placed there.

Errors

NF_NOERR
No error.
NF_EBADID
Bad group id.
NF_ENAMEINUSE
That name is in use. Group names must be unique within a group.
NF_EMAXNAME
Name exceed max length NF_MAX_NAME.
NF_EBADNAME
Name contains illegal characters.
NF_ENOTNC4
Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4 operations can only be performed on files defined with a create mode which includes flag HDF5. (see NF_OPEN).
NF_ESTRICTNC3
This file was created with the strict netcdf-3 flag, therefore netcdf-4 operations are not allowed. (see NF_OPEN).
NF_EHDFERR
An error was reported by the HDF5 layer.
NF_EPERM
Attempt to write to a read-only file.
NF_ENOTINDEFINE
Not in define mode.

Example

In this exampe rom nf_test/ftst_groups.F, a groups is reated, and then a sub-group is created in that group.

     C     Create the netCDF file.
           retval = nf_create(file_name, NF_NETCDF4, ncid)
           if (retval .ne. nf_noerr) call handle_err(retval)
     
     C     Create a group and a subgroup.
           retval = nf_def_grp(ncid, group_name, grpid)
           if (retval .ne. nf_noerr) call handle_err(retval)
           retval = nf_def_grp(grpid, sub_group_name, sub_grpid)
           if (retval .ne. nf_noerr) call handle_err(retval)
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690