\hypertarget{historyautoallvarfix_8f90}{}\section{gtool/gtool\+\_\+historyauto/historyautoallvarfix.f90 File Reference}
\label{historyautoallvarfix_8f90}\index{gtool/gtool\+\_\+historyauto/historyautoallvarfix.\+f90@{gtool/gtool\+\_\+historyauto/historyautoallvarfix.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{historyautoallvarfix_8f90_ad862b9a0ef913e91a11fb4f08c26c5ca}{historyautoallvarfix}
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{historyautoallvarfix_8f90_ad862b9a0ef913e91a11fb4f08c26c5ca}\label{historyautoallvarfix_8f90_ad862b9a0ef913e91a11fb4f08c26c5ca}} 
\index{historyautoallvarfix.\+f90@{historyautoallvarfix.\+f90}!historyautoallvarfix@{historyautoallvarfix}}
\index{historyautoallvarfix@{historyautoallvarfix}!historyautoallvarfix.\+f90@{historyautoallvarfix.\+f90}}
\subsubsection{\texorpdfstring{historyautoallvarfix()}{historyautoallvarfix()}}
{\footnotesize\ttfamily subroutine historyautoallvarfix (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Definition at line 11 of file historyautoallvarfix.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), gtool\+\_\+historyauto\+\_\+internal\+::flag\+\_\+allvarfixed, gtool\+\_\+historyauto\+\_\+internal\+::gthst\+\_\+vars, gtool\+\_\+historyauto\+\_\+internal\+::gthstnml, dc\+\_\+error\+::hst\+\_\+ebadvarname, gtool\+\_\+historyauto\+\_\+internal\+::initialized, dc\+\_\+string\+::joinchar(), gtool\+\_\+historyauto\+\_\+internal\+::numdims, gtool\+\_\+historyauto\+\_\+internal\+::numvars, gtool\+\_\+historyauto\+\_\+internal\+::save\+\_\+mpi\+\_\+gather, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, gtool\+\_\+historyauto\+\_\+internal\+::sub\+\_\+sname, and dc\+\_\+types\+::token.


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{! このサブルーチンは以下の動作を行います. }
13     \textcolor{comment}{! }
14     \textcolor{comment}{! * NAMELIST から読み込んだ変数名に無効なものが存在したかどうかをチェック. }
15     \textcolor{comment}{! * HistoryAutoAddVariable で登録した変数名を印字. }
16     \textcolor{comment}{!}
17     \textcolor{comment}{! このサブルーチンを呼んだ後に HistoryAutoAddVariable を呼ぶと}
18     \textcolor{comment}{! エラーを生じます. }
19     \textcolor{comment}{!}
20     \textcolor{comment}{! This subroutine performs following acts. }
21     \textcolor{comment}{! }
22     \textcolor{comment}{! * Check that invalid variable names are loaded from NAMELIST or not. }
23     \textcolor{comment}{! * Print registered variable names by "HistoryAutoAddVariable". }
24     \textcolor{comment}{!}
25     \textcolor{comment}{! If "HistoryAutoAddVariable" is called after this subroutine is called, }
26     \textcolor{comment}{! an error is occurred. }
27     \textcolor{comment}{!}
28     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__historyauto__internal}{gtool\_historyauto\_internal}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1initialized}{initialized}, 
      \hyperlink{namespacegtool__historyauto__internal_a01aef0b641b5a9d9a74b18908aa47edb}{numdims}, \hyperlink{namespacegtool__historyauto__internal_af2a97d3aefbba8947148f51c961f147c}{numvars}, &
29       & \hyperlink{namespacegtool__historyauto__internal_ae891f791f06836fb1d42b7185e6d3afa}{flag\_allvarfixed}, \hyperlink{namespacegtool__historyauto__internal_a6f4962bc3ba6447d7cc53c1b88c9bd4e}{gthst\_vars}, \hyperlink{namespacegtool__historyauto__internal_a08a505d0576b7a6390e6f7a715ccc2b4}{gthstnml}, 
      \hyperlink{namespacegtool__historyauto__internal_a6aa46993d72f521af70cf3977df24bf1}{save\_mpi\_gather}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}
30     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__generic}{gtool\_history\_nmlinfo\_generic}\textcolor{keywordtype}{, only}: 
      \hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfoallnamevalid}{hstnmlinfoallnamevalid}
31     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history}{gtool\_history}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historyvarinfoinquire}{historyvarinfoinquire}
32     \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}
33     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_a30736dc67a0d547ad912a1373fcedcbb}{hst\_ebadvarname}, \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
34     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
35     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{, only}: \textcolor{keyword}{operator}(*), \textcolor{keyword}{operator}(+)
36     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}
37     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}
38 
39     \textcolor{keywordtype}{implicit none}
40     \textcolor{keywordtype}{logical}:: allvar\_invalid
41                               \textcolor{comment}{! 無効な変数名のチェックフラグ. }
42                               \textcolor{comment}{! Check flag of invalid variable names. }
43 
44     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{parameter}:: names\_limit = 100
45     \textcolor{keywordtype}{character(names\_limit)}:: names\_invalid
46                               \textcolor{comment}{! 無効な変数名. }
47                               \textcolor{comment}{! Invalid variable names. }
48 
49     \textcolor{keywordtype}{character(STRING)}:: name, \hyperlink{structdc__units_1_1units}{units}, longname, var\_info\_str
50     \textcolor{keywordtype}{character(TOKEN)}, \textcolor{keywordtype}{pointer}:: dims(:) =>null()
51     \textcolor{keywordtype}{integer}:: msnot\_rank
52     \textcolor{keywordtype}{integer}:: stat, i
53     \textcolor{keywordtype}{character(STRING)}:: cause\_c
54     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryAutoAllVarFix"}
55   \textcolor{keywordflow}{continue}
56     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname)
57     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
58     cause\_c = \textcolor{stringliteral}{""}
59 
60     \textcolor{comment}{! 初期設定チェック}
61     \textcolor{comment}{! Check initialization}
62     \textcolor{comment}{!}
63     \textcolor{keywordflow}{if} ( .not. \hyperlink{interfacegtool__history__generic_1_1initialized}{initialized} ) \textcolor{keywordflow}{then}
64       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
65       cause\_c = \textcolor{stringliteral}{'gtool\_historyauto'}
66       \textcolor{keywordflow}{goto} 999
67 \textcolor{keywordflow}{    end if}
68 
69     \textcolor{comment}{! 既に確定後であれば何もせずに終了. }
70     \textcolor{comment}{! Nothing is done after fixed}
71     \textcolor{comment}{!}
72     \textcolor{keywordflow}{if} ( \hyperlink{namespacegtool__historyauto__internal_ae891f791f06836fb1d42b7185e6d3afa}{flag\_allvarfixed} ) \textcolor{keywordflow}{goto} 999
73 
74 
75     \textcolor{comment}{! 無効な変数名のチェック (初回のみ)}
76     \textcolor{comment}{! Check invalid variable names (at only first time)}
77     \textcolor{comment}{!}
78     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfoallnamevalid}{hstnmlinfoallnamevalid}( &
79       & \hyperlink{namespacegtool__historyauto__internal_a08a505d0576b7a6390e6f7a715ccc2b4}{gthstnml} = \hyperlink{namespacegtool__historyauto__internal_a08a505d0576b7a6390e6f7a715ccc2b4}{gthstnml}, &               \textcolor{comment}{! (inout)}
80       & invalid = allvar\_invalid, names = names\_invalid ) \textcolor{comment}{! (out)}
81 
82     \textcolor{keywordflow}{if} ( len\_trim(names\_invalid) > (names\_limit - 5)  ) \textcolor{keywordflow}{then}
83       names\_invalid = names\_invalid(1:names\_limit - 5) // \textcolor{stringliteral}{' ....'}
84 \textcolor{keywordflow}{    end if}
85 
86     \textcolor{keywordflow}{if} ( allvar\_invalid ) \textcolor{keywordflow}{then}
87       stat = \hyperlink{namespacedc__error_a30736dc67a0d547ad912a1373fcedcbb}{hst\_ebadvarname}
88       cause\_c = names\_invalid
89       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'W'}, subname, &
90         & \textcolor{stringliteral}{'names "%c" from NAMELIST "gtool\_historyauto\_nml" are invalid.'}, &
91         & c1 = trim(names\_invalid) )
92       \textcolor{keywordflow}{goto} 999
93 \textcolor{keywordflow}{    end if}
94 
95     \textcolor{comment}{! 登録された変数の印字 (初回のみ)}
96     \textcolor{comment}{! Print registered variables (at only first time)}
97     \textcolor{comment}{!}
98     msnot\_rank = -1
99     \textcolor{keywordflow}{if} ( \hyperlink{namespacegtool__historyauto__internal_a6aa46993d72f521af70cf3977df24bf1}{save\_mpi\_gather} ) msnot\_rank = 0
100     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'M'}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}, \textcolor{stringliteral}{'-------------------------------------------'}
      , rank\_mpi = msnot\_rank )
101     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'M'}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}, \textcolor{stringliteral}{'----- Registered variables for output -----'}
      , rank\_mpi = msnot\_rank )
102     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'M'}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}, \textcolor{stringliteral}{'-------------------------------------------'}
      , rank\_mpi = msnot\_rank )
103 
104     \textcolor{keywordflow}{do} i = 1, \hyperlink{namespacegtool__historyauto__internal_af2a97d3aefbba8947148f51c961f147c}{numvars}
105       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historyvarinfoinquire}{historyvarinfoinquire}( &
106         & varinfo = \hyperlink{namespacegtool__historyauto__internal_a6f4962bc3ba6447d7cc53c1b88c9bd4e}{gthst\_vars}(i), &    \textcolor{comment}{! (in)}
107         & name = name, &                \textcolor{comment}{! (out) optional}
108         & dims = dims, &                \textcolor{comment}{! (out) optional}
109         & longname = longname, &        \textcolor{comment}{! (out) optional}
110         & \hyperlink{structdc__units_1_1units}{units} = \hyperlink{structdc__units_1_1units}{units} )               \textcolor{comment}{! (out) optional}
111 
112       var\_info\_str = trim( longname ) // \textcolor{stringliteral}{' ['} // &
113         &            trim( \hyperlink{structdc__units_1_1units}{units} ) // \textcolor{stringliteral}{'] \{'} // &
114         &            trim( \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}( dims, \textcolor{stringliteral}{','} ) ) // \textcolor{stringliteral}{'\}'}
115       \textcolor{keyword}{deallocate}( dims )
116 
117       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'M'}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}, \textcolor{stringliteral}{'  %c  (%c)'}, &
118         & c1 = trim(name), c2 = trim(var\_info\_str), rank\_mpi = msnot\_rank )
119 
120 \textcolor{keywordflow}{    end do}
121     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}( \textcolor{stringliteral}{'M'}, \hyperlink{namespacegtool__historyauto__internal_a85ef80f0683224181c1f0741bb07308a}{sub\_sname}, \textcolor{stringliteral}{'-----'}, rank\_mpi = msnot\_rank )
122 
123     \textcolor{comment}{! フラグの設定}
124     \textcolor{comment}{! Set a flag}
125     \textcolor{comment}{!}
126     \textcolor{keywordflow}{if} ( .not. \hyperlink{namespacegtool__historyauto__internal_ae891f791f06836fb1d42b7185e6d3afa}{flag\_allvarfixed} ) \hyperlink{namespacegtool__historyauto__internal_ae891f791f06836fb1d42b7185e6d3afa}{flag\_allvarfixed} = .true.
127 
128 999 \textcolor{keywordflow}{continue}
129     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, cause\_c = cause\_c)
130     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(subname, \textcolor{stringliteral}{'stat=%d'}, i = (/stat/) )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{historyautoallvarfix_8f90_ad862b9a0ef913e91a11fb4f08c26c5ca_cgraph}
\end{center}
\end{figure}
