Loading...
Searching...
No Matches
Functions/Subroutines
gdncsearchdim.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

integer function gdncsearchdim (var, dimname)
 

Function/Subroutine Documentation

◆ gdncsearchdim()

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

Definition at line 10 of file gdncsearchdim.f90.

11 !
12 ! 次元変数 ID の取得
13 !
17 use netcdf, only: nf90_ebaddim, nf90_noerr, nf90_inq_dimid
18 use dc_error
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
29 stat = vtable_lookup(var, ent)
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
41 stat = gt_enomoredims
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
Definition dc_error.f90:528
integer function, public vtable_lookup(var, entry)

References dc_error::gt_enomoredims, and gtdata_netcdf_internal::vtable_lookup().

Here is the call graph for this function: