39 use netcdf, only: nf90_ebaddim, nf90_noerr, nf90_inq_dimid
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
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
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
integer, parameter, public gt_enomoredims
-101 以下: データ構造のエラー
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
integer function, public vtable_lookup(var, entry)