\hypertarget{gtvarputline_8f90}{}\section{gtdata/gtvarputline.f90 File Reference}
\label{gtvarputline_8f90}\index{gtdata/gtvarputline.\+f90@{gtdata/gtvarputline.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvarputline_8f90_ac824c3fa16a6b6ff419cf94c608f00e2}{gtvarputline} (var, unit, indent, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvarputline_8f90_ac824c3fa16a6b6ff419cf94c608f00e2}\label{gtvarputline_8f90_ac824c3fa16a6b6ff419cf94c608f00e2}} 
\index{gtvarputline.\+f90@{gtvarputline.\+f90}!gtvarputline@{gtvarputline}}
\index{gtvarputline@{gtvarputline}!gtvarputline.\+f90@{gtvarputline.\+f90}}
\subsubsection{\texorpdfstring{gtvarputline()}{gtvarputline()}}
{\footnotesize\ttfamily subroutine gtvarputline (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(in)}]{var,  }\item[{integer, intent(in), optional}]{unit,  }\item[{character($\ast$), intent(in), optional}]{indent,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 14 of file gtvarputline.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::errorcode(), dc\+\_\+error\+::gt\+\_\+enomem, dc\+\_\+types\+::stdout, dc\+\_\+error\+::storeerror(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{! 引数 *var* に設定されている情報を印字します. }
16   \textcolor{comment}{! デフォルトではメッセージは標準出力に出力されます. }
17   \textcolor{comment}{! *unit* に装置番号を指定することで, 出力先を変更することが可能です. }
18   \textcolor{comment}{!}
19   \textcolor{comment}{! Print information of *var*. }
20   \textcolor{comment}{! By default messages are output to standard output. }
21   \textcolor{comment}{! Unit number for output can be changed by *unit* argument. }
22   \textcolor{comment}{!}
23   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
24   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
25   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a2b3673542d2b1219a574e0fd716e0143}{errorcode}, \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
26   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{interfacegtdata__generic_1_1putline}{putline}
27   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1get}{get}, \hyperlink{interfacegtdata__generic_1_1inquire}{inquire}
28   \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}, \hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}
29   \textcolor{keywordtype}{implicit none}
30   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}), \textcolor{keywordtype}{intent(in)}:: var
31   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: unit
32                               \textcolor{comment}{! 出力先の装置番号. }
33                               \textcolor{comment}{! デフォルトの出力先は標準出力. }
34                               \textcolor{comment}{!}
35                               \textcolor{comment}{! Unit number for output. }
36                               \textcolor{comment}{! Default value is standard output. }
37   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: indent
38                               \textcolor{comment}{! 表示されるメッセージの字下げ. }
39                               \textcolor{comment}{!}
40                               \textcolor{comment}{! Indent of displayed messages. }
41   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
42                               \textcolor{comment}{! 例外処理用フラグ. }
43                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
44                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
45                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
46                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
47                               \textcolor{comment}{! *err* に .true. が代入されます. }
48                               \textcolor{comment}{!}
49                               \textcolor{comment}{! Exception handling flag. }
50                               \textcolor{comment}{! By default, when error occur in }
51                               \textcolor{comment}{! this procedure, the program aborts. }
52                               \textcolor{comment}{! If this *err* argument is given, }
53                               \textcolor{comment}{! .true. is substituted to *err* and }
54                               \textcolor{comment}{! the program does not abort. }
55   
56   \textcolor{comment}{!-----------------------------------}
57   \textcolor{comment}{!  作業変数}
58   \textcolor{comment}{!  Work variables}
59   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}:: rvalue(:)
60   \textcolor{keywordtype}{integer}:: siz, stat
61 \textcolor{comment}{!!$  integer:: i}
62   \textcolor{keywordtype}{logical}:: myerr
63   \textcolor{keywordtype}{integer}:: out\_unit
64   \textcolor{keywordtype}{integer}:: indent\_len
65   \textcolor{keywordtype}{character(STRING)}:: indent\_str
66   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'GTVarPutLine'}
67 \textcolor{keywordflow}{continue}
68   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'%d'}, i=(/var % mapid/))
69   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
70   \textcolor{comment}{!-----------------------------------------------------------------}
71   \textcolor{comment}{!  出力先装置番号と字下げの設定}
72   \textcolor{comment}{!  Configure output unit number and indents}
73   \textcolor{comment}{!-----------------------------------------------------------------}
74   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(unit) ) \textcolor{keywordflow}{then}
75     out\_unit = unit
76   \textcolor{keywordflow}{else}
77     out\_unit = \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
78 \textcolor{keywordflow}{  end if}
79 
80   indent\_len = 0
81   indent\_str = \textcolor{stringliteral}{''}
82   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(indent) ) \textcolor{keywordflow}{then}
83     \textcolor{keywordflow}{if} ( len(indent) /= 0 ) \textcolor{keywordflow}{then}
84       indent\_len = len(indent)
85       indent\_str(1:indent\_len) = indent
86 \textcolor{keywordflow}{    end if}
87 \textcolor{keywordflow}{  end if}
88 
89   \textcolor{comment}{!-----------------------------------------------------------------}
90   \textcolor{comment}{!  初期設定されていない変数の印字}
91   \textcolor{comment}{!  Print uninitialized variables}
92   \textcolor{comment}{!-----------------------------------------------------------------}
93   \textcolor{keywordflow}{if} ( var % mapid < 0 ) \textcolor{keywordflow}{then}
94     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}( out\_unit, &
95       & indent\_str(1:indent\_len) // &
96       & \textcolor{stringliteral}{'#<GT\_VARIABLE:: @initialized=%y>'}, &
97       & l = (/.false./) )
98     \textcolor{keywordflow}{goto} 999
99 \textcolor{keywordflow}{  end if}
100 
101   \textcolor{comment}{!-----------------------------------------------------------------}
102   \textcolor{comment}{!  初期設定されている変数の印字}
103   \textcolor{comment}{!  Print initialized variables}
104   \textcolor{comment}{!-----------------------------------------------------------------}
105   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1inquire}{inquire}(var, size=siz)
106   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'size = %d'}, i=(/siz/))
107   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
108   \textcolor{keyword}{allocate}(rvalue(siz), stat=stat)
109   \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{then}
110     stat = \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
111     \textcolor{keywordflow}{goto} 999
112 \textcolor{keywordflow}{  endif}
113   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get}{get}(var, rvalue, \textcolor{keyword}{size}(rvalue), err=myerr)
114   \textcolor{keywordflow}{if} (myerr) \textcolor{keywordflow}{then}
115     stat = \hyperlink{namespacedc__error_a2b3673542d2b1219a574e0fd716e0143}{errorcode}()
116     \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{then}
117       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}( out\_unit, &
118         & indent\_str(1:indent\_len) // &
119         & \textcolor{stringliteral}{'#<GT\_VARIABLE:: @initialized=%y>'}, &
120         & l = (/.false./) )
121       stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
122 \textcolor{keywordflow}{    end if}
123     \textcolor{keywordflow}{goto} 999
124 \textcolor{keywordflow}{  endif}
125   \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}( out\_unit, &
126     & indent\_str(1:indent\_len) // &
127     & \textcolor{stringliteral}{'#<GT\_VARIABLE:: @initialized=%y'}, &
128     & l = (/.true./) )
129 
130   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1putline}{putline}( rvalue, unit = out\_unit, &
131     & lbounds = lbound(rvalue), &
132     & ubounds = ubound(rvalue), &
133     & indent = indent\_str(1:indent\_len) // &
134     & \textcolor{stringliteral}{' @value='} )
135 
136 \textcolor{comment}{!!$  do, i = 1, size(rvalue)}
137 \textcolor{comment}{!!$    call Printf(fmt='%r', r=(/rvalue(i)/))}
138 \textcolor{comment}{!!$  end do}
139 
140   \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}( out\_unit, &
141     & indent\_str(1:indent\_len) // &
142     & \textcolor{stringliteral}{'>'} )
143 
144   \textcolor{keyword}{deallocate}(rvalue, stat=stat)
145   \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) stat = \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
146 
147 999 \textcolor{keywordflow}{continue}
148   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err)
149   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(subname, \textcolor{stringliteral}{'%d stat=%d'}, i=(/var % mapid, stat/))
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarputline_8f90_ac824c3fa16a6b6ff419cf94c608f00e2_cgraph}
\end{center}
\end{figure}
