gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gdncvarinquireia.f90 File Reference

netCDF 変数の次元長を問い合わせる (配列版) More...

Go to the source code of this file.

Functions/Subroutines

subroutine gdncvarinquireia (var, dimlen)

Detailed Description

netCDF 変数の次元長を問い合わせる (配列版)

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 )

変数の次元長を取得

指定された変数の各次元の長さを返します。 dimlen 配列は少なくとも ndims 個の要素を持つ必要があります。

Parameters
[in]var変数ハンドル
[out]dimlen次元長を格納する配列

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: