gdncvarinquireia.f90
Go to the documentation of this file.
1 ! Copyright (C) GFD Dennou Club, 2000. All rights reserved.
2 !
3 ! 引数は ndims 個でなければならない。
4 subroutine gdncvarinquireia(var, dimlen)
6  ! use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY
8  use netcdf, only: nf90_noerr, nf90_inquire_dimension
9  type(gd_nc_variable), intent(in):: var
10  integer, intent(out):: dimlen(:)
11  type(gd_nc_variable_entry):: ent
12  integer:: stat, i
13 
14  dimlen(:) = -1
15 
16  stat = vtable_lookup(var, ent)
17  if (stat /= nf90_noerr) return
18 
19  if (ent%varid > 0) then
20  if (.not. associated(ent%dimids)) return
21  do, i = 1, min(size(dimlen), size(ent%dimids))
22  stat = nf90_inquire_dimension(ent%fileid, ent%dimids(i), len = dimlen(i))
23  if (stat /= nf90_noerr ) exit
24  enddo
25  else
26  stat = nf90_inquire_dimension(ent%fileid, ent%dimid, len = dimlen(1))
27  if (stat /= nf90_noerr ) dimlen(1) = -1
28  endif
29 end subroutine
integer function, public vtable_lookup(var, entry)
subroutine gdncvarinquireia(var, dimlen)