引数 var に設定されている情報を印字します。 デフォルトではメッセージは標準出力に出力されます。 unit に装置番号を指定することで、出力先を変更することが可能です。
54 implicit none
55 type(GT_VARIABLE), intent(in):: var
56 integer, intent(in), optional:: unit
57 character(*), intent(in), optional:: indent
58 logical, intent(out), optional:: err
59
60
61
62
63 real, allocatable:: rvalue(:)
64 integer:: siz, stat
65
66 logical:: myerr
67 integer:: out_unit
68 integer:: indent_len
69 character(STRING):: indent_str
70 character(*), parameter:: subname = 'GTVarPutLine'
71continue
72 call beginsub(subname,
'%d', i=(/var % mapid/))
74
75
76
77
78 if ( present(unit) ) then
79 out_unit = unit
80 else
82 end if
83
84 indent_len = 0
85 indent_str = ''
86 if ( present(indent) ) then
87 if ( len(indent) /= 0 ) then
88 indent_len = len(indent)
89 indent_str(1:indent_len) = indent
90 end if
91 end if
92
93
94
95
96
97 if ( var % mapid < 0 ) then
99 & indent_str(1:indent_len) // &
100 & '#<GT_VARIABLE:: @initialized=%y>', &
101 & l = (/.false./) )
102 goto 999
103 end if
104
105
106
107
108
112 allocate(rvalue(siz), stat=stat)
115 goto 999
116 endif
117 call get(var, rvalue,
size(rvalue), err=myerr)
118 if (myerr) then
122 & indent_str(1:indent_len) // &
123 & '#<GT_VARIABLE:: @initialized=%y>', &
124 & l = (/.false./) )
126 end if
127 goto 999
128 endif
130 & indent_str(1:indent_len) // &
131 & '#<GT_VARIABLE:: @initialized=%y', &
132 & l = (/.true./) )
133
134 call putline( rvalue, unit = out_unit, &
135 & lbounds = lbound(rvalue), &
136 & ubounds = ubound(rvalue), &
137 & indent = indent_str(1:indent_len) // &
138 & ' @value=' )
139
140
141
142
143
145 & indent_str(1:indent_len) // &
146 & '>' )
147
148 deallocate(rvalue, stat=stat)
150
151999 continue
153 call endsub(subname,
'%d stat=%d', i=(/var % mapid, stat/))
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
エラー等を保持
integer, parameter, public gt_enomem
integer function, public errorcode()
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
integer, parameter, public stdout
標準出力の装置番号
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ