gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gdncvarinquireia.f90 File Reference

Inquire dimension lengths of a netCDF variable (array version) . More...

Go to the source code of this file.

Functions/Subroutines

subroutine gdncvarinquireia (var, dimlen)

Detailed Description

Inquire dimension lengths of a netCDF variable (array version)

.

Author
GFD Dennou Club

Definition in file gdncvarinquireia.f90.

Function/Subroutine Documentation

◆ gdncvarinquireia()

subroutine gdncvarinquireia ( type(gd_nc_variable), intent(in) var,
integer, dimension(:), intent(out) dimlen )

Get dimension lengths for a variable

Returns the length of each dimension for the specified variable. The dimlen array must have at least ndims elements.

Parameters
[in]varVariable handle
[out]dimlenArray to store dimension lengths

Definition at line 34 of file gdncvarinquireia.f90.

36 ! use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY
38 use netcdf, only: nf90_noerr, nf90_inquire_dimension
39 type(GD_NC_VARIABLE), intent(in):: var
40 integer, intent(out):: dimlen(:)
41 type(GD_NC_VARIABLE_ENTRY):: ent
42 integer:: stat, i
43
44 dimlen(:) = -1
45
46 stat = vtable_lookup(var, ent)
47 if (stat /= nf90_noerr) return
48
49 if (ent%varid > 0) then
50 if (.not. associated(ent%dimids)) return
51 do, i = 1, min(size(dimlen), size(ent%dimids))
52 stat = nf90_inquire_dimension(ent%fileid, ent%dimids(i), len = dimlen(i))
53 if (stat /= nf90_noerr ) exit
54 enddo
55 else
56 stat = nf90_inquire_dimension(ent%fileid, ent%dimid, len = dimlen(1))
57 if (stat /= nf90_noerr ) dimlen(1) = -1
58 endif
integer function, public vtable_lookup(var, entry)

References gtdata_netcdf_internal::vtable_lookup().

Here is the call graph for this function: