Create a group. Its location id is returned in new_ncid.
INTEGER FUNCTION NF_DEF_GRP(INTEGER PARENT_NCID, CHARACTER*(*) NAME,
INTEGER NEW_NCID)
PARENT_NCIDNAMENEW_NCIDNF_NOERRNF_EBADIDNF_ENAMEINUSENF_EMAXNAMENF_EBADNAMENF_ENOTNC4NF_ESTRICTNC3NF_EHDFERRNF_EPERMNF_ENOTINDEFINEIn 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)