\hypertarget{hstnmlinfoadd_8f90}{}\section{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfoadd.f90 File Reference}
\label{hstnmlinfoadd_8f90}\index{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfoadd.\+f90@{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfoadd.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
recursive subroutine \hyperlink{hstnmlinfoadd_8f90_ae054a39fa5c8df2cc7f3420b06fcb88e}{hstnmlinfoadd} (gthstnml, name, file, interval\+\_\+value, interval\+\_\+unit, precision, time\+\_\+average, average, fileprefix, origin\+\_\+value, origin\+\_\+unit, terminus\+\_\+value, terminus\+\_\+unit, slice\+\_\+start, slice\+\_\+end, slice\+\_\+stride, space\+\_\+average, newfile\+\_\+intvalue, newfile\+\_\+intunit, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{hstnmlinfoadd_8f90_ae054a39fa5c8df2cc7f3420b06fcb88e}\label{hstnmlinfoadd_8f90_ae054a39fa5c8df2cc7f3420b06fcb88e}} 
\index{hstnmlinfoadd.\+f90@{hstnmlinfoadd.\+f90}!hstnmlinfoadd@{hstnmlinfoadd}}
\index{hstnmlinfoadd@{hstnmlinfoadd}!hstnmlinfoadd.\+f90@{hstnmlinfoadd.\+f90}}
\subsubsection{\texorpdfstring{hstnmlinfoadd()}{hstnmlinfoadd()}}
{\footnotesize\ttfamily recursive subroutine hstnmlinfoadd (\begin{DoxyParamCaption}\item[{type(gthst\+\_\+nmlinfo), intent(inout)}]{gthstnml,  }\item[{character($\ast$), intent(in), optional}]{name,  }\item[{character($\ast$), intent(in), optional}]{file,  }\item[{real(dp), intent(in), optional}]{interval\+\_\+value,  }\item[{character($\ast$), intent(in), optional}]{interval\+\_\+unit,  }\item[{character($\ast$), intent(in), optional}]{precision,  }\item[{logical, intent(in), optional}]{time\+\_\+average,  }\item[{logical, intent(in), optional}]{average,  }\item[{character($\ast$), intent(in), optional}]{fileprefix,  }\item[{real(dp), intent(in), optional}]{origin\+\_\+value,  }\item[{character($\ast$), intent(in), optional}]{origin\+\_\+unit,  }\item[{real(dp), intent(in), optional}]{terminus\+\_\+value,  }\item[{character($\ast$), intent(in), optional}]{terminus\+\_\+unit,  }\item[{integer, dimension(\+:), intent(in), optional}]{slice\+\_\+start,  }\item[{integer, dimension(\+:), intent(in), optional}]{slice\+\_\+end,  }\item[{integer, dimension(\+:), intent(in), optional}]{slice\+\_\+stride,  }\item[{logical, dimension(\+:), intent(in), optional}]{space\+\_\+average,  }\item[{integer, intent(in), optional}]{newfile\+\_\+intvalue,  }\item[{character($\ast$), intent(in), optional}]{newfile\+\_\+intunit,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 22 of file hstnmlinfoadd.\+f90.



References dc\+\_\+error\+::dc\+\_\+earglack, dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+types\+::dp, dc\+\_\+error\+::hst\+\_\+ebadnewfileint, dc\+\_\+error\+::hst\+\_\+enotindefine, gtool\+\_\+history\+\_\+nmlinfo\+\_\+internal\+::name\+\_\+delimiter, dc\+\_\+types\+::stdout, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, dc\+\_\+types\+::token, and dc\+\_\+error\+::usr\+\_\+errno.


\begin{DoxyCode}
22     \textcolor{comment}{!}
23     \textcolor{comment}{! 変数の出力情報を加えます.}
24     \textcolor{comment}{!}
25     \textcolor{comment}{! デフォルト値を設定するには, *name* を与えないか, または}
26     \textcolor{comment}{! *name* に空白を与えてください.}
27     \textcolor{comment}{! デフォルト値を与える場合, *file* に与えられる情報は無視されます.}
28     \textcolor{comment}{! *fileprefix* はデフォルト値に与える場合のみ有効です.}
29     \textcolor{comment}{!}
30     \textcolor{comment}{! *name* に変数名が指定され, その際に *file* が与えられない,}
31     \textcolor{comment}{! または空白が与えられる場合, *file* には}
32     \textcolor{comment}{! "<i><*name* に与えられた文字></i>.nc" が指定されます.}
33     \textcolor{comment}{!}
34     \textcolor{comment}{! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定}
35     \textcolor{comment}{! されていない場合, プログラムはエラーを発生させます.}
36     \textcolor{comment}{!}
37     \textcolor{comment}{! Add output information of a variable.}
38     \textcolor{comment}{!}
39     \textcolor{comment}{! In order to set default values, specify blank to *name* or}
40     \textcolor{comment}{! do not specify *name*.}
41     \textcolor{comment}{! When default values are specified, *file* is ignored.}
42     \textcolor{comment}{! *fileprefix* is valid only when default values are specified.}
43     \textcolor{comment}{!}
44     \textcolor{comment}{! When a variable identifier is specified to *name* and}
45     \textcolor{comment}{! *file* is not specified or blanks are specified to *file*,}
46     \textcolor{comment}{! "<i><string given to *name*></i>.nc" is specified to *file*.}
47     \textcolor{comment}{!}
48     \textcolor{comment}{! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,}
49     \textcolor{comment}{! error is occurred.}
50     \textcolor{comment}{!}
51     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__types}{gtool\_history\_nmlinfo\_types}\textcolor{keywordtype}{, only}: 
      \hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo}{gthst\_nmlinfo}, \hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}
52     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__generic}{gtool\_history\_nmlinfo\_generic}\textcolor{keywordtype}{, only}: 
      \hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfodelete}{hstnmlinfodelete}
53     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__internal}{gtool\_history\_nmlinfo\_internal}\textcolor{keywordtype}{, only}: listsearch, listlast
54     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__internal}{gtool\_history\_nmlinfo\_internal}\textcolor{keywordtype}{, only}: 
      \hyperlink{namespacegtool__history__nmlinfo__internal_a70f5d905a8fb6970a88cf6bf122ab858}{name\_delimiter}
55     \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
56     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: putline, printf, split, strinclude, stoa, joinchar, cprintf
57     \textcolor{keywordtype}{use }dc\_present\textcolor{keywordtype}{, only}: present\_and\_not\_empty, present\_and\_true, present\_select
58     \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}, \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
59     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: dc\_difftime
60     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}, \textcolor{keyword}{operator}(>), \textcolor{keyword}{operator}(<)
61     \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
62     \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_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}, \hyperlink{namespacedc__error_a4e4bfd987a6af527e5b7514dd7535f85}{dc\_earglack}, &
63       & \hyperlink{namespacedc__error_a06cf52d1f5684d6d92f7e92c2c1fd43a}{usr\_errno}, \hyperlink{namespacedc__error_ad13dd9239cf193ea3a029747ece73c50}{hst\_enotindefine}, \hyperlink{namespacedc__error_afc8f73c94c58348e2837ec35a8ca29ea}{hst\_ebadnewfileint}
64     \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_max\_dims
65     \textcolor{keywordtype}{implicit none}
66     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo}{gthst\_nmlinfo}), \textcolor{keywordtype}{intent(inout)}:: gthstnml
67     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: name
68                               \textcolor{comment}{! 変数名.}
69                               \textcolor{comment}{!}
70                               \textcolor{comment}{! 先頭の空白は無視されます.}
71                               \textcolor{comment}{!}
72                               \textcolor{comment}{! "Data1,Data2" のようにカンマで区切って複数}
73                               \textcolor{comment}{! の変数を指定することも可能です.}
74                               \textcolor{comment}{!--}
75                               \textcolor{comment}{! ただし,}
76                               \textcolor{comment}{! その際には, *file* 引数で与えられる情報は}
77                               \textcolor{comment}{! 無視されます. その他の情報はそれぞれの}
78                               \textcolor{comment}{! 変数の情報として設定されます.}
79                               \textcolor{comment}{!++}
80                               \textcolor{comment}{!}
81                               \textcolor{comment}{! Variable identifier.}
82                               \textcolor{comment}{!}
83                               \textcolor{comment}{! Blanks at the head of the name are ignored.}
84                               \textcolor{comment}{!}
85                               \textcolor{comment}{! Multiple variables can be specified}
86                               \textcolor{comment}{! as "Data1,Data2" too. Delimiter is comma.}
87                               \textcolor{comment}{!--}
88                               \textcolor{comment}{! In this case, *file* is ignored, and}
89                               \textcolor{comment}{! other information is set to each variable.}
90                               \textcolor{comment}{!++}
91                               \textcolor{comment}{!}
92     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: file
93                               \textcolor{comment}{! ヒストリデータのファイル名.}
94                               \textcolor{comment}{! History data filenames}
95     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: interval\_value
96                               \textcolor{comment}{! ヒストリデータの出力間隔の数値.}
97                               \textcolor{comment}{! 負の値を与えると, 出力を抑止します.}
98                               \textcolor{comment}{!}
99                               \textcolor{comment}{! Numerical value for interval of history data output.}
100                               \textcolor{comment}{! Negative values suppresses output.}
101     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: interval\_unit
102                               \textcolor{comment}{! ヒストリデータの出力間隔の単位.}
103                               \textcolor{comment}{! Unit for interval of history data output}
104     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: precision
105                               \textcolor{comment}{! ヒストリデータの精度.}
106                               \textcolor{comment}{! Precision of history data}
107     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: time\_average
108                               \textcolor{comment}{! 出力データの時間平均化フラグ.}
109                               \textcolor{comment}{! Flag for time average of output data.}
110     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: average
111                               \textcolor{comment}{! time\_average の旧版.}
112                               \textcolor{comment}{! Old version of "time\_average"}
113     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: fileprefix
114                               \textcolor{comment}{! ヒストリデータのファイル名の接頭詞.}
115                               \textcolor{comment}{! Prefixes of history data filenames}
116     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin\_value
117                               \textcolor{comment}{! 出力開始時刻.}
118                               \textcolor{comment}{! Start time of output.}
119     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin\_unit
120                               \textcolor{comment}{! 出力開始時刻の単位.}
121                               \textcolor{comment}{! Unit of start time of output.}
122     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: terminus\_value
123                               \textcolor{comment}{! 出力終了時刻.}
124                               \textcolor{comment}{! End time of output.}
125     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: terminus\_unit
126                               \textcolor{comment}{! 出力終了時刻の単位.}
127                               \textcolor{comment}{! Unit of end time of output.}
128     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: slice\_start(:)
129                               \textcolor{comment}{! 空間方向の開始点.}
130                               \textcolor{comment}{! Start points of spaces.}
131     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: slice\_end(:)
132                               \textcolor{comment}{! 空間方向の終了点.}
133                               \textcolor{comment}{! End points of spaces.}
134     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: slice\_stride(:)
135                               \textcolor{comment}{! 空間方向の刻み幅.}
136                               \textcolor{comment}{! Strides of spaces.}
137     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: space\_average(:)
138                               \textcolor{comment}{! 平均化のフラグ.}
139                               \textcolor{comment}{! Flag of average.}
140     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: newfile\_intvalue
141                               \textcolor{comment}{! ファイル分割時間間隔.}
142                               \textcolor{comment}{! Interval of time of separation of a file.}
143     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: newfile\_intunit
144                               \textcolor{comment}{! ファイル分割時間間隔の単位.}
145                               \textcolor{comment}{! Unit of interval of time of separation of a file.}
146     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
147                               \textcolor{comment}{! 例外処理用フラグ.}
148                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
149                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
150                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
151                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
152                               \textcolor{comment}{! *err* に .true. が代入されます.}
153                               \textcolor{comment}{!}
154                               \textcolor{comment}{! Exception handling flag.}
155                               \textcolor{comment}{! By default, when error occur in}
156                               \textcolor{comment}{! this procedure, the program aborts.}
157                               \textcolor{comment}{! If this *err* argument is given,}
158                               \textcolor{comment}{! .true. is substituted to *err* and}
159                               \textcolor{comment}{! the program does not abort.}
160 
161     \textcolor{comment}{!-----------------------------------}
162     \textcolor{comment}{!  作業変数}
163     \textcolor{comment}{!  Work variables}
164     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}), \textcolor{keywordtype}{pointer}:: hptr =>null()
165     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}), \textcolor{keywordtype}{pointer}:: hptr\_last =>null()
166     \textcolor{keywordtype}{type}(dc\_difftime):: interval\_time, newfileint\_time
167     \textcolor{keywordtype}{character(TOKEN)}, \textcolor{keywordtype}{pointer}:: varnames\_array(:) =>null()
168     \textcolor{keywordtype}{integer}:: i, vnmax, ary\_size
169     \textcolor{keywordtype}{integer}:: stat
170     \textcolor{keywordtype}{character(STRING)}:: cause\_c
171     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'HstNmlInfoAdd'}
172   \textcolor{keywordflow}{continue}
173     \textcolor{keyword}{call }beginsub( subname, &
174       & fmt = \textcolor{stringliteral}{'@name=%a @file=%a @interval\_value=%r @interval\_unit=%a @precision=%a @time\_average=%y
       @fileprefix=%a'}, &
175       & d  = (/ present\_select(.true., -1.0\_dp, interval\_value) /), &
176       & l  = (/ present\_and\_true(time\_average) /), &
177       & ca = stoa( present\_select(.true., \textcolor{stringliteral}{'<no>'}, name), &
178       &            present\_select(.true., \textcolor{stringliteral}{'<no>'}, file), &
179       &            present\_select(.true., \textcolor{stringliteral}{'<no>'}, interval\_unit), &
180       &            present\_select(.true., \textcolor{stringliteral}{'<no>'}, precision), &
181       &            present\_select(.true., \textcolor{stringliteral}{'<no>'}, fileprefix) ) &
182       & )
183 
184     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
185     cause\_c = \textcolor{stringliteral}{''}
186 
187     \textcolor{comment}{!-----------------------------------------------------------------}
188     \textcolor{comment}{!  初期設定のチェック}
189     \textcolor{comment}{!  Check initialization}
190     \textcolor{comment}{!-----------------------------------------------------------------}
191     \textcolor{keywordflow}{if} ( .not. gthstnml % initialized ) \textcolor{keywordflow}{then}
192       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
193       cause\_c = \textcolor{stringliteral}{'GTHST\_NMLINFO'}
194       \textcolor{keywordflow}{goto} 999
195 \textcolor{keywordflow}{    end if}
196 
197     \textcolor{keywordflow}{if} ( .not. gthstnml % define\_mode ) \textcolor{keywordflow}{then}
198       stat = \hyperlink{namespacedc__error_ad13dd9239cf193ea3a029747ece73c50}{hst\_enotindefine}
199       cause\_c = \textcolor{stringliteral}{'Add'}
200       \textcolor{keywordflow}{goto} 999
201 \textcolor{keywordflow}{    end if}
202 
203     \textcolor{comment}{!-----------------------------------------------------------------}
204     \textcolor{comment}{!  複数の変数を設定する場合}
205     \textcolor{comment}{!  Configure multiple variables}
206     \textcolor{comment}{!-----------------------------------------------------------------}
207     \textcolor{keywordflow}{if} ( present\_and\_not\_empty(name) ) \textcolor{keywordflow}{then}
208       \textcolor{keywordflow}{if} ( index(name, \hyperlink{namespacegtool__history__nmlinfo__internal_a70f5d905a8fb6970a88cf6bf122ab858}{name\_delimiter}) > 0 ) \textcolor{keywordflow}{then}
209         \textcolor{keyword}{call }dbgmessage( \textcolor{stringliteral}{'multiple entries (%c) will be created'}, c1 = trim(name) )
210 \textcolor{comment}{!!$        if ( present(file) ) call DbgMessage( 'argument @file=%c is ignored', c1 = trim(file) )}
211 
212         \textcolor{keyword}{call }split( str = name, sep = \hyperlink{namespacegtool__history__nmlinfo__internal_a70f5d905a8fb6970a88cf6bf122ab858}{name\_delimiter}, & \textcolor{comment}{! (in)}
213           & carray = varnames\_array )                   \textcolor{comment}{! (out)}
214         vnmax = \textcolor{keyword}{size}( varnames\_array )
215 
216         \textcolor{keywordflow}{do} i = 1, vnmax
217           \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfoadd}{hstnmlinfoadd}( &
218             & gthstnml = gthstnml, &             \textcolor{comment}{! (inout)}
219             & name = varnames\_array(i), &        \textcolor{comment}{! (in)}
220             & file = file, &                     \textcolor{comment}{! (in)}
221             & interval\_value = interval\_value, & \textcolor{comment}{! (in)}
222             & interval\_unit = interval\_unit, &   \textcolor{comment}{! (in)}
223             & precision = precision, &           \textcolor{comment}{! (in)}
224             & time\_average = time\_average, &     \textcolor{comment}{! (in)}
225             & average = average, &               \textcolor{comment}{! (in)}
226             & origin\_value = origin\_value, &         \textcolor{comment}{! (in)}
227             & origin\_unit = origin\_unit, &           \textcolor{comment}{! (in)}
228             & terminus\_value = terminus\_value, &     \textcolor{comment}{! (in)}
229             & terminus\_unit = terminus\_unit, &       \textcolor{comment}{! (in)}
230             & slice\_start = slice\_start, &           \textcolor{comment}{! (in)}
231             & slice\_end = slice\_end, &               \textcolor{comment}{! (in)}
232             & slice\_stride = slice\_stride, &         \textcolor{comment}{! (in)}
233             & space\_average = space\_average, &       \textcolor{comment}{! (in)}
234             & newfile\_intvalue = newfile\_intvalue, & \textcolor{comment}{! (in)}
235             & newfile\_intunit = newfile\_intunit, &   \textcolor{comment}{! (in)}
236             & err = err )                        \textcolor{comment}{! (out)}
237           \textcolor{keywordflow}{if} ( present\_and\_true( err ) ) \textcolor{keywordflow}{then}
238             \textcolor{keyword}{deallocate}( varnames\_array )
239             stat = \hyperlink{namespacedc__error_a06cf52d1f5684d6d92f7e92c2c1fd43a}{usr\_errno}
240             \textcolor{keywordflow}{goto} 999
241 \textcolor{keywordflow}{          end if}
242 \textcolor{keywordflow}{        end do}
243         \textcolor{keyword}{deallocate}( varnames\_array )
244         \textcolor{keywordflow}{goto} 999
245 \textcolor{keywordflow}{      end if}
246 \textcolor{keywordflow}{    end if}
247 
248     \textcolor{comment}{!-----------------------------------------------------------------}
249     \textcolor{comment}{!  *gthstnml* へ情報を追加.}
250     \textcolor{comment}{!  Add information to *gthstnml*}
251     \textcolor{comment}{!-----------------------------------------------------------------}
252     \textcolor{keywordflow}{if} ( .not. present\_and\_not\_empty(name) ) \textcolor{keywordflow}{then}
253       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval\_value) ) gthstnml % gthstnml\_list % interval\_value = interval\_value
254       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval\_unit)  ) gthstnml % gthstnml\_list % interval\_unit  = interval\_unit
255       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(precision)      ) gthstnml % gthstnml\_list % precision      = precision
256       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(average)        ) gthstnml % gthstnml\_list % time\_average   = average
257       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(time\_average)   ) gthstnml % gthstnml\_list % time\_average   = time\_average
258       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(fileprefix)     ) gthstnml % gthstnml\_list % fileprefix     = fileprefix
259 
260       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(origin\_value    ) ) gthstnml % gthstnml\_list % origin\_value     = origin\_value
261       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(origin\_unit     ) ) gthstnml % gthstnml\_list % origin\_unit      = origin\_unit
262       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(terminus\_value  ) ) gthstnml % gthstnml\_list % terminus\_value   = terminus\_value
263       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(terminus\_unit   ) ) gthstnml % gthstnml\_list % terminus\_unit    = terminus\_unit
264       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_start     ) ) \textcolor{keywordflow}{then}
265         ary\_size = \textcolor{keyword}{size}(slice\_start)
266         gthstnml % gthstnml\_list % slice\_start(1:ary\_size)  = slice\_start
267 \textcolor{keywordflow}{      end if}
268       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_end      ) ) \textcolor{keywordflow}{then}
269         ary\_size = \textcolor{keyword}{size}(slice\_end)
270         gthstnml % gthstnml\_list % slice\_end(1:ary\_size)    = slice\_end
271 \textcolor{keywordflow}{      end if}
272       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_stride   ) ) \textcolor{keywordflow}{then}
273         ary\_size = \textcolor{keyword}{size}(slice\_stride)
274         gthstnml % gthstnml\_list % slice\_stride(1:ary\_size) = slice\_stride
275 \textcolor{keywordflow}{      end if}
276       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(space\_average   ) ) \textcolor{keywordflow}{then}
277         ary\_size = \textcolor{keyword}{size}(space\_average)
278         gthstnml % gthstnml\_list % space\_average(1:ary\_size) = space\_average
279 \textcolor{keywordflow}{      end if}
280       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(newfile\_intvalue) ) gthstnml % gthstnml\_list % newfile\_intvalue = newfile\_intvalue
281       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(newfile\_intunit ) ) gthstnml % gthstnml\_list % newfile\_intunit  = newfile\_intunit
282 
283 
284       hptr => gthstnml % gthstnml\_list
285 
286     \textcolor{keywordflow}{else}
287       hptr => gthstnml % gthstnml\_list
288       \textcolor{keyword}{call }listsearch( gthstnml\_list = hptr, & \textcolor{comment}{! (inout)}
289         &              name = name )           \textcolor{comment}{! (in)}
290       \textcolor{keywordflow}{if} ( .not. \textcolor{keyword}{associated}(hptr) ) \textcolor{keywordflow}{then}
291         \textcolor{keyword}{call }dbgmessage( \textcolor{stringliteral}{'new entry (%c) is created'}, c1 = trim( adjustl( name ) ) )
292 
293         hptr\_last => gthstnml % gthstnml\_list
294         \textcolor{keyword}{call }listlast( gthstnml\_list = hptr\_last ) \textcolor{comment}{! (inout)}
295         \textcolor{keyword}{allocate}( hptr )
296 
297         \textcolor{keyword}{nullify}( hptr % next )
298 
299         hptr % interval\_value => gthstnml % gthstnml\_list % interval\_value
300         hptr % interval\_unit  => gthstnml % gthstnml\_list % interval\_unit
301         hptr % precision      => gthstnml % gthstnml\_list % precision
302         hptr % time\_average   => gthstnml % gthstnml\_list % time\_average
303         hptr % fileprefix     => gthstnml % gthstnml\_list % fileprefix
304 
305         hptr % origin\_value     => gthstnml % gthstnml\_list % origin\_value
306         hptr % origin\_unit      => gthstnml % gthstnml\_list % origin\_unit
307         hptr % terminus\_value   => gthstnml % gthstnml\_list % terminus\_value
308         hptr % terminus\_unit    => gthstnml % gthstnml\_list % terminus\_unit
309         hptr % slice\_start      => gthstnml % gthstnml\_list % slice\_start
310         hptr % slice\_end        => gthstnml % gthstnml\_list % slice\_end
311         hptr % slice\_stride     => gthstnml % gthstnml\_list % slice\_stride
312         hptr % space\_average    => gthstnml % gthstnml\_list % space\_average
313         hptr % newfile\_intvalue => gthstnml % gthstnml\_list % newfile\_intvalue
314         hptr % newfile\_intunit  => gthstnml % gthstnml\_list % newfile\_intunit
315 
316         hptr\_last % next => hptr
317       \textcolor{keywordflow}{else}
318         \textcolor{keyword}{call }dbgmessage( \textcolor{stringliteral}{'entry (%c) is overwritten'}, c1 = trim( adjustl( name ) ) )
319 \textcolor{keywordflow}{      end if}
320 
321       hptr % name  = adjustl( name )
322       \textcolor{keywordflow}{if} ( present\_and\_not\_empty(file) ) \textcolor{keywordflow}{then}
323         hptr % file = file
324         \textcolor{keyword}{nullify}(  hptr % fileprefix )
325         \textcolor{keyword}{allocate}( hptr % fileprefix )
326         hptr % fileprefix = \textcolor{stringliteral}{''}
327       \textcolor{keywordflow}{else}
328         hptr % file = trim( adjustl(name) ) // \textcolor{stringliteral}{'.nc'}
329 \textcolor{keywordflow}{      end if}
330 
331       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval\_value) ) \textcolor{keywordflow}{then}
332         \textcolor{keyword}{nullify}(  hptr % interval\_value )
333         \textcolor{keyword}{allocate}( hptr % interval\_value )
334         hptr % interval\_value = interval\_value
335 \textcolor{keywordflow}{      end if}
336       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval\_unit)  ) \textcolor{keywordflow}{then}
337         \textcolor{keyword}{nullify}(  hptr % interval\_unit  )
338         \textcolor{keyword}{allocate}( hptr % interval\_unit  )
339         hptr % interval\_unit  = interval\_unit
340 \textcolor{keywordflow}{      end if}
341       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(precision)      ) \textcolor{keywordflow}{then}
342         \textcolor{keyword}{nullify}(  hptr % precision      )
343         \textcolor{keyword}{allocate}( hptr % precision      )
344         hptr % precision      = precision
345 \textcolor{keywordflow}{      end if}
346       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(average)        ) \textcolor{keywordflow}{then}
347         \textcolor{keyword}{nullify}(  hptr % time\_average        )
348         \textcolor{keyword}{allocate}( hptr % time\_average        )
349         hptr % time\_average   = average
350 \textcolor{keywordflow}{      end if}
351       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(time\_average)   ) \textcolor{keywordflow}{then}
352         \textcolor{keyword}{nullify}(  hptr % time\_average   )
353         \textcolor{keyword}{allocate}( hptr % time\_average   )
354         hptr % time\_average   = time\_average
355 \textcolor{keywordflow}{      end if}
356 
357       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(origin\_value)   ) \textcolor{keywordflow}{then}
358         \textcolor{keyword}{nullify}(  hptr % origin\_value   )
359         \textcolor{keyword}{allocate}( hptr % origin\_value   )
360         hptr % origin\_value   = origin\_value
361 \textcolor{keywordflow}{      end if}
362       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(origin\_unit)   ) \textcolor{keywordflow}{then}
363         \textcolor{keyword}{nullify}(  hptr % origin\_unit   )
364         \textcolor{keyword}{allocate}( hptr % origin\_unit   )
365         hptr % origin\_unit   = origin\_unit
366 \textcolor{keywordflow}{      end if}
367       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(terminus\_value)   ) \textcolor{keywordflow}{then}
368         \textcolor{keyword}{nullify}(  hptr % terminus\_value   )
369         \textcolor{keyword}{allocate}( hptr % terminus\_value   )
370         hptr % terminus\_value   = terminus\_value
371 \textcolor{keywordflow}{      end if}
372       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(terminus\_unit)   ) \textcolor{keywordflow}{then}
373         \textcolor{keyword}{nullify}(  hptr % terminus\_unit   )
374         \textcolor{keyword}{allocate}( hptr % terminus\_unit   )
375         hptr % terminus\_unit   = terminus\_unit
376 \textcolor{keywordflow}{      end if}
377       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_start)   ) \textcolor{keywordflow}{then}
378         ary\_size = \textcolor{keyword}{size}( slice\_start )
379         \textcolor{keyword}{nullify}(  hptr % slice\_start   )
380         \textcolor{keyword}{allocate}( hptr % slice\_start(1:nf90\_max\_dims)   )
381         hptr % slice\_start = 1
382         hptr % slice\_start(1:ary\_size) = slice\_start
383 \textcolor{keywordflow}{      end if}
384       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_end)   ) \textcolor{keywordflow}{then}
385         ary\_size = \textcolor{keyword}{size}( slice\_end )
386         \textcolor{keyword}{nullify}(  hptr % slice\_end   )
387         \textcolor{keyword}{allocate}( hptr % slice\_end(1:nf90\_max\_dims)   )
388         hptr % slice\_end = -1
389         hptr % slice\_end(1:ary\_size) = slice\_end
390 \textcolor{keywordflow}{      end if}
391       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(slice\_stride)   ) \textcolor{keywordflow}{then}
392         ary\_size = \textcolor{keyword}{size}( slice\_stride )
393         \textcolor{keyword}{nullify}(  hptr % slice\_stride   )
394         \textcolor{keyword}{allocate}( hptr % slice\_stride(1:nf90\_max\_dims)   )
395         hptr % slice\_stride = 1
396         hptr % slice\_stride(1:ary\_size) = slice\_stride
397 \textcolor{keywordflow}{      end if}
398       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(space\_average)   ) \textcolor{keywordflow}{then}
399         ary\_size = \textcolor{keyword}{size}( space\_average )
400         \textcolor{keyword}{nullify}(  hptr % space\_average   )
401         \textcolor{keyword}{allocate}( hptr % space\_average(1:nf90\_max\_dims)   )
402         hptr % space\_average = .false.
403         hptr % space\_average(1:ary\_size) = space\_average
404 \textcolor{keywordflow}{      end if}
405       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(newfile\_intvalue)   ) \textcolor{keywordflow}{then}
406         \textcolor{keyword}{nullify}(  hptr % newfile\_intvalue   )
407         \textcolor{keyword}{allocate}( hptr % newfile\_intvalue   )
408         hptr % newfile\_intvalue   = newfile\_intvalue
409 \textcolor{keywordflow}{      end if}
410       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(newfile\_intunit)   ) \textcolor{keywordflow}{then}
411         \textcolor{keyword}{nullify}(  hptr % newfile\_intunit   )
412         \textcolor{keyword}{allocate}( hptr % newfile\_intunit   )
413         hptr % newfile\_intunit   = newfile\_intunit
414 \textcolor{keywordflow}{      end if}
415 
416 \textcolor{keywordflow}{    end if}
417 
418     \textcolor{comment}{!---------------------------------------------------------------}
419     \textcolor{comment}{!  時間の単位のチェック}
420     \textcolor{comment}{!  Check unit of time}
421     \textcolor{comment}{!---------------------------------------------------------------}
422     \textcolor{keyword}{call }\hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}( &
423       & diff = interval\_time, &          \textcolor{comment}{! (out)}
424       & \textcolor{keywordtype}{value} = hptr % interval\_value, & \textcolor{comment}{! (in)}
425       & unit = hptr % interval\_unit, &   \textcolor{comment}{! (in)}
426       & err = err )                      \textcolor{comment}{! (out)}
427     \textcolor{keywordflow}{if} ( present\_and\_true( err ) ) \textcolor{keywordflow}{then}
428       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfodelete}{hstnmlinfodelete}( &
429         & gthstnml = gthstnml, & \textcolor{comment}{! (inout)}
430         & name = name )          \textcolor{comment}{! (in)}
431       stat = \hyperlink{namespacedc__error_a06cf52d1f5684d6d92f7e92c2c1fd43a}{usr\_errno}
432       \textcolor{keywordflow}{goto} 999
433 \textcolor{keywordflow}{    end if}
434 
435     \textcolor{comment}{!---------------------------------------------------------------}
436     \textcolor{comment}{!  ファイル分割時間間隔のチェック}
437     \textcolor{comment}{!  Check interval of time of separation of a file}
438     \textcolor{comment}{!---------------------------------------------------------------}
439     \textcolor{keyword}{call }\hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}( &
440       & diff = newfileint\_time, &                  \textcolor{comment}{! (out)}
441       & \textcolor{keywordtype}{value} = \textcolor{keywordtype}{real( hptr % newfile\_intvalue )}, & \textcolor{comment}{! (in)}
442       & unit = hptr % newfile\_intunit, &           \textcolor{comment}{! (in)}
443       & err = err )                                \textcolor{comment}{! (out)}
444     if ( present\_and\_true( err ) ) then
445       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfodelete}{hstnmlinfodelete}( &
446         & gthstnml = gthstnml, & \textcolor{comment}{! (inout)}
447         & name = name )          \textcolor{comment}{! (in)}
448       stat = \hyperlink{namespacedc__error_a06cf52d1f5684d6d92f7e92c2c1fd43a}{usr\_errno}
449       \textcolor{keywordflow}{goto} 999
450 \textcolor{keywordflow}{    end if}
451 
452     \textcolor{keywordflow}{if} (             ( hptr % newfile\_intvalue > 0     )   &
453       &  .and. .not. ( newfileint\_time > interval\_time ) ) \textcolor{keywordflow}{then}
454       \textcolor{keyword}{call }messagenotify( \textcolor{stringliteral}{'W'}, subname, &
455         & \textcolor{stringliteral}{'newfile\_int=%d [%c] must be greater than interval=%r [%c]'}, &
456         & i = (/ hptr % newfile\_intvalue /), &
457         & r = (/ hptr % interval\_value /), &
458         & c1 = trim( hptr % newfile\_intunit ), &
459         & c2 = trim( hptr % interval\_unit ) )
460 
461       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__generic_1_1hstnmlinfodelete}{hstnmlinfodelete}( &
462         & gthstnml = gthstnml, & \textcolor{comment}{! (inout)}
463         & name = name )          \textcolor{comment}{! (in)}
464       stat = \hyperlink{namespacedc__error_afc8f73c94c58348e2837ec35a8ca29ea}{hst\_ebadnewfileint}
465       cause\_c = cprintf( \textcolor{stringliteral}{'%d [%c]'}, &
466         & i = (/ hptr % newfile\_intvalue /), c1 = trim( hptr % newfile\_intunit ) )
467       \textcolor{keywordflow}{goto} 999
468 \textcolor{keywordflow}{    end if}
469 
470     \textcolor{keyword}{nullify}( hptr )
471 
472     \textcolor{comment}{!-----------------------------------------------------------------}
473     \textcolor{comment}{!  終了処理, 例外処理}
474     \textcolor{comment}{!  Termination and Exception handling}
475     \textcolor{comment}{!-----------------------------------------------------------------}
476 999 \textcolor{keywordflow}{continue}
477     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
478     \textcolor{keyword}{call }endsub( subname )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{hstnmlinfoadd_8f90_ae054a39fa5c8df2cc7f3420b06fcb88e_cgraph}
\end{center}
\end{figure}
