26 use dc_string
, only:
tochar, printf, putline
28 use dc_trace
, only: beginsub, endsub, dbgmessage
30 type(gt_variable),
intent(in):: var
31 integer,
intent(in),
optional:: unit
37 character(*),
intent(in),
optional:: indent
41 logical,
intent(out),
optional:: err
59 real,
allocatable:: rvalue(:)
65 character(STRING):: indent_str
66 character(*),
parameter:: subname =
'GTVarPutLine' 68 call beginsub(subname,
'%d', i=(/var % mapid/))
74 if (
present(unit) )
then 82 if (
present(indent) )
then 83 if ( len(indent) /= 0 )
then 84 indent_len = len(indent)
85 indent_str(1:indent_len) = indent
93 if ( var % mapid < 0 )
then 94 call printf( out_unit, &
95 & indent_str(1:indent_len) // &
96 &
'#<GT_VARIABLE:: @initialized=%y>', &
106 call dbgmessage(
'size = %d', i=(/siz/))
108 allocate(rvalue(siz), stat=stat)
113 call get(var, rvalue,
size(rvalue), err=myerr)
117 call printf( out_unit, &
118 & indent_str(1:indent_len) // &
119 &
'#<GT_VARIABLE:: @initialized=%y>', &
125 call printf( out_unit, &
126 & indent_str(1:indent_len) // &
127 &
'#<GT_VARIABLE:: @initialized=%y', &
130 call putline( rvalue, unit = out_unit, &
131 & lbounds = lbound(rvalue), &
132 & ubounds = ubound(rvalue), &
133 & indent = indent_str(1:indent_len) // &
140 call printf( out_unit, &
141 & indent_str(1:indent_len) // &
144 deallocate(rvalue, stat=stat)
149 call endsub(subname,
'%d stat=%d', i=(/var % mapid, stat/))
integer, parameter, public gt_enomem
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
integer, parameter, public stdout
Unit number for Standard OUTPUT.
integer function, public errorcode()
Provides kind type parameter values.
integer, parameter, public string
Character length for string.