gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Functions/Subroutines
gdncattrinquire.f90 File Reference

属性情報の問い合わせ More...

Go to the source code of this file.

Functions/Subroutines

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

Detailed Description

属性情報の問い合わせ

Author
GFD Dennou Club

Definition in file gdncattrinquire.f90.

Function/Subroutine Documentation

◆ gdncattrinquire()

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

属性の型情報を取得

指定された属性の型名を返します。

Parameters
[in]var変数ハンドル
[in]attrname属性名
[out]xtype型名 (省略可能)

Definition at line 34 of file gdncattrinquire.f90.

38 use netcdf, only: nf90_max_name, nf90_noerr, nf90_inquire_attribute
39 implicit none
40 type(GD_NC_VARIABLE), intent(in):: var
41 character(len=*), intent(in):: attrname
42 character(len=*), intent(out), optional:: xtype
43 type(GD_NC_VARIABLE_ENTRY):: ent
44 integer:: varid, i_xtype, stat
45 character(len=NF90_MAX_NAME):: anam
46 stat = vtable_lookup(var, ent)
47 if (stat /= nf90_noerr) return
48 if (present(xtype)) then
49 call inquireplus(var, attrname, varid, anam)
50 stat = nf90_inquire_attribute(ent%fileid, varid, anam, xtype=i_xtype)
51 if (stat /= nf90_noerr) i_xtype = 0
52 call gdncxtypename(i_xtype, xtype)
53 endif
an 層の内部使用ルーチン
integer function, public vtable_lookup(var, entry)

References 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 
)

netCDF アクセス用の実際の varid と属性名を取得

netCDF アクセスに使う実際の varid と属性名を決定します:

  • attrname の先頭が '+': グローバル属性を強制指示
  • attrname の先頭が '-': 変数属性、グローバル属性の順で検索
Parameters
[in]var変数ハンドル
[in]attrname属性名 (接頭辞を含む場合あり)
[out]varidnetCDF 変数 ID
[out]nf_attrnamenetCDF 属性名

Definition at line 78 of file gdncattrinquire.f90.

81 use dc_url, only: gt_plus
82 use netcdf, only: nf90_global, nf90_noerr, nf90_inquire_attribute
83 type(GD_NC_VARIABLE), intent(in):: var
84 character(len=*), intent(in):: attrname
85 integer, intent(out):: varid
86 type(GD_NC_VARIABLE_ENTRY):: ent
87 character(len=*), intent(out):: nf_attrname
88 integer:: stat, n
89 stat = vtable_lookup(var, ent)
90 if (stat /= nf90_noerr) return
91 if (attrname(1:1) == gt_plus) then
92 varid = nf90_global
93 nf_attrname = attrname(2: )
94 else if (attrname(1:1) == '-') then
95 varid = ent%varid
96 nf_attrname = attrname(2: )
97 stat = nf90_inquire_attribute(ent%fileid, varid, nf_attrname, len = n)
98 if (stat == nf90_noerr) return
99 varid = nf90_global
100 else
101 varid = ent%varid
102 nf_attrname = attrname
103 endif
変数 URL の文字列解析
Definition dc_url.f90:61
character, parameter, public gt_plus
Definition dc_url.f90:109

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

Here is the call graph for this function: