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

Go to the source code of this file.

Functions/Subroutines

integer function gtvardimname2ord (var, name)

Function/Subroutine Documentation

◆ gtvardimname2ord()

integer function gtvardimname2ord ( type(gt_variable), intent(in) var,
character(len = *), intent(in) name )

Definition at line 13 of file gtvardimname2ord.f90.

14 !
15 !== 次元相対名から次元順序番号の問い合わせ
16 !
17 ! 変数には複数の次元が所属します。次元は順序番号で識別されますが、
18 ! 変数における次元の順序は入れ替えることもできるため、
19 ! 変数に相対的短い名前で識別することが便利な場合もあります。
20 ! たとえば変数 <tt>filename?var</tt> に対して
21 ! <tt>filename?var,dim=1</tt> のような
22 ! コンマ記法 ({gtool4 netCDF 規約}[link:../xref.htm#label-6] の
23 ! 「5.4 コンマ記法」参照)
24 ! で用いられるものです。(NetCDF 変数 <tt>filename?varname</tt>
25 ! に対する次元名 <tt>dim</tt> は <tt>filename?dim</tt>
26 ! を指示するでしょうが、必ずしもそのような関係が成り立つとは限りません)
27 !
28 ! Dimname_to_Dimord 手続はこのような相対次元名から次元順序番号を与えます。
29 ! 正当な番号は1以上であり、0以下の番号はエラーを示します。
30 !
31 use gtdata_types, only: gt_variable
32 use dc_string, only: stoi
35 use gtdata_internal_map, only: var_class, vtb_class_netcdf
36 implicit none
37 type(gt_variable), intent(in):: var
38 character(len = *), intent(in):: name
39 integer:: class, cid
40 result = -1
41 if (name == ' ') return
42 result = stoi(name)
43 if (result /= 0) return
44 ! 個別層に問い合わせて次元番号を得ようと試みる。
45 call var_class(var, class, cid)
46 if (class == vtb_class_netcdf) then
47 result = search_dim(gd_nc_variable(cid), name)
48 endif
49 ! map 表から次元名を使って次元番号を得ようと試みる。
subroutine, public var_class(var, class, cid)

References gtdata_internal_map::var_class().

Here is the call graph for this function: