Loading...
Searching...
No Matches
Functions/Subroutines
gtvarattrsearch.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

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

Function/Subroutine Documentation

◆ gtvarattrnext()

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

Definition at line 57 of file gtvarattrsearch.f90.

58 !
59 !== 変数からの属性リスト取得
60 !
61 ! Attr_Rewind を参照してください。
62 !
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 character(len = *), intent(out):: name
70 logical, intent(out), optional:: end
71 integer:: class, cid
72continue
73 call var_class(var, class, cid)
74 select case(class)
75 case(vtb_class_netcdf)
76 call attr_next(gd_nc_variable(cid), name, end)
77 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)

Definition at line 14 of file gtvarattrsearch.f90.

15 !
16 !== 変数からの属性リスト取得 (初期化用)
17 !
18 ! *var* から属性名のリストを取得するために利用するサブルーチンです。
19 ! このサブルーチンと Attr_Next によって属性リスト一覧を取得できます。
20 !
21 ! ある変数 *var* について全ての属性を列挙するためには、まず
22 ! Attr_Rewind を呼んだ後、Attr_Next を呼びます。最初の呼び出しで
23 ! 最初の属性が、次の呼び出しで次の属性の名前が得られます。最後の
24 ! 属性のあとでは end == .true. となります。
25 !
26 ! 以下のサンプルソースコードを参照ください。
27 !
28 !
29 ! ! 属性一覧の取得
30 ! use gtool5
31 ! type(GT_VARIABLE):: var
32 ! character(len = STRING):: attrname
33 ! logical:: end
34 !
35 ! call Attr_Rewind(var)
36 ! do
37 ! call Attr_Next(var, attrname, end)
38 ! if (end) exit
39 ! write(*,*) trim(attrname)
40 ! enddo
41 !
42 use gtdata_types, only: gt_variable
43 use gtdata_internal_map, only: var_class, vtb_class_netcdf
46 implicit none
47 type(GT_VARIABLE), intent(inout), target:: var
48 integer:: class, cid
49continue
50 call var_class(var, class, cid)
51 select case(class)
52 case(vtb_class_netcdf)
54 end select

References gtdata_internal_map::var_class().

Here is the call graph for this function: