Toggle navigation
Gtool Project
地球流体電脳倶楽部
dcmodel プロジェクト
SIGEN
English
gtdata
gtdata_memory
gdmemvarattrtrue.f90
Go to the documentation of this file.
1
logical
function
gdmemvarattrtrue
(var, name, default)
result
(result)
2
use
gtdata_memory_types
, only
:
gd_mem_variable
,
gd_mem_variable_entry
,
gd_mem_attr_chain
3
use
gtdata_memory_internal
, only
:
memtab_lookup
4
use
dc_string
, only
:
str_to_logical
5
use
netcdf
, only
: nf90_noerr
6
type
(
gd_mem_variable
),
intent(in)
:: var
7
character(len = *)
,
intent(in)
:: name
8
logical
,
intent(in)
,
optional
:: default
9
type
(
gd_mem_variable_entry
),
pointer
:: ent
10
type
(
gd_mem_attr_chain
),
pointer
:: p
11
character(10)
:: s
12
integer
:: stat, i
13
14
stat =
memtab_lookup
(var, ent)
15
if
(stat /= nf90_noerr)
goto
999
16
p => ent%attr
17
do
18
if
(.not.
associated
(p))
exit
19
if
(p%name == name)
then
20
if
(
associated
(p%cbuf))
then
21
s =
""
22
do
, i = 1, min(len(s),
size
(p%cbuf))
23
s(i:i) = p%cbuf(i)
24
enddo
25
result =
str_to_logical
(s)
26
else
27
exit
28
endif
29
return
30
endif
31
p => p%next
32
enddo
33
999
continue
34
result = .false.
35
if
(
present
(default)) result = default
36
return
37
end function
gdmemvarattrtrue
gtdata_memory_types::gd_mem_variable
Definition:
gtdata_memory_types.f90:29
gtdata_memory_types::gd_mem_attr_chain
Definition:
gtdata_memory_types.f90:15
gdmemvarattrtrue
logical function gdmemvarattrtrue(var, name, default)
Definition:
gdmemvarattrtrue.f90:2
dc_string::str_to_logical
Definition:
dc_string.f90:67
gtdata_memory_internal
Definition:
gtdata_memory_internal.f90:10
gtdata_memory_types
Definition:
gtdata_memory_types.f90:9
gtdata_memory_internal::memtab_lookup
Definition:
gtdata_memory_internal.f90:31
dc_string
文字型変数の操作.
Definition:
dc_string.f90:24
gtdata_memory_types::gd_mem_variable_entry
Definition:
gtdata_memory_types.f90:21