gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Functions/Subroutines
gdncvardelattr.f90 File Reference

Delete an attribute from a netCDF variable . More...

Go to the source code of this file.

Functions/Subroutines

subroutine gdncvardelattr (var, name, err)
 

Detailed Description

Delete an attribute from a netCDF variable

.

Author
GFD Dennou Club

Definition in file gdncvardelattr.f90.

Function/Subroutine Documentation

◆ gdncvardelattr()

subroutine gdncvardelattr ( type(gd_nc_variable), intent(in)  var,
character(len = *), intent(in)  name,
logical, intent(out), optional  err 
)

Delete a named attribute

Removes an attribute from a variable. If the name starts with '+', the attribute is treated as a global attribute.

Parameters
[in]varVariable handle
[in]nameAttribute name
[out]errError flag (optional)

Definition at line 35 of file gdncvardelattr.f90.

39 use netcdf, only: nf90_noerr, nf90_del_att, nf90_global, nf90_enotindefine
40 use dc_url, only: gt_plus
41 use dc_error
42 implicit none
43 type(GD_NC_VARIABLE), intent(in):: var
44 character(len = *), intent(in):: name
45 logical, intent(out), optional:: err
46 type(GD_NC_VARIABLE_ENTRY):: ent
47 integer:: stat
48continue
49 stat = vtable_lookup(var, ent)
50 if (stat /= nf90_noerr) goto 999
51 stat = nf90_del_att(ent%fileid, ent%varid, name=name)
52 if (stat == 0) goto 999
53 if (stat /= nf90_enotindefine) goto 999
54 stat = gdncfiledefinemode(ent%fileid)
55 if (stat /= nf90_noerr) goto 999
56 if (name(1:1) == gt_plus) then
57 stat = nf90_del_att(ent%fileid, nf90_global, name=name(2:))
58 else
59 stat = nf90_del_att(ent%fileid, ent%varid, name=name)
60 endif
61
62999 continue
63 call storeerror(stat, 'GDNcVarPutAttrChar', err)
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
Variable URL string parser.
Definition dc_url.f90:61
character, parameter, public gt_plus
Definition dc_url.f90:109
integer function, public vtable_lookup(var, entry)

References dc_url::gt_plus, dc_error::storeerror(), and gtdata_netcdf_internal::vtable_lookup().

Here is the call graph for this function: