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

Variable attribute retrieval. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarattrrewind (var)
 
subroutine gtvarattrnext (var, name, end)
 

Detailed Description

Variable attribute retrieval.

Author
Eizi TOYODA, Yasuhiro MORIKAWA

Definition in file gtvarattrsearch.f90.

Function/Subroutine Documentation

◆ gtvarattrnext()

subroutine gtvarattrnext ( type(gt_variable), intent(inout), target  var,
character(len = *), intent(out)  name,
logical, intent(out), optional  end 
)

Get attribute list from variable (get next)

See Attr_Rewind.

Parameters
[in,out]varVariable handle
[out]nameAttribute name
[out]end.true. when all attributes have been enumerated (optional)

Definition at line 97 of file gtvarattrsearch.f90.

98 use gtdata_types, only: gt_variable
99 use gtdata_internal_map, only: var_class, vtb_class_netcdf
102 implicit none
103 type(GT_VARIABLE), intent(inout), target:: var
104 character(len = *), intent(out):: name
105 logical, intent(out), optional:: end
106 integer:: class, cid
107continue
108 call var_class(var, class, cid)
109 select case(class)
110 case(vtb_class_netcdf)
111 call attr_next(gd_nc_variable(cid), name, end)
112 end select
subroutine, public var_class(var, class, cid)

References gtdata_internal_map::var_class().

Here is the call graph for this function:

◆ gtvarattrrewind()

subroutine gtvarattrrewind ( type(gt_variable), intent(inout), target  var)

Get attribute list from variable (initialization)

Subroutine used to get a list of attribute names from var. You can get the attribute list using this subroutine and Attr_Next.

To enumerate all attributes for a variable var, first call Attr_Rewind, then call Attr_Next. The first call returns the first attribute, the next call returns the next attribute name. After the last attribute, end == .true..

Example:

use gtool5
type(GT_VARIABLE):: var
character(len = STRING):: attrname
logical:: end
call attr_rewind(var)
do
call attr_next(var, attrname, end)
if (end) exit
write(*,*) trim(attrname)
enddo
Parameters
[in,out]varVariable handle

Definition at line 62 of file gtvarattrsearch.f90.

63 use gtdata_types, only: gt_variable
64 use gtdata_internal_map, only: var_class, vtb_class_netcdf
67 implicit none
68 type(GT_VARIABLE), intent(inout), target:: var
69 integer:: class, cid
70continue
71 call var_class(var, class, cid)
72 select case(class)
73 case(vtb_class_netcdf)
75 end select

References gtdata_internal_map::var_class().

Here is the call graph for this function: