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

次元変数 ID の検索 More...

Go to the source code of this file.

Functions/Subroutines

integer function gdncsearchdim (var, dimname)
 

Detailed Description

次元変数 ID の検索

Author
Eizi TOYODA, Yasuhiro MORIKAWA

Definition in file gdncsearchdim.f90.

Function/Subroutine Documentation

◆ gdncsearchdim()

integer function gdncsearchdim ( type(gd_nc_variable), intent(in)  var,
character(*), intent(in)  dimname 
)

次元名から次元順序を取得

変数の次元リスト内での次元の位置 (1始まり) を返します。

Parameters
[in]var変数ハンドル
[in]dimname検索する次元名
Returns
次元順序 (1始まり)、エラー時は NF90_EBADDIM

Definition at line 35 of file gdncsearchdim.f90.

39 use netcdf, only: nf90_ebaddim, nf90_noerr, nf90_inq_dimid
40 use dc_error
41 use dc_trace, only: beginsub, endsub
42 implicit none
43 type(GD_NC_VARIABLE), intent(in):: var
44 character(*), intent(in):: dimname
45 type(GD_NC_VARIABLE_ENTRY):: ent
46 integer:: stat, dimid, i
47 character(*), parameter:: subname = 'GDNcSearchDim'
48continue
49 call beginsub(subname, 'var=%d dimname=%c', i=(/var%id/), c1=trim(dimname))
50 result = nf90_ebaddim
51 stat = vtable_lookup(var, ent)
52 if (stat /= nf90_noerr) goto 999
53
54 stat = nf90_inq_dimid(ent%fileid, dimname, dimid)
55 if (stat /= nf90_noerr) goto 999
56
57 if (dimid == ent%dimid) then
58 result = 1
59 goto 999
60 endif
61
62 if (.not. associated(ent%dimids)) then
63 stat = gt_enomoredims
64 goto 999
65 endif
66 do, i = 1, size(ent%dimids)
67 if (ent%dimids(i) == dimid) then
68 result = i
69 goto 999
70 endif
71 enddo
72
73999 continue
74 call endsub(subname, 'result=%d', i=(/result/))
75 return
エラー処理用モジュール
Definition dc_error.f90:454
integer, parameter, public gt_enomoredims
-101 以下: データ構造のエラー
Definition dc_error.f90:507
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
integer function, public vtable_lookup(var, entry)

References dc_trace::beginsub(), dc_trace::endsub(), dc_error::gt_enomoredims, and gtdata_netcdf_internal::vtable_lookup().

Here is the call graph for this function: