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

Query dimension order number from dimension relative name. More...

Go to the source code of this file.

Functions/Subroutines

integer function gtvardimname2ord (var, name)
 

Detailed Description

Query dimension order number from dimension relative name.

Author
Eizi TOYODA, Yasuhiro MORIKAWA

Definition in file gtvardimname2ord.f90.

Function/Subroutine Documentation

◆ gtvardimname2ord()

integer function gtvardimname2ord ( type(gt_variable), intent(in)  var,
character(len = *), intent(in)  name 
)

Get dimension order from dimension relative name

A variable belongs to multiple dimensions. Dimensions are identified by order numbers, but since the order of dimensions in a variable can be exchanged, it is sometimes convenient to identify them with short names relative to the variable. For example, for variable filename?var, used with comma notation like filename?var,dim=1 (see "5.4 Comma Notation" in gtool4 netCDF Convention). (For netCDF variable filename?varname, dimension name dim would indicate filename?dim, but such relationship does not always hold.)

The Dimname_to_Dimord procedure gives the dimension order number from such relative dimension names. Valid numbers are 1 or greater; numbers 0 or less indicate an error.

Parameters
[in]varVariable handle
[in]nameDimension relative name
Returns
Dimension order number (0 or less indicates error)

Definition at line 63 of file gtvardimname2ord.f90.

64 use gtdata_types, only: gt_variable
65 use dc_string, only: stoi
68 use gtdata_internal_map, only: var_class, vtb_class_netcdf
69 implicit none
70 type(gt_variable), intent(in):: var
71 character(len = *), intent(in):: name
72 integer:: class, cid
73 result = -1
74 if (name == ' ') return
75 result = stoi(name)
76 if (result /= 0) return
77 ! 個別層に問い合わせて次元番号を得ようと試みる。
78 call var_class(var, class, cid)
79 if (class == vtb_class_netcdf) then
80 result = search_dim(gd_nc_variable(cid), name)
81 endif
82 ! map 表から次元名を使って次元番号を得ようと試みる。
Handling character types.
Definition dc_string.f90:83
subroutine, public var_class(var, class, cid)

References gtdata_internal_map::var_class().

Here is the call graph for this function: