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 62 of file gtvarattrsearch.f90.

References gtdata_internal_map::var_class().

62  !
63  !== 変数からの属性リスト取得
64  !
65  ! Attr_Rewind を参照してください。
66  !
67  use gtdata_types, only: gt_variable
68  use gtdata_internal_map, only: var_class, vtb_class_netcdf, vtb_class_memory
73  implicit none
74  type(gt_variable), intent(inout), target:: var
75  character(len = *), intent(out):: name
76  logical, intent(out), optional:: end
77  integer:: class, cid
78 continue
79  call var_class(var, class, cid)
80  select case(class)
81  case(vtb_class_netcdf)
82  call attr_next(gd_nc_variable(cid), name, end)
83  case(vtb_class_memory)
84  call attr_next(gd_mem_variable(cid), name, end)
85  end select
subroutine, public var_class(var, class, cid)
Here is the call graph for this function:

◆ gtvarattrrewind()

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

Definition at line 15 of file gtvarattrsearch.f90.

References gtdata_internal_map::var_class().

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, vtb_class_memory
48  implicit none
49  type(gt_variable), intent(inout), target:: var
50  integer:: class, cid
51 continue
52  call var_class(var, class, cid)
53  select case(class)
54  case(vtb_class_netcdf)
55  call attr_rewind(gd_nc_variable(cid))
56  case(vtb_class_memory)
57  call attr_rewind(gd_mem_variable(cid))
58  end select
subroutine, public var_class(var, class, cid)
Here is the call graph for this function: