Loading...
Searching...
No Matches
gdncattrinquire.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine gdncattrinquire (var, attrname, xtype)
subroutine gdncattrinquireplus (var, attrname, varid, nf_attrname)

Function/Subroutine Documentation

◆ gdncattrinquire()

subroutine gdncattrinquire ( type(gd_nc_variable), intent(in) var,
character(len=*), intent(in) attrname,
character(len=*), intent(out), optional xtype )

Definition at line 4 of file gdncattrinquire.f90.

8 use netcdf, only: nf90_max_name, nf90_noerr, nf90_inquire_attribute
9 use dc_url, only: gt_plus
10 implicit none
11 type(GD_NC_VARIABLE), intent(in):: var
12 character(len=*), intent(in):: attrname
13 character(len=*), intent(out), optional:: xtype
14 type(GD_NC_VARIABLE_ENTRY):: ent
15 integer:: varid, i_xtype, stat
16 character(len=NF90_MAX_NAME):: anam
17 stat = vtable_lookup(var, ent)
18 if (stat /= nf90_noerr) return
19 if (present(xtype)) then
20 call inquireplus(var, attrname, varid, anam)
21 stat = nf90_inquire_attribute(ent%fileid, varid, anam, xtype=i_xtype)
22 if (stat /= nf90_noerr) i_xtype = 0
23 call gdncxtypename(i_xtype, xtype)
24 endif
character, parameter, public gt_plus
Definition dc_url.f90:92
integer function, public vtable_lookup(var, entry)

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

Here is the call graph for this function:

◆ gdncattrinquireplus()

subroutine gdncattrinquireplus ( type(gd_nc_variable), intent(in) var,
character(len=*), intent(in) attrname,
integer, intent(out) varid,
character(len=*), intent(out) nf_attrname )

Definition at line 27 of file gdncattrinquire.f90.

28 !
29 ! 実際にアクセスするときに使う varid, attrname を得る.
30 ! attrname の先頭が '+' ---> 大域属性を強制指示.
31 ! attrname の先頭が '-' ---> 変数属性、大域属性の順で検索.
32 !
35 use dc_url, only: gt_plus
36 use netcdf, only: nf90_global, nf90_noerr, nf90_inquire_attribute
37 type(GD_NC_VARIABLE), intent(in):: var
38 character(len=*), intent(in):: attrname
39 integer, intent(out):: varid
40 type(GD_NC_VARIABLE_ENTRY):: ent
41 character(len=*), intent(out):: nf_attrname
42 integer:: stat, n
43 stat = vtable_lookup(var, ent)
44 if (stat /= nf90_noerr) return
45 if (attrname(1:1) == gt_plus) then
46 varid = nf90_global
47 nf_attrname = attrname(2: )
48 else if (attrname(1:1) == '-') then
49 varid = ent%varid
50 nf_attrname = attrname(2: )
51 stat = nf90_inquire_attribute(ent%fileid, varid, nf_attrname, len = n)
52 if (stat == nf90_noerr) return
53 varid = nf90_global
54 else
55 varid = ent%varid
56 nf_attrname = attrname
57 endif

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

Here is the call graph for this function: