11
12
13
17 use netcdf, only: nf90_ebaddim, nf90_noerr, nf90_inq_dimid
19 use dc_trace, only: beginsub, endsub
20 implicit none
21 type(GD_NC_VARIABLE), intent(in):: var
22 character(*), intent(in):: dimname
23 type(GD_NC_VARIABLE_ENTRY):: ent
24 integer:: stat, dimid, i
25 character(*), parameter:: subname = 'GDNcSearchDim'
26continue
27 call beginsub(subname, 'var=%d dimname=%c', i=(/var%id/), c1=trim(dimname))
28 result = nf90_ebaddim
30 if (stat /= nf90_noerr) goto 999
31
32 stat = nf90_inq_dimid(ent%fileid, dimname, dimid)
33 if (stat /= nf90_noerr) goto 999
34
35 if (dimid == ent%dimid) then
36 result = 1
37 goto 999
38 endif
39
40 if (.not. associated(ent%dimids)) then
42 goto 999
43 endif
44 do, i = 1, size(ent%dimids)
45 if (ent%dimids(i) == dimid) then
46 result = i
47 goto 999
48 endif
49 enddo
50
51999 continue
52 call endsub(subname, 'result=%d', i=(/result/))
53 return
integer, parameter, public gt_enomoredims
integer function, public vtable_lookup(var, entry)