\hypertarget{historycreate_8f90}{}\section{gtool/gtool\+\_\+history/historycreate.f90 File Reference}
\label{historycreate_8f90}\index{gtool/gtool\+\_\+history/historycreate.\+f90@{gtool/gtool\+\_\+history/historycreate.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{historycreate_8f90_a22c2569d0c45cec46ddcc60699655655}{historycreate1} (file, title, source, institution, dims, dimsizes, longnames, units, origin, interval, xtypes, history, origind, intervald, conventions, gt\+\_\+version, overwrite, quiet, flag\+\_\+mpi\+\_\+gather, flag\+\_\+mpi\+\_\+split, err)
\item 
subroutine \hyperlink{historycreate_8f90_af500a09f0e2f79576ba8618b15181607}{historycreate2} (file, title, source, institution, dims, dimsizes, longnames, units, origin, interval, xtypes, history, conventions, gt\+\_\+version, overwrite, quiet, flag\+\_\+mpi\+\_\+gather, flag\+\_\+mpi\+\_\+split, err)
\item 
subroutine \hyperlink{historycreate_8f90_a0740ccfcac12536c8438a81c9885f6f1}{historycreate3} (file, title, source, institution, axes, origin, interval, history, origind, intervald, conventions, gt\+\_\+version, overwrite, quiet, flag\+\_\+mpi\+\_\+gather, flag\+\_\+mpi\+\_\+split, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{historycreate_8f90_a22c2569d0c45cec46ddcc60699655655}\label{historycreate_8f90_a22c2569d0c45cec46ddcc60699655655}} 
\index{historycreate.\+f90@{historycreate.\+f90}!historycreate1@{historycreate1}}
\index{historycreate1@{historycreate1}!historycreate.\+f90@{historycreate.\+f90}}
\subsubsection{\texorpdfstring{historycreate1()}{historycreate1()}}
{\footnotesize\ttfamily subroutine historycreate1 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{file,  }\item[{character($\ast$), intent(in)}]{title,  }\item[{character($\ast$), intent(in)}]{source,  }\item[{character($\ast$), intent(in)}]{institution,  }\item[{character($\ast$), dimension(\+:), intent(in)}]{dims,  }\item[{integer, dimension (\+:), intent(in)}]{dimsizes,  }\item[{character($\ast$), dimension (\+:), intent(in)}]{longnames,  }\item[{character($\ast$), dimension(\+:), intent(in)}]{units,  }\item[{real, intent(in), optional}]{origin,  }\item[{real, intent(in), optional}]{interval,  }\item[{character($\ast$), dimension(\+:), intent(in), optional}]{xtypes,  }\item[{type(gt\+\_\+history), intent(out), optional, target}]{history,  }\item[{real(dp), intent(in), optional}]{origind,  }\item[{real(dp), intent(in), optional}]{intervald,  }\item[{character($\ast$), intent(in), optional}]{conventions,  }\item[{character($\ast$), intent(in), optional}]{gt\+\_\+version,  }\item[{logical, intent(in), optional}]{overwrite,  }\item[{logical, intent(in), optional}]{quiet,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+gather,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+split,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 32 of file historycreate.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+ealreadyinit, dc\+\_\+error\+::dc\+\_\+noerr, gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::gt\+\_\+eargsizemismatch, gtool\+\_\+history\+\_\+internal\+::gtool4\+\_\+netcdf\+\_\+conventions, gtool\+\_\+history\+\_\+internal\+::gtool4\+\_\+netcdf\+\_\+version, dc\+\_\+string\+::joinchar(), dc\+\_\+present\+::present\+\_\+and\+\_\+false(), dc\+\_\+present\+::present\+\_\+and\+\_\+not\+\_\+empty(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, sysdepenvget(), dc\+\_\+types\+::token, dc\+\_\+date\+\_\+types\+::unit\+\_\+symbol\+\_\+err, and dc\+\_\+date\+\_\+types\+::unit\+\_\+symbol\+\_\+sec.


\begin{DoxyCode}
32     \textcolor{comment}{!}
33     \textcolor{comment}{!== gtool4 データ出力用初期設定}
34     \textcolor{comment}{!}
35     \textcolor{comment}{! このサブルーチンは、gtool4 データ出力の初期設定を行います。}
36     \textcolor{comment}{! HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、}
37     \textcolor{comment}{! HistoryAddAttr、 HistoryClose、 HistorySetTime}
38     \textcolor{comment}{! を用いるためには、HistoryCreate による初期設定が必要です。}
39     \textcolor{comment}{!}
40     \textcolor{comment}{! なお、プログラム内で HistoryCreate を呼び出した場合、}
41     \textcolor{comment}{! プログラムを終了する前に必ず、 HistoryClose を呼び出して}
42     \textcolor{comment}{! 終了処理を行なって下さい。}
43     \textcolor{comment}{!}
44     \textcolor{comment}{! *HistoryCreate* というサブルーチン名は 2 つの別々の}
45     \textcolor{comment}{! サブルーチンの総称名です。上記のサブルーチンも参照ください。}
46     \textcolor{comment}{!}
47     \textcolor{comment}{!}
48     \textcolor{comment}{! Two specific subroutines shares common part:}
49     \textcolor{comment}{!}
50     \textcolor{comment}{! Both two ones initializes a dataset *file*.}
51     \textcolor{comment}{! The result of type GT\_HISTORY will be returned by *history*}
52     \textcolor{comment}{! or managed internally if omitted.}
53     \textcolor{comment}{! Mandatory global attributes are defined by arguments}
54     \textcolor{comment}{! *title*, *source*, and *institution*;}
55     \textcolor{comment}{! they are all declared as ((character(len = *))).}
56     \textcolor{comment}{! Spatial axis definitions have two different forms:}
57     \textcolor{comment}{! a primitive one uses several arrays of various types:}
58     \textcolor{comment}{! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.}
59     \textcolor{comment}{! Another sophisticated one has only array of type GT\_HISTORY\_AXIS,}
60     \textcolor{comment}{! *axes*.}
61     \textcolor{comment}{! Temporal definition is done without *origin*, *interval*.}
62     \textcolor{comment}{!}
63     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__types}{gtool\_history\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}, 
      \hyperlink{structgtool__history__types_1_1gt__history__axis}{gt\_history\_axis}, \hyperlink{structgtool__history__types_1_1gt__history__varinfo}{gt\_history\_varinfo}, 
      \hyperlink{structgtool__history__types_1_1gt__history__attr}{gt\_history\_attr}
64     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}, 
      \hyperlink{namespacegtool__history__internal_a62ea3a4c4f7a88a2bb8d4dd2dbe2b098}{gtool4\_netcdf\_conventions}, \hyperlink{namespacegtool__history__internal_a29f3530387244862c313d41352821433}{gtool4\_netcdf\_version}
65     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historyaxiscreate}{historyaxiscreate}
66     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{,only}: \hyperlink{interfacegtdata__generic_1_1create}{create}, \hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}, 
      \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
67     \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}
68     \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_aa11b8065198295505e35eb5a1e1436a4}{gt\_eargsizemismatch}, \hyperlink{namespacedc__error_a3302263a8c976235052a305d54572070}{dc\_ealreadyinit}
69     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}, \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__string_1_1stoa}{stoa}, 
      \hyperlink{interfacedc__string_1_1cprintf}{cprintf}, \hyperlink{interfacedc__string_1_1lchar}{lchar}
70     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__url_1_1urlmerge}{urlmerge}
71     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_aae281a56bc41e9546908a72aeb042430}{present\_and\_not\_empty}, 
      \hyperlink{namespacedc__present_a0eac5ec50371728c0edced0be3115187}{present\_and\_false}, \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
72     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
73     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
74     \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar}{dc\_calendar}\textcolor{keywordtype}{, only}: \hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}, \hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}, &
75       & \hyperlink{interfacedc__calendar__generic_1_1dccalcreate}{dccalcreate}, \hyperlink{interfacedc__calendar__generic_1_1dccaldatecurrent}{dccaldatecurrent}, 
      \hyperlink{interfacedc__calendar__generic_1_1dccaldateinquire}{dccaldateinquire}
76     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__date__types_1_1dc__datetime}{dc\_datetime}, \hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}, 
      \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err}, \hyperlink{namespacedc__date__types_a5dbd685bd8334def6bf91a9f86e6a2a3}{unit\_symbol\_sec}
77     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{,  only}: \hyperlink{interfacedc__date__generic_1_1dcdatetimecreate}{dcdatetimecreate}, \hyperlink{interfacedc__string_1_1tochar}{tochar}, 
      \hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}, &
78       & \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}, \hyperlink{interfacedc__date__generic_1_1parsetimeunits}{parsetimeunits}
79     \textcolor{keywordtype}{use }\hyperlink{namespacesysdep}{sysdep}\textcolor{keywordtype}{,     only}: \hyperlink{sysdepenv_8f90_a9e07f27148c8cf1890cf7dbc3a0334ee}{sysdepenvget}
80     \textcolor{keywordtype}{implicit none}
81     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: file
82                               \textcolor{comment}{! 出力するファイルの名前. }
83                               \textcolor{comment}{! Name of output file}
84     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: title
85                               \textcolor{comment}{! データ全体の表題. }
86                               \textcolor{comment}{! Title of entire data}
87     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: source
88                               \textcolor{comment}{! データを作成する際の手段. }
89                               \textcolor{comment}{! Source of data file}
90     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: institution
91                               \textcolor{comment}{! ファイルを最終的に変更した組織/個人. }
92                               \textcolor{comment}{! Institution or person that changes files for the last time}
93     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: dims(:)
94                               \textcolor{comment}{! 次元の名前. }
95                               \textcolor{comment}{! }
96                               \textcolor{comment}{! 配列の大きさに制限はありません.}
97                               \textcolor{comment}{! 個々の次元の文字数は dc\_types#TOKEN まで.}
98                               \textcolor{comment}{! 配列内の文字数は}
99                               \textcolor{comment}{! 全て同じでなければなりません.}
100                               \textcolor{comment}{! 足りない文字分は空白で}
101                               \textcolor{comment}{! 補ってください.}
102                               \textcolor{comment}{! }
103                               \textcolor{comment}{! Names of dimensions.}
104                               \textcolor{comment}{! }
105                               \textcolor{comment}{! Length of array is unlimited. }
106                               \textcolor{comment}{! Limits of numbers of characters of each }
107                               \textcolor{comment}{! dimensions are "dc\_types#TOKEN". }
108                               \textcolor{comment}{! Numbers of characters in this array}
109                               \textcolor{comment}{! must be same. }
110                               \textcolor{comment}{! Make up a deficit with blanks. }
111                               \textcolor{comment}{! }
112     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimsizes (:)
113                               \textcolor{comment}{! dims で指定したそれぞれの次元大きさ. }
114                               \textcolor{comment}{! }
115                               \textcolor{comment}{! 配列の大きさは dims の大きさと等しい}
116                               \textcolor{comment}{! 必要があります.  '0' (数字のゼロ) を指定}
117                               \textcolor{comment}{! するとその次元は 無制限次元 (unlimited}
118                               \textcolor{comment}{! dimension) となります. (gtool\_history }
119                               \textcolor{comment}{! では時間の次元に対して無制限次元を}
120                               \textcolor{comment}{! 用いることを想定しています). ただし, }
121                               \textcolor{comment}{! 1 つの NetCDF ファイル (バージョン 3) }
122                               \textcolor{comment}{! は最大で 1 つの無制限次元しか持てないので, }
123                               \textcolor{comment}{! 2 ヶ所以上に '0' を指定しないでください. }
124                               \textcolor{comment}{! その場合, 正しく gtool4 データが出力されません.}
125                               \textcolor{comment}{! }
126                               \textcolor{comment}{! Lengths of dimensions specified with "dims". }
127                               \textcolor{comment}{! }
128                               \textcolor{comment}{! Length of this array must be same as }
129                               \textcolor{comment}{! length of "dim".  If '0' (zero) is }
130                               \textcolor{comment}{! specified, the dimension is treated as }
131                               \textcolor{comment}{! unlimited dimension.  }
132                               \textcolor{comment}{! (In "gtool\_history", unlimited dimension is }
133                               \textcolor{comment}{! expected to be used as time). }
134                               \textcolor{comment}{! Note that one NetCDF file (version 3) }
135                               \textcolor{comment}{! can not have two or more unlimited }
136                               \textcolor{comment}{! dimensions, so that do not specify '0' }
137                               \textcolor{comment}{! to two or more places. In that case, }
138                               \textcolor{comment}{! gtoo4 data is not output currently }
139                               \textcolor{comment}{! }
140     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: longnames (:)
141                               \textcolor{comment}{! dims で指定したそれぞれの次元の名前. }
142                               \textcolor{comment}{!}
143                               \textcolor{comment}{! 配列の大きさは dims の大きさ}
144                               \textcolor{comment}{! と等しい必要があります. 文字数}
145                               \textcolor{comment}{! は dc\_types#STRING まで.}
146                               \textcolor{comment}{! 配列内の文字数は}
147                               \textcolor{comment}{! 全て同じでなければなりません.}
148                               \textcolor{comment}{! 足りない文字分は空白で補います.}
149                               \textcolor{comment}{! }
150                               \textcolor{comment}{! Names of dimensions specified with "dims". }
151                               \textcolor{comment}{!}
152                               \textcolor{comment}{! Length of this array must be same as }
153                               \textcolor{comment}{! length of "dim".  }
154                               \textcolor{comment}{! Limits of numbers of characters are }
155                               \textcolor{comment}{! "dc\_types#STRING". }
156                               \textcolor{comment}{! Numbers of characters in this array}
157                               \textcolor{comment}{! must be same. }
158                               \textcolor{comment}{! Make up a deficit with blanks. }
159                               \textcolor{comment}{! }
160     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: \hyperlink{structdc__units_1_1units}{units}(:)
161                               \textcolor{comment}{! dims で指定したそれぞれの次元の単位. }
162                               \textcolor{comment}{!}
163                               \textcolor{comment}{! 配列の大きさは dims の大きさ}
164                               \textcolor{comment}{! と等しい必要があります. 文字数}
165                               \textcolor{comment}{! は dc\_types#STRING まで.}
166                               \textcolor{comment}{! 配列内の文字数は}
167                               \textcolor{comment}{! 全て同じでなければなりません.}
168                               \textcolor{comment}{! 足りない文字分は空白で補います.}
169                               \textcolor{comment}{! }
170                               \textcolor{comment}{! Units of dimensions specified with "dims". }
171                               \textcolor{comment}{!}
172                               \textcolor{comment}{! Length of this array must be same as }
173                               \textcolor{comment}{! length of "dim".  }
174                               \textcolor{comment}{! Limits of numbers of characters are }
175                               \textcolor{comment}{! "dc\_types#STRING". }
176                               \textcolor{comment}{! Numbers of characters in this array}
177                               \textcolor{comment}{! must be same. }
178                               \textcolor{comment}{! Make up a deficit with blanks. }
179                               \textcolor{comment}{! }
180     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin
181                               \textcolor{comment}{! 時間の原点. }
182                               \textcolor{comment}{!}
183                               \textcolor{comment}{! これは HistoryPut により変数を最初に}
184                               \textcolor{comment}{! 出力するときの時間となります.}
185                               \textcolor{comment}{! }
186                               \textcolor{comment}{! 省略した場合, 時間の原点には}
187                               \textcolor{comment}{! 自動的に 0.0 が設定されます.}
188                               \textcolor{comment}{! }
189                               \textcolor{comment}{! Origin of time. }
190                               \textcolor{comment}{!}
191                               \textcolor{comment}{! This time is used as time }
192                               \textcolor{comment}{! when first output is done by "HistoryPut". }
193                               \textcolor{comment}{! }
194                               \textcolor{comment}{! If this argument is omitted, }
195                               \textcolor{comment}{! 0.0 is specified automatically. }
196                               \textcolor{comment}{! }
197     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: interval
198                               \textcolor{comment}{! 出力時間間隔. }
199                               \textcolor{comment}{!}
200                               \textcolor{comment}{! 同じ変数に対して HistoryPut が複数回}
201                               \textcolor{comment}{! 呼ばれた時に, 自動的に時間変数がこの値}
202                               \textcolor{comment}{! だけ増やされて出力されます. なお, }
203                               \textcolor{comment}{! 各々の出力ファイルにつき HistorySetTime}
204                               \textcolor{comment}{! を一度でも用いた場合, この値は無効に}
205                               \textcolor{comment}{! なるので注意してください.}
206                               \textcolor{comment}{! }
207                               \textcolor{comment}{! 省略した場合, 自動的に 1.0 が設定されます.}
208                               \textcolor{comment}{! }
209                               \textcolor{comment}{! Interval of output time. }
210                               \textcolor{comment}{!}
211                               \textcolor{comment}{! When "HistoryPut" is called two or}
212                               \textcolor{comment}{! more times for the same variable, time}
213                               \textcolor{comment}{! is increased as this value and }
214                               \textcolor{comment}{! output automatically.}
215                               \textcolor{comment}{! Note that this value becomes}
216                               \textcolor{comment}{! invalid when "HistorySetTime" is }
217                               \textcolor{comment}{! used for each output file even once.}
218                               \textcolor{comment}{! }
219                               \textcolor{comment}{! If this argument is omitted, }
220                               \textcolor{comment}{! 1.0 is specified automatically. }
221                               \textcolor{comment}{! }
222     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{optional}:: xtypes(:)
223                               \textcolor{comment}{! dims で指定したそれぞれの}
224                               \textcolor{comment}{! 次元のデータ型. }
225                               \textcolor{comment}{!}
226                               \textcolor{comment}{! デフォルトは float (単精度実数型)}
227                               \textcolor{comment}{! です. 有効なのは,}
228                               \textcolor{comment}{! double (倍精度実数型), }
229                               \textcolor{comment}{! int (整数型) です. 指定しない}
230                               \textcolor{comment}{! 場合や, 無効な型を指定した場合には,}
231                               \textcolor{comment}{! float となります. なお, 配列の大きさ}
232                               \textcolor{comment}{! は *dims* の大きさと等しい必要が}
233                               \textcolor{comment}{! あります. 配列内の文字数は全て}
234                               \textcolor{comment}{! 同じでなければなりません.}
235                               \textcolor{comment}{! 足りない文字分は空白で補います.}
236                               \textcolor{comment}{!}
237                               \textcolor{comment}{! Data types of dimensions specified }
238                               \textcolor{comment}{! with "dims". }
239                               \textcolor{comment}{!}
240                               \textcolor{comment}{! Default value is "float" (single precision). }
241                               \textcolor{comment}{! Other valid values are }
242                               \textcolor{comment}{! "double" (double precision), }
243                               \textcolor{comment}{! "int" (integer). }
244                               \textcolor{comment}{! If no value or invalid value is specified, }
245                               \textcolor{comment}{! "float" is applied. }
246                               \textcolor{comment}{! Length of this array must be same as }
247                               \textcolor{comment}{! length of "dim".  }
248                               \textcolor{comment}{! Numbers of characters in this array}
249                               \textcolor{comment}{! must be same. }
250                               \textcolor{comment}{! Make up a deficit with blanks. }
251                               \textcolor{comment}{! }
252     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: history
253                               \textcolor{comment}{! 出力ファイルの設定に関する情報を}
254                               \textcolor{comment}{! 格納した構造体. }
255                               \textcolor{comment}{!}
256                               \textcolor{comment}{! 1 つのプログラムで複数のファイル}
257                               \textcolor{comment}{! に gtool データを出力する}
258                               \textcolor{comment}{! 場合に利用します.}
259                               \textcolor{comment}{! (単独のファイルに書き出す場合は}
260                               \textcolor{comment}{! 指定する必要はありません)}
261                               \textcolor{comment}{! }
262                               \textcolor{comment}{! Derived type that }
263                               \textcolor{comment}{! stores information about output files. }
264                               \textcolor{comment}{!}
265                               \textcolor{comment}{! If multiple gtool4 data files are }
266                               \textcolor{comment}{! output from one program, use this }
267                               \textcolor{comment}{! argument. }
268                               \textcolor{comment}{! (If onlye one file is output, }
269                               \textcolor{comment}{! this argument is not needed). }
270                               \textcolor{comment}{! }
271     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origind
272                               \textcolor{comment}{! 時間の原点. (倍精度実数) }
273                               \textcolor{comment}{!}
274                               \textcolor{comment}{! *time* と同様です. }
275                               \textcolor{comment}{! }
276                               \textcolor{comment}{! Origin of time. (Double precision)}
277                               \textcolor{comment}{!}
278                               \textcolor{comment}{! This is same as *time*. }
279                               \textcolor{comment}{! }
280     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: intervald
281                               \textcolor{comment}{! 出力時間間隔. (倍精度実数) }
282                               \textcolor{comment}{! }
283                               \textcolor{comment}{! *interval* と同様です. }
284                               \textcolor{comment}{! }
285                               \textcolor{comment}{! Interval of output time. (Double precision)}
286                               \textcolor{comment}{!}
287                               \textcolor{comment}{! This is same as *interval*. }
288                               \textcolor{comment}{! }
289     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: conventions
290                               \textcolor{comment}{! 出力するファイルの netCDF}
291                               \textcolor{comment}{! 規約}
292                               \textcolor{comment}{!}
293                               \textcolor{comment}{! 省略した場合,}
294                               \textcolor{comment}{! もしくは空文字を与えた場合,}
295                               \textcolor{comment}{! 出力する netCDF 規約の}
296                               \textcolor{comment}{! Conventions 属性に値}
297                               \textcolor{comment}{! gtool\_history\_internal#gtool4\_netCDF\_Conventions}
298                               \textcolor{comment}{! が自動的に与えられます.}
299                               \textcolor{comment}{! }
300                               \textcolor{comment}{! NetCDF conventions of output file. }
301                               \textcolor{comment}{!}
302                               \textcolor{comment}{! If this argument is omitted or, }
303                               \textcolor{comment}{! blanks are given,}
304                               \textcolor{comment}{! gtool\_history\_internal#gtool4\_netCDF\_Conventions is given to }
305                               \textcolor{comment}{! attribute "Conventions" of an output file}
306                               \textcolor{comment}{! automatically. }
307                               \textcolor{comment}{! }
308     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: gt\_version
309                               \textcolor{comment}{! gtool4 netCDF 規約のバージョン}
310                               \textcolor{comment}{!}
311                               \textcolor{comment}{! 省略した場合, gt\_version 属性に}
312                               \textcolor{comment}{! 規約の最新版のバージョンナンバー}
313                               \textcolor{comment}{! gtool4\_netCDF\_version}
314                               \textcolor{comment}{! が与えられます.}
315                               \textcolor{comment}{! (ただし, 引数 conventions に}
316                               \textcolor{comment}{! gtool\_history\_internal#gtool4\_netCDF\_Conventions}
317                               \textcolor{comment}{! 以外が与えられる場合は}
318                               \textcolor{comment}{! gt\_version 属性を作成しません).}
319                               \textcolor{comment}{! }
320                               \textcolor{comment}{! Version of gtool4 netCDF Conventions. }
321                               \textcolor{comment}{!}
322                               \textcolor{comment}{! If this argument is omitted, }
323                               \textcolor{comment}{! latest version number of gtool4 netCDF }
324                               \textcolor{comment}{! Conventions is given to attribute }
325                               \textcolor{comment}{! "gt\_version" of an output file }
326                               \textcolor{comment}{! (However, gtool\_history\_internal#gtool4\_netCDF\_Conventions is }
327                               \textcolor{comment}{! not given to an argument "conventions", }
328                               \textcolor{comment}{! attribute "gt\_version" is not created).}
329                               \textcolor{comment}{! }
330     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: overwrite
331                               \textcolor{comment}{! 上書き可否}
332                               \textcolor{comment}{!}
333                               \textcolor{comment}{! この引数に .false. を渡すと,}
334                               \textcolor{comment}{! 既存のファイルを上書きしません.}
335                               \textcolor{comment}{! デフォルトは上書きします.}
336                               \textcolor{comment}{! }
337                               \textcolor{comment}{! Whether or not to overwrite. }
338                               \textcolor{comment}{!}
339                               \textcolor{comment}{! If .false. is specified to this }
340                               \textcolor{comment}{! argument, an existing file is not}
341                               \textcolor{comment}{! overwritten. }
342                               \textcolor{comment}{! By default, existing file is overwritten. }
343                               \textcolor{comment}{! }
344     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: quiet
345                               \textcolor{comment}{! .true. を与えた場合, }
346                               \textcolor{comment}{! メッセージ出力が抑制されます. }
347                               \textcolor{comment}{! デフォルトは .false. です. }
348                               \textcolor{comment}{!}
349                               \textcolor{comment}{! If ".true." is given, }
350                               \textcolor{comment}{! messages are suppressed. }
351                               \textcolor{comment}{! Default value is ".false.".}
352                               \textcolor{comment}{! }
353     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_gather
354                               \textcolor{comment}{! MPI 使用時に, 各ノードで HistoryPut}
355                               \textcolor{comment}{! に与えたデータを一つのファイルに統合して出力}
356                               \textcolor{comment}{! する場合には .true. を与えてください. }
357                               \textcolor{comment}{! デフォルトは .false. です. }
358                               \textcolor{comment}{! }
359                               \textcolor{comment}{! .true. を与えた場合, HistoryPutAxisMPI}
360                               \textcolor{comment}{! に全体の軸データを与えてください. }
361                               \textcolor{comment}{!}
362                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
363                               \textcolor{comment}{! data given to "HistoryPut" on each node}
364                               \textcolor{comment}{! is integrated and output to one file. }
365                               \textcolor{comment}{! Default value is ".false.".}
366                               \textcolor{comment}{! }
367                               \textcolor{comment}{! If .true. is given, give data of axes in}
368                               \textcolor{comment}{! whole area to "HistoryPutAxisMPI"}
369                               \textcolor{comment}{! }
370     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_split
371                               \textcolor{comment}{! MPI 使用時にこの引数に .true. を与えると, }
372                               \textcolor{comment}{! 各ノードごとに}
373                               \textcolor{comment}{! *file* 引数に "\_rankXXXXXX" }
374                               \textcolor{comment}{! (X は [0-9] の数値で, ノード番号を指す) }
375                               \textcolor{comment}{! を付加したファイルを出力します. }
376                               \textcolor{comment}{! 例えば, *file* に "output.nc" を与えた場合. }
377                               \textcolor{comment}{! ノード 0 では "output\_rank000000.nc", }
378                               \textcolor{comment}{! ノード 12 では "output\_rank000012.nc"}
379                               \textcolor{comment}{! を出力します. }
380                               \textcolor{comment}{! デフォルトは .false. です. }
381                               \textcolor{comment}{!}
382                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
383                               \textcolor{comment}{! files that have names with suffixes}
384                               \textcolor{comment}{! "\_rankXXXXXX" }
385                               \textcolor{comment}{! (X is [0-9] that indicates node number) }
386                               \textcolor{comment}{! are output on each node. }
387                               \textcolor{comment}{! For example, "output.nc" is given to *file*, }
388                               \textcolor{comment}{! "output\_rank000000.nc", "output\_rank000012.nc"}
389                               \textcolor{comment}{! are output on node 0 and node 12. }
390                               \textcolor{comment}{! Default value is ".false.".}
391                               \textcolor{comment}{! }
392     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
393                               \textcolor{comment}{! 例外処理用フラグ.}
394                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
395                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
396                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
397                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
398                               \textcolor{comment}{! *err* に .true. が代入されます.}
399                               \textcolor{comment}{!}
400                               \textcolor{comment}{! Exception handling flag. }
401                               \textcolor{comment}{! By default, when error occur in }
402                               \textcolor{comment}{! this procedure, the program aborts. }
403                               \textcolor{comment}{! If this *err* argument is given, }
404                               \textcolor{comment}{! .true. is substituted to *err* and }
405                               \textcolor{comment}{! the program does not abort. }
406     \textcolor{keywordtype}{integer}:: numdims, i, stat, blank\_index
407     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{pointer}:: hst =>null()
408     \textcolor{keywordtype}{character(TOKEN)}:: my\_xtype, origin\_str\textcolor{comment}{!, interval\_str}
409     \textcolor{keywordtype}{character(STRING)}:: file\_work, url, x\_inst, x\_conv, x\_gtver, nc\_history
410     \textcolor{keywordtype}{character(STRING)}:: cause\_c
411     \textcolor{keywordtype}{logical}:: gtver\_add, overwrite\_required
412     \textcolor{keywordtype}{character(TOKEN)}:: username
413     \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}):: cal\_standard
414     \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}):: now\_date
415     \textcolor{keywordtype}{character(TOKEN)}:: now\_date\_str
416     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryCreate1"}
417     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: version = &
418       & \textcolor{stringliteral}{'$Name:  $'} // &
419       & \textcolor{stringliteral}{'$Id: historycreate.rb2f90,v 1.4 2009-11-03 05:22:46 morikawa Exp $'}
420   continue
421     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'file=%c ndims=%d'},  &
422       & c1=trim(file), i=(/\textcolor{keyword}{size}(dims)/), &
423       & version=version)
424     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
425     cause\_c = \textcolor{stringliteral}{""}
426     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}( &
427       & \textcolor{stringliteral}{'dims(:)=%a, dimsizes(:)=%a, longnames(:)=%a, units(:)=%a'}, &
428       & ca=\hyperlink{interfacedc__string_1_1stoa}{stoa}(\hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(dims), \hyperlink{interfacedc__string_1_1tochar}{tochar}(dimsizes), &
429       &         \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(longnames), \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(\hyperlink{structdc__units_1_1units}{units})))
430     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(history)) \textcolor{keywordflow}{then}
431       hst => history
432     \textcolor{keywordflow}{else}
433       hst => \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
434 \textcolor{keywordflow}{    endif}
435     \textcolor{comment}{! 初期設定のチェック}
436     \textcolor{comment}{! Check initialization}
437     \textcolor{comment}{!}
438     \textcolor{keywordflow}{if} ( hst % initialized ) \textcolor{keywordflow}{then}
439       stat = \hyperlink{namespacedc__error_a3302263a8c976235052a305d54572070}{dc\_ealreadyinit}
440       cause\_c = \textcolor{stringliteral}{'GT\_HISTORY'}
441       \textcolor{keywordflow}{goto} 999
442 \textcolor{keywordflow}{    end if}
443     \textcolor{comment}{! dims, dimsizes, longnames, units の整合性チェック}
444     \textcolor{comment}{! Check consistency about "dims", "dimsizes", "longnames", "units"}
445     \textcolor{comment}{!}
446     numdims = \textcolor{keyword}{size}(dims)
447     \textcolor{keywordflow}{if} ( \textcolor{keyword}{size}(dimsizes)  /= numdims ) \textcolor{keywordflow}{then}
448       cause\_c = \textcolor{stringliteral}{'dimsizes, dims'}
449     \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{size}(longnames) /= numdims ) \textcolor{keywordflow}{then}
450       cause\_c = \textcolor{stringliteral}{'longnames, dims'}
451     \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{size}(\hyperlink{structdc__units_1_1units}{units}) /= numdims ) \textcolor{keywordflow}{then}
452       cause\_c = \textcolor{stringliteral}{'units, dims'}
453 \textcolor{keywordflow}{    endif}
454     \textcolor{keywordflow}{if} ( trim(cause\_c) /= \textcolor{stringliteral}{""} ) \textcolor{keywordflow}{then}
455       stat = \hyperlink{namespacedc__error_aa11b8065198295505e35eb5a1e1436a4}{gt\_eargsizemismatch}
456       \textcolor{keywordflow}{goto} 999
457 \textcolor{keywordflow}{    end if}
458     \textcolor{comment}{! 次元変数表作成. }
459     \textcolor{comment}{! Create table of dimensional variables}
460     \textcolor{comment}{!}
461     \textcolor{keyword}{allocate}(hst % dimvars(numdims))
462     \textcolor{keyword}{allocate}(hst % dim\_value\_written(numdims))
463     hst % dim\_value\_written(:) = .false.
464     hst % unlimited\_index = 0
465     \textcolor{comment}{! ユーザ名の取得}
466     \textcolor{comment}{! Get user name}
467     \textcolor{comment}{!}
468     \textcolor{keyword}{call }\hyperlink{sysdepenv_8f90_a9e07f27148c8cf1890cf7dbc3a0334ee}{sysdepenvget}(\textcolor{stringliteral}{'USER'}, username)
469     \textcolor{keywordflow}{if} (trim(username) == \textcolor{stringliteral}{''}) username = \textcolor{stringliteral}{'unknown'}
470     \textcolor{comment}{! 現在時刻の取得}
471     \textcolor{comment}{! Get current time}
472     \textcolor{comment}{!}
473     \textcolor{keyword}{call }\hyperlink{interfacedc__calendar__generic_1_1dccaldatecurrent}{dccaldatecurrent}( now\_date )
474     \textcolor{keyword}{call }\hyperlink{interfacedc__calendar__generic_1_1dccalcreate}{dccalcreate}( \textcolor{stringliteral}{'gregorian'}, cal\_standard )
475     \textcolor{keyword}{call }\hyperlink{interfacedc__calendar__generic_1_1dccaldateinquire}{dccaldateinquire}( now\_date\_str, date = now\_date, cal = cal\_standard )
476 \textcolor{comment}{!    call DCDateTimeCreate(now\_time)}
477     nc\_history = trim(now\_date\_str) // \textcolor{stringliteral}{' '} // &
478       &       trim(username) // &
479       &       \textcolor{stringliteral}{'> gtool\_history: HistoryCreate'} // &
480       &       achar(10)
481     \textcolor{comment}{! MPI に関連する情報の初期設定}
482     \textcolor{comment}{! Initialize information about MPI}
483     \textcolor{comment}{!}
484     hst % mpi\_gather = .false.
485     hst % mpi\_split  = .false.
486     \textcolor{comment}{! MPI 使用時のファイル名の扱い}
487     \textcolor{comment}{! Treat file names when MPI is used}
488     \textcolor{comment}{!}
489     file\_work = file
490     \textcolor{comment}{! 変数 URL (出力ファイル) の作成}
491     \textcolor{comment}{! Create variable URL (output file)}
492     \textcolor{comment}{!}
493     \textcolor{keywordflow}{do}, i = 1, numdims
494       my\_xtype = \textcolor{stringliteral}{""}
495       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(xtypes) ) \textcolor{keywordflow}{then}
496         \textcolor{keywordflow}{if} ( \textcolor{keyword}{size}(xtypes) >= i ) \textcolor{keywordflow}{then}
497           my\_xtype = xtypes(i)
498 \textcolor{keywordflow}{        end if}
499 \textcolor{keywordflow}{      end if}
500       url = \hyperlink{interfacedc__url_1_1urlmerge}{urlmerge}(file=file, var=dims(i))
501       overwrite\_required = .true.
502       \textcolor{keywordflow}{if} (\hyperlink{namespacedc__present_a0eac5ec50371728c0edced0be3115187}{present\_and\_false}(overwrite)) overwrite\_required = .false.
503       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1create}{create}( &
504         & hst % dimvars(i), trim(url), &
505         & dimsizes(i), xtype=trim(my\_xtype), &
506         & overwrite=overwrite\_required)
507       \textcolor{comment}{! conventions が存在しない場合はデフォルトの値を}
508       \textcolor{comment}{! 属性 Conventions に付加。}
509       \textcolor{keywordflow}{if} ( \hyperlink{namespacedc__present_aae281a56bc41e9546908a72aeb042430}{present\_and\_not\_empty}(conventions) ) \textcolor{keywordflow}{then}
510         x\_conv = conventions
511       \textcolor{keywordflow}{else}
512         x\_conv  = \hyperlink{namespacegtool__history__internal_a62ea3a4c4f7a88a2bb8d4dd2dbe2b098}{gtool4\_netcdf\_conventions}
513 \textcolor{keywordflow}{      endif}
514       \textcolor{comment}{! 1) gt\_version がある場合、それを gt\_version 属性に渡す。}
515       \textcolor{comment}{! 2) gt\_version が無い場合、conventions も無いか、または}
516       \textcolor{comment}{!    gtool4 netCDF 規約が入っていれば最新版を gt\_version}
517       \textcolor{comment}{!    に与える。そうでない場合は gt\_version 属性を与えない。}
518       \textcolor{keywordflow}{if} (\hyperlink{namespacedc__present_aae281a56bc41e9546908a72aeb042430}{present\_and\_not\_empty}(gt\_version)) \textcolor{keywordflow}{then}
519         x\_gtver = gt\_version
520         gtver\_add = .true.
521       \textcolor{keywordflow}{else}
522         \textcolor{keywordflow}{if} ( \hyperlink{namespacedc__present_aae281a56bc41e9546908a72aeb042430}{present\_and\_not\_empty}(conventions) .and. &
523           &  .not. x\_conv == \hyperlink{namespacegtool__history__internal_a62ea3a4c4f7a88a2bb8d4dd2dbe2b098}{gtool4\_netcdf\_conventions} ) \textcolor{keywordflow}{then}
524           gtver\_add = .false.
525         \textcolor{keywordflow}{else}
526           x\_gtver = \hyperlink{namespacegtool__history__internal_a29f3530387244862c313d41352821433}{gtool4\_netcdf\_version}
527           gtver\_add = .true.
528 \textcolor{keywordflow}{        endif}
529 \textcolor{keywordflow}{      endif}
530       \textcolor{keywordflow}{if} (trim(institution) /= \textcolor{stringliteral}{""}) \textcolor{keywordflow}{then}
531         x\_inst = institution
532       \textcolor{keywordflow}{else}
533         x\_inst = \textcolor{stringliteral}{"a gtool\_history (by GFD Dennou Club) user"}
534 \textcolor{keywordflow}{      endif}
535       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+Conventions'}, trim(x\_conv))
536       \textcolor{keywordflow}{if} (gtver\_add) \textcolor{keywordflow}{then}
537         \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+gt\_version'}, trim(x\_gtver))
538 \textcolor{keywordflow}{      endif}
539       \textcolor{comment}{! title, source, institution, history, long\_name, units 属性の付加}
540       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+title'}, title)
541       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+source'}, source)
542       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+institution'}, trim(x\_inst))
543       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'+history'}, trim(nc\_history))
544       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'long\_name'}, trim(longnames(i)))
545       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(hst % dimvars(i), \textcolor{stringliteral}{'units'}, trim(\hyperlink{structdc__units_1_1units}{units}(i)))
546       \textcolor{keywordflow}{if} (dimsizes(i) == 0) \textcolor{keywordflow}{then}
547         hst % unlimited\_index = i
548         hst % unlimited\_units = \hyperlink{structdc__units_1_1units}{units}(i)
549 \textcolor{keywordflow}{      end if}
550 \textcolor{keywordflow}{    enddo}
551     \textcolor{comment}{! 従属変数表の初期化}
552     \textcolor{comment}{! Initialize table of dependent variables}
553     \textcolor{comment}{!}
554     \textcolor{keyword}{nullify}(hst % vars, hst % growable\_indices, hst % count)
555     \textcolor{comment}{! 時刻の単位}
556     \textcolor{comment}{!}
557     \textcolor{keywordflow}{if} ( hst % unlimited\_index == 0 ) \textcolor{keywordflow}{then}
558       hst % unlimited\_units\_symbol = \hyperlink{namespacedc__date__types_a5dbd685bd8334def6bf91a9f86e6a2a3}{unit\_symbol\_sec}
559     \textcolor{keywordflow}{else}
560       blank\_index = index( trim( adjustl(hst % unlimited\_units) ), \textcolor{stringliteral}{' '} )
561       \textcolor{keywordflow}{if} ( blank\_index > 1  ) \textcolor{keywordflow}{then}
562         hst % unlimited\_units = hst % unlimited\_units(1:blank\_index-1)
563 \textcolor{keywordflow}{      end if}
564       hst % unlimited\_units\_symbol = \hyperlink{interfacedc__date__generic_1_1parsetimeunits}{parsetimeunits}( hst % unlimited\_units )
565       \textcolor{keywordflow}{if} ( hst % unlimited\_units\_symbol == \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err} ) \textcolor{keywordflow}{then}
566         \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, &
567           & \textcolor{stringliteral}{'units of time (%c) can not be recognized as units of time. '} // &
568           & \textcolor{stringliteral}{'This units is treated as (%c)'}, &
569           & c1 = trim(hst % unlimited\_units), c2 = \textcolor{stringliteral}{'sec'})
570         hst % unlimited\_units\_symbol = \hyperlink{namespacedc__date__types_a5dbd685bd8334def6bf91a9f86e6a2a3}{unit\_symbol\_sec}
571 \textcolor{keywordflow}{      end if}
572 \textcolor{keywordflow}{    end if}
573     \textcolor{comment}{! 時間カウンタ}
574     \textcolor{comment}{!}
575     \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval) ) \textcolor{keywordflow}{then}
576       hst % interval = interval
577     \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{present}(intervald) ) \textcolor{keywordflow}{then}
578       hst % interval = intervald
579     \textcolor{keywordflow}{else}
580       hst % interval = 1.0
581 \textcolor{keywordflow}{    end if}
582     \textcolor{keywordflow}{if} ( \textcolor{keyword}{present} (origin) ) \textcolor{keywordflow}{then}
583       hst % origin = origin
584       hst % origin\_setting = .true.
585     \textcolor{keywordflow}{elseif}( \textcolor{keyword}{present}(origind) ) \textcolor{keywordflow}{then}
586       hst % origin = origind
587       hst % origin\_setting = .true.
588     \textcolor{keywordflow}{else}
589       hst % origin = 0.0
590       hst % origin\_setting = .false.
591 \textcolor{keywordflow}{    end if}
592     origin\_str = trim( \hyperlink{interfacedc__string_1_1tochar}{tochar}( hst % origin ) ) // &
593       &          \textcolor{stringliteral}{' ['} // trim( hst % unlimited\_units ) // \textcolor{stringliteral}{']'}
594     hst % newest = hst % origin
595     hst % oldest = hst % origin
596     \textcolor{comment}{! 時間平均値出力に関するデフォルト設定 }
597     \textcolor{comment}{! Default settings for time-averaged value output}
598     \textcolor{comment}{!}
599     hst % time\_bnds = hst % origin
600     hst % time\_bnds\_output\_count = 0
601     \textcolor{comment}{! メッセージ出力}
602     \textcolor{comment}{! Output messages}
603     \textcolor{comment}{!}
604     \textcolor{keywordflow}{if} ( .not. \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}(quiet) ) \textcolor{keywordflow}{then}
605       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'M'}, subname, &
606         & \textcolor{stringliteral}{'"%c" is created (origin=%c)'}, &
607         & c1 = trim( file\_work ), &
608         & c2 = trim( origin\_str ), rank\_mpi = -1 )
609 \textcolor{keywordflow}{    end if}
610     \textcolor{comment}{! 終了処理, 例外処理}
611     \textcolor{comment}{! Termination and Exception handling}
612     \textcolor{comment}{!}
613     hst % initialized = .true.
614 999 \textcolor{keywordflow}{continue}
615     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err, cause\_c=cause\_c)
616     \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]{historycreate_8f90_a22c2569d0c45cec46ddcc60699655655_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{historycreate_8f90_af500a09f0e2f79576ba8618b15181607}\label{historycreate_8f90_af500a09f0e2f79576ba8618b15181607}} 
\index{historycreate.\+f90@{historycreate.\+f90}!historycreate2@{historycreate2}}
\index{historycreate2@{historycreate2}!historycreate.\+f90@{historycreate.\+f90}}
\subsubsection{\texorpdfstring{historycreate2()}{historycreate2()}}
{\footnotesize\ttfamily subroutine historycreate2 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{file,  }\item[{character($\ast$), intent(in)}]{title,  }\item[{character($\ast$), intent(in)}]{source,  }\item[{character($\ast$), intent(in)}]{institution,  }\item[{character($\ast$), dimension(\+:), intent(in)}]{dims,  }\item[{integer, dimension (\+:), intent(in)}]{dimsizes,  }\item[{character($\ast$), dimension (\+:), intent(in)}]{longnames,  }\item[{character($\ast$), dimension(\+:), intent(in)}]{units,  }\item[{type(dc\+\_\+difftime), intent(in)}]{origin,  }\item[{type(dc\+\_\+difftime), intent(in), optional}]{interval,  }\item[{character($\ast$), dimension(\+:), intent(in), optional}]{xtypes,  }\item[{type(gt\+\_\+history), intent(out), optional, target}]{history,  }\item[{character($\ast$), intent(in), optional}]{conventions,  }\item[{character($\ast$), intent(in), optional}]{gt\+\_\+version,  }\item[{logical, intent(in), optional}]{overwrite,  }\item[{logical, intent(in), optional}]{quiet,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+gather,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+split,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 624 of file historycreate.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+ealreadyinit, dc\+\_\+error\+::dc\+\_\+noerr, gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::gt\+\_\+eargsizemismatch, dc\+\_\+string\+::joinchar(), dc\+\_\+present\+::present\+\_\+and\+\_\+false(), dc\+\_\+present\+::present\+\_\+and\+\_\+not\+\_\+empty(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, sysdepenvget(), dc\+\_\+types\+::token, dc\+\_\+date\+\_\+types\+::unit\+\_\+symbol\+\_\+err, and dc\+\_\+date\+\_\+types\+::unit\+\_\+symbol\+\_\+sec.


\begin{DoxyCode}
624     \textcolor{comment}{!}
625     \textcolor{comment}{!== gtool4 データ出力用初期設定}
626     \textcolor{comment}{!}
627     \textcolor{comment}{! このサブルーチンは、gtool4 データ出力の初期設定を行います。}
628     \textcolor{comment}{! HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、}
629     \textcolor{comment}{! HistoryAddAttr、 HistoryClose、 HistorySetTime}
630     \textcolor{comment}{! を用いるためには、HistoryCreate による初期設定が必要です。}
631     \textcolor{comment}{!}
632     \textcolor{comment}{! なお、プログラム内で HistoryCreate を呼び出した場合、}
633     \textcolor{comment}{! プログラムを終了する前に必ず、 HistoryClose を呼び出して}
634     \textcolor{comment}{! 終了処理を行なって下さい。}
635     \textcolor{comment}{!}
636     \textcolor{comment}{! *HistoryCreate* というサブルーチン名は 2 つの別々の}
637     \textcolor{comment}{! サブルーチンの総称名です。上記のサブルーチンも参照ください。}
638     \textcolor{comment}{!}
639     \textcolor{comment}{!}
640     \textcolor{comment}{! Two specific subroutines shares common part:}
641     \textcolor{comment}{!}
642     \textcolor{comment}{! Both two ones initializes a dataset *file*.}
643     \textcolor{comment}{! The result of type GT\_HISTORY will be returned by *history*}
644     \textcolor{comment}{! or managed internally if omitted.}
645     \textcolor{comment}{! Mandatory global attributes are defined by arguments}
646     \textcolor{comment}{! *title*, *source*, and *institution*;}
647     \textcolor{comment}{! they are all declared as ((character(len = *))).}
648     \textcolor{comment}{! Spatial axis definitions have two different forms:}
649     \textcolor{comment}{! a primitive one uses several arrays of various types:}
650     \textcolor{comment}{! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.}
651     \textcolor{comment}{! Another sophisticated one has only array of type GT\_HISTORY\_AXIS,}
652     \textcolor{comment}{! *axes*.}
653     \textcolor{comment}{! Temporal definition is done without *origin*, *interval*.}
654     \textcolor{comment}{!}
655     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{,only}: \hyperlink{interfacegtdata__generic_1_1create}{create}, \hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}, 
      \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
656     \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}
657     \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_aa11b8065198295505e35eb5a1e1436a4}{gt\_eargsizemismatch}, \hyperlink{namespacedc__error_a3302263a8c976235052a305d54572070}{dc\_ealreadyinit}
658     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}, \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__string_1_1stoa}{stoa}
659     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__url_1_1urlmerge}{urlmerge}
660     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_aae281a56bc41e9546908a72aeb042430}{present\_and\_not\_empty}, 
      \hyperlink{namespacedc__present_a0eac5ec50371728c0edced0be3115187}{present\_and\_false}, \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
661     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
662     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
663     \textcolor{keywordtype}{use }\hyperlink{namespacesysdep}{sysdep}\textcolor{keywordtype}{,     only}: \hyperlink{sysdepenv_8f90_a9e07f27148c8cf1890cf7dbc3a0334ee}{sysdepenvget}
664     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__date__types_1_1dc__datetime}{dc\_datetime}, \hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}, 
      \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err}, \hyperlink{namespacedc__date__types_a5dbd685bd8334def6bf91a9f86e6a2a3}{unit\_symbol\_sec}
665     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{,  only}: \hyperlink{interfacedc__date__generic_1_1dcdatetimecreate}{dcdatetimecreate}, \hyperlink{interfacedc__string_1_1tochar}{tochar}, 
      \hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}, &
666       & \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}, \hyperlink{interfacedc__date__generic_1_1parsetimeunits}{parsetimeunits}
667     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__types}{gtool\_history\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}, 
      \hyperlink{structgtool__history__types_1_1gt__history__axis}{gt\_history\_axis}, \hyperlink{structgtool__history__types_1_1gt__history__varinfo}{gt\_history\_varinfo}, 
      \hyperlink{structgtool__history__types_1_1gt__history__attr}{gt\_history\_attr}
668     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
669     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}
670     \textcolor{keywordtype}{implicit none}
671     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: file
672                               \textcolor{comment}{! 出力するファイルの名前. }
673                               \textcolor{comment}{! Name of output file}
674     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: title
675                               \textcolor{comment}{! データ全体の表題. }
676                               \textcolor{comment}{! Title of entire data}
677     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: source
678                               \textcolor{comment}{! データを作成する際の手段. }
679                               \textcolor{comment}{! Source of data file}
680     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: institution
681                               \textcolor{comment}{! ファイルを最終的に変更した組織/個人. }
682                               \textcolor{comment}{! Institution or person that changes files for the last time}
683     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: dims(:)
684                               \textcolor{comment}{! 次元の名前. }
685                               \textcolor{comment}{! }
686                               \textcolor{comment}{! 配列の大きさに制限はありません.}
687                               \textcolor{comment}{! 個々の次元の文字数は dc\_types#TOKEN まで.}
688                               \textcolor{comment}{! 配列内の文字数は}
689                               \textcolor{comment}{! 全て同じでなければなりません.}
690                               \textcolor{comment}{! 足りない文字分は空白で}
691                               \textcolor{comment}{! 補ってください.}
692                               \textcolor{comment}{! }
693                               \textcolor{comment}{! Names of dimensions.}
694                               \textcolor{comment}{! }
695                               \textcolor{comment}{! Length of array is unlimited. }
696                               \textcolor{comment}{! Limits of numbers of characters of each }
697                               \textcolor{comment}{! dimensions are "dc\_types#TOKEN". }
698                               \textcolor{comment}{! Numbers of characters in this array}
699                               \textcolor{comment}{! must be same. }
700                               \textcolor{comment}{! Make up a deficit with blanks. }
701                               \textcolor{comment}{! }
702     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimsizes (:)
703                               \textcolor{comment}{! dims で指定したそれぞれの次元大きさ. }
704                               \textcolor{comment}{! }
705                               \textcolor{comment}{! 配列の大きさは dims の大きさと等しい}
706                               \textcolor{comment}{! 必要があります.  '0' (数字のゼロ) を指定}
707                               \textcolor{comment}{! するとその次元は 無制限次元 (unlimited}
708                               \textcolor{comment}{! dimension) となります. (gtool\_history }
709                               \textcolor{comment}{! では時間の次元に対して無制限次元を}
710                               \textcolor{comment}{! 用いることを想定しています). ただし, }
711                               \textcolor{comment}{! 1 つの NetCDF ファイル (バージョン 3) }
712                               \textcolor{comment}{! は最大で 1 つの無制限次元しか持てないので, }
713                               \textcolor{comment}{! 2 ヶ所以上に '0' を指定しないでください. }
714                               \textcolor{comment}{! その場合, 正しく gtool4 データが出力されません.}
715                               \textcolor{comment}{! }
716                               \textcolor{comment}{! Lengths of dimensions specified with "dims". }
717                               \textcolor{comment}{! }
718                               \textcolor{comment}{! Length of this array must be same as }
719                               \textcolor{comment}{! length of "dim".  If '0' (zero) is }
720                               \textcolor{comment}{! specified, the dimension is treated as }
721                               \textcolor{comment}{! unlimited dimension.  }
722                               \textcolor{comment}{! (In "gtool\_history", unlimited dimension is }
723                               \textcolor{comment}{! expected to be used as time). }
724                               \textcolor{comment}{! Note that one NetCDF file (version 3) }
725                               \textcolor{comment}{! can not have two or more unlimited }
726                               \textcolor{comment}{! dimensions, so that do not specify '0' }
727                               \textcolor{comment}{! to two or more places. In that case, }
728                               \textcolor{comment}{! gtoo4 data is not output currently }
729                               \textcolor{comment}{! }
730     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: longnames (:)
731                               \textcolor{comment}{! dims で指定したそれぞれの次元の名前. }
732                               \textcolor{comment}{!}
733                               \textcolor{comment}{! 配列の大きさは dims の大きさ}
734                               \textcolor{comment}{! と等しい必要があります. 文字数}
735                               \textcolor{comment}{! は dc\_types#STRING まで.}
736                               \textcolor{comment}{! 配列内の文字数は}
737                               \textcolor{comment}{! 全て同じでなければなりません.}
738                               \textcolor{comment}{! 足りない文字分は空白で補います.}
739                               \textcolor{comment}{! }
740                               \textcolor{comment}{! Names of dimensions specified with "dims". }
741                               \textcolor{comment}{!}
742                               \textcolor{comment}{! Length of this array must be same as }
743                               \textcolor{comment}{! length of "dim".  }
744                               \textcolor{comment}{! Limits of numbers of characters are }
745                               \textcolor{comment}{! "dc\_types#STRING". }
746                               \textcolor{comment}{! Numbers of characters in this array}
747                               \textcolor{comment}{! must be same. }
748                               \textcolor{comment}{! Make up a deficit with blanks. }
749                               \textcolor{comment}{! }
750     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: \hyperlink{structdc__units_1_1units}{units}(:)
751                               \textcolor{comment}{! dims で指定したそれぞれの次元の単位. }
752                               \textcolor{comment}{!}
753                               \textcolor{comment}{! 配列の大きさは dims の大きさ}
754                               \textcolor{comment}{! と等しい必要があります. 文字数}
755                               \textcolor{comment}{! は dc\_types#STRING まで.}
756                               \textcolor{comment}{! 配列内の文字数は}
757                               \textcolor{comment}{! 全て同じでなければなりません.}
758                               \textcolor{comment}{! 足りない文字分は空白で補います.}
759                               \textcolor{comment}{! }
760                               \textcolor{comment}{! Units of dimensions specified with "dims". }
761                               \textcolor{comment}{!}
762                               \textcolor{comment}{! Length of this array must be same as }
763                               \textcolor{comment}{! length of "dim".  }
764                               \textcolor{comment}{! Limits of numbers of characters are }
765                               \textcolor{comment}{! "dc\_types#STRING". }
766                               \textcolor{comment}{! Numbers of characters in this array}
767                               \textcolor{comment}{! must be same. }
768                               \textcolor{comment}{! Make up a deficit with blanks. }
769                               \textcolor{comment}{! }
770     \textcolor{keywordtype}{type}(\hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}), \textcolor{keywordtype}{intent(in)}:: origin
771                               \textcolor{comment}{! 時間の原点. }
772                               \textcolor{comment}{!}
773                               \textcolor{comment}{! これは HistoryPut により変数を最初に}
774                               \textcolor{comment}{! 出力するときの時間となります.}
775                               \textcolor{comment}{! }
776                               \textcolor{comment}{! 省略した場合, 時間の原点には}
777                               \textcolor{comment}{! 自動的に 0.0 が設定されます.}
778                               \textcolor{comment}{! }
779                               \textcolor{comment}{! Origin of time. }
780                               \textcolor{comment}{!}
781                               \textcolor{comment}{! This time is used as time }
782                               \textcolor{comment}{! when first output is done by "HistoryPut". }
783                               \textcolor{comment}{! }
784                               \textcolor{comment}{! If this argument is omitted, }
785                               \textcolor{comment}{! 0.0 is specified automatically. }
786                               \textcolor{comment}{! }
787     \textcolor{keywordtype}{type}(\hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: interval
788                               \textcolor{comment}{! 出力時間間隔. }
789                               \textcolor{comment}{!}
790                               \textcolor{comment}{! 同じ変数に対して HistoryPut が複数回}
791                               \textcolor{comment}{! 呼ばれた時に, 自動的に時間変数がこの値}
792                               \textcolor{comment}{! だけ増やされて出力されます. なお, }
793                               \textcolor{comment}{! 各々の出力ファイルにつき HistorySetTime}
794                               \textcolor{comment}{! を一度でも用いた場合, この値は無効に}
795                               \textcolor{comment}{! なるので注意してください.}
796                               \textcolor{comment}{! }
797                               \textcolor{comment}{! 省略した場合, 自動的に 1.0 が設定されます.}
798                               \textcolor{comment}{! }
799                               \textcolor{comment}{! Interval of output time. }
800                               \textcolor{comment}{!}
801                               \textcolor{comment}{! When "HistoryPut" is called two or}
802                               \textcolor{comment}{! more times for the same variable, time}
803                               \textcolor{comment}{! is increased as this value and }
804                               \textcolor{comment}{! output automatically.}
805                               \textcolor{comment}{! Note that this value becomes}
806                               \textcolor{comment}{! invalid when "HistorySetTime" is }
807                               \textcolor{comment}{! used for each output file even once.}
808                               \textcolor{comment}{! }
809                               \textcolor{comment}{! If this argument is omitted, }
810                               \textcolor{comment}{! 1.0 is specified automatically. }
811                               \textcolor{comment}{! }
812     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{optional}:: xtypes(:)
813                               \textcolor{comment}{! dims で指定したそれぞれの}
814                               \textcolor{comment}{! 次元のデータ型. }
815                               \textcolor{comment}{!}
816                               \textcolor{comment}{! デフォルトは float (単精度実数型)}
817                               \textcolor{comment}{! です. 有効なのは,}
818                               \textcolor{comment}{! double (倍精度実数型), }
819                               \textcolor{comment}{! int (整数型) です. 指定しない}
820                               \textcolor{comment}{! 場合や, 無効な型を指定した場合には,}
821                               \textcolor{comment}{! float となります. なお, 配列の大きさ}
822                               \textcolor{comment}{! は *dims* の大きさと等しい必要が}
823                               \textcolor{comment}{! あります. 配列内の文字数は全て}
824                               \textcolor{comment}{! 同じでなければなりません.}
825                               \textcolor{comment}{! 足りない文字分は空白で補います.}
826                               \textcolor{comment}{!}
827                               \textcolor{comment}{! Data types of dimensions specified }
828                               \textcolor{comment}{! with "dims". }
829                               \textcolor{comment}{!}
830                               \textcolor{comment}{! Default value is "float" (single precision). }
831                               \textcolor{comment}{! Other valid values are }
832                               \textcolor{comment}{! "double" (double precision), }
833                               \textcolor{comment}{! "int" (integer). }
834                               \textcolor{comment}{! If no value or invalid value is specified, }
835                               \textcolor{comment}{! "float" is applied. }
836                               \textcolor{comment}{! Length of this array must be same as }
837                               \textcolor{comment}{! length of "dim".  }
838                               \textcolor{comment}{! Numbers of characters in this array}
839                               \textcolor{comment}{! must be same. }
840                               \textcolor{comment}{! Make up a deficit with blanks. }
841                               \textcolor{comment}{! }
842     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: history
843                               \textcolor{comment}{! 出力ファイルの設定に関する情報を}
844                               \textcolor{comment}{! 格納した構造体. }
845                               \textcolor{comment}{!}
846                               \textcolor{comment}{! 1 つのプログラムで複数のファイル}
847                               \textcolor{comment}{! に gtool データを出力する}
848                               \textcolor{comment}{! 場合に利用します.}
849                               \textcolor{comment}{! (単独のファイルに書き出す場合は}
850                               \textcolor{comment}{! 指定する必要はありません)}
851                               \textcolor{comment}{! }
852                               \textcolor{comment}{! Derived type that }
853                               \textcolor{comment}{! stores information about output files. }
854                               \textcolor{comment}{!}
855                               \textcolor{comment}{! If multiple gtool4 data files are }
856                               \textcolor{comment}{! output from one program, use this }
857                               \textcolor{comment}{! argument. }
858                               \textcolor{comment}{! (If onlye one file is output, }
859                               \textcolor{comment}{! this argument is not needed). }
860                               \textcolor{comment}{! }
861     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: conventions
862                               \textcolor{comment}{! 出力するファイルの netCDF}
863                               \textcolor{comment}{! 規約}
864                               \textcolor{comment}{!}
865                               \textcolor{comment}{! 省略した場合,}
866                               \textcolor{comment}{! もしくは空文字を与えた場合,}
867                               \textcolor{comment}{! 出力する netCDF 規約の}
868                               \textcolor{comment}{! Conventions 属性に値}
869                               \textcolor{comment}{! gtool4\_netCDF\_Conventions}
870                               \textcolor{comment}{! が自動的に与えられます.}
871                               \textcolor{comment}{! }
872                               \textcolor{comment}{! NetCDF conventions of output file. }
873                               \textcolor{comment}{!}
874                               \textcolor{comment}{! If this argument is omitted or, }
875                               \textcolor{comment}{! blanks are given,}
876                               \textcolor{comment}{! gtool4\_netCDF\_Conventions is given to }
877                               \textcolor{comment}{! attribute "Conventions" of an output file}
878                               \textcolor{comment}{! automatically. }
879                               \textcolor{comment}{! }
880     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: gt\_version
881                               \textcolor{comment}{! gtool4 netCDF 規約のバージョン}
882                               \textcolor{comment}{!}
883                               \textcolor{comment}{! 省略した場合, gt\_version 属性に}
884                               \textcolor{comment}{! 規約の最新版のバージョンナンバー}
885                               \textcolor{comment}{! gtool4\_netCDF\_version}
886                               \textcolor{comment}{! が与えられます.}
887                               \textcolor{comment}{! (ただし, 引数 conventions に}
888                               \textcolor{comment}{! gtool4\_netCDF\_Conventions}
889                               \textcolor{comment}{! 以外が与えられる場合は}
890                               \textcolor{comment}{! gt\_version 属性を作成しません).}
891                               \textcolor{comment}{! }
892                               \textcolor{comment}{! Version of gtool4 netCDF Conventions. }
893                               \textcolor{comment}{!}
894                               \textcolor{comment}{! If this argument is omitted, }
895                               \textcolor{comment}{! latest version number of gtool4 netCDF }
896                               \textcolor{comment}{! Conventions is given to attribute }
897                               \textcolor{comment}{! "gt\_version" of an output file }
898                               \textcolor{comment}{! (However, gtool4\_netCDF\_Conventions is }
899                               \textcolor{comment}{! not given to an argument "conventions", }
900                               \textcolor{comment}{! attribute "gt\_version" is not created).}
901                               \textcolor{comment}{! }
902     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: overwrite
903                               \textcolor{comment}{! 上書き可否}
904                               \textcolor{comment}{!}
905                               \textcolor{comment}{! この引数に .false. を渡すと,}
906                               \textcolor{comment}{! 既存のファイルを上書きしません.}
907                               \textcolor{comment}{! デフォルトは上書きします.}
908                               \textcolor{comment}{! }
909                               \textcolor{comment}{! Whether or not to overwrite. }
910                               \textcolor{comment}{!}
911                               \textcolor{comment}{! If .false. is specified to this }
912                               \textcolor{comment}{! argument, an existing file is not}
913                               \textcolor{comment}{! overwritten. }
914                               \textcolor{comment}{! By default, existing file is overwritten. }
915                               \textcolor{comment}{! }
916     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: quiet
917                               \textcolor{comment}{! .true. を与えた場合, }
918                               \textcolor{comment}{! メッセージ出力が抑制されます. }
919                               \textcolor{comment}{! デフォルトは .false. です. }
920                               \textcolor{comment}{!}
921                               \textcolor{comment}{! If ".true." is given, }
922                               \textcolor{comment}{! messages are suppressed. }
923                               \textcolor{comment}{! Default value is ".false.".}
924                               \textcolor{comment}{! }
925     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_gather
926                               \textcolor{comment}{! MPI 使用時に, 各ノードで HistoryPut}
927                               \textcolor{comment}{! に与えたデータを一つのファイルに統合して出力}
928                               \textcolor{comment}{! する場合には .true. を与えてください. }
929                               \textcolor{comment}{! デフォルトは .false. です. }
930                               \textcolor{comment}{! }
931                               \textcolor{comment}{! .true. を与えた場合, HistoryPutAxisMPI}
932                               \textcolor{comment}{! に全体の軸データを与えてください. }
933                               \textcolor{comment}{!}
934                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
935                               \textcolor{comment}{! data given to "HistoryPut" on each node}
936                               \textcolor{comment}{! is integrated and output to one file. }
937                               \textcolor{comment}{! Default value is ".false.".}
938                               \textcolor{comment}{! }
939                               \textcolor{comment}{! If .true. is given, give data of axes in}
940                               \textcolor{comment}{! whole area to "HistoryPutAxisMPI"}
941                               \textcolor{comment}{! }
942     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_split
943                               \textcolor{comment}{! MPI 使用時にこの引数に .true. を与えると, }
944                               \textcolor{comment}{! 各ノードごとに}
945                               \textcolor{comment}{! *file* 引数に "\_rankXXXXXX" }
946                               \textcolor{comment}{! (X は [0-9] の数値で, ノード番号を指す) }
947                               \textcolor{comment}{! を付加したファイルを出力します. }
948                               \textcolor{comment}{! 例えば, *file* に "output.nc" を与えた場合. }
949                               \textcolor{comment}{! ノード 0 では "output\_rank000000.nc", }
950                               \textcolor{comment}{! ノード 12 では "output\_rank000012.nc"}
951                               \textcolor{comment}{! を出力します. }
952                               \textcolor{comment}{! デフォルトは .false. です. }
953                               \textcolor{comment}{!}
954                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
955                               \textcolor{comment}{! files that have names with suffixes}
956                               \textcolor{comment}{! "\_rankXXXXXX" }
957                               \textcolor{comment}{! (X is [0-9] that indicates node number) }
958                               \textcolor{comment}{! are output on each node. }
959                               \textcolor{comment}{! For example, "output.nc" is given to *file*, }
960                               \textcolor{comment}{! "output\_rank000000.nc", "output\_rank000012.nc"}
961                               \textcolor{comment}{! are output on node 0 and node 12. }
962                               \textcolor{comment}{! Default value is ".false.".}
963                               \textcolor{comment}{! }
964     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
965                               \textcolor{comment}{! 例外処理用フラグ.}
966                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
967                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
968                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
969                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
970                               \textcolor{comment}{! *err* に .true. が代入されます.}
971                               \textcolor{comment}{!}
972                               \textcolor{comment}{! Exception handling flag. }
973                               \textcolor{comment}{! By default, when error occur in }
974                               \textcolor{comment}{! this procedure, the program aborts. }
975                               \textcolor{comment}{! If this *err* argument is given, }
976                               \textcolor{comment}{! .true. is substituted to *err* and }
977                               \textcolor{comment}{! the program does not abort. }
978     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{pointer}:: hst =>null()
979     \textcolor{keywordtype}{real(DP)}:: origind, intervald
980     \textcolor{keywordtype}{integer}:: i, numdims, blank\_index
981     \textcolor{keywordtype}{character(TOKEN)}:: unlimited\_units
982     \textcolor{keywordtype}{integer}:: unit\_symbol
983     \textcolor{keywordtype}{integer}:: stat
984     \textcolor{keywordtype}{character(STRING)}:: cause\_c
985     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryCreate2"}
986     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: version = &
987       & \textcolor{stringliteral}{'$Name:  $'} // &
988       & \textcolor{stringliteral}{'$Id: historycreate.rb2f90,v 1.4 2009-11-03 05:22:46 morikawa Exp $'}
989   continue
990     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'file=%c ndims=%d'},  &
991       & c1=trim(file), i=(/\textcolor{keyword}{size}(dims)/), &
992       & version=version)
993     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
994     cause\_c = \textcolor{stringliteral}{""}
995     numdims = \textcolor{keyword}{size}(dims)
996     unlimited\_units = \textcolor{stringliteral}{'sec'}
997     \textcolor{keywordflow}{do}, i = 1, numdims
998       \textcolor{keywordflow}{if} (dimsizes(i) == 0) unlimited\_units = \hyperlink{structdc__units_1_1units}{units}(i)
999 \textcolor{keywordflow}{    end do}
1000     blank\_index = index( trim( adjustl(unlimited\_units) ), \textcolor{stringliteral}{' '} )
1001     \textcolor{keywordflow}{if} ( blank\_index > 1  ) \textcolor{keywordflow}{then}
1002       unlimited\_units = unlimited\_units(1:blank\_index-1)
1003 \textcolor{keywordflow}{    end if}
1004     unit\_symbol = \hyperlink{interfacedc__date__generic_1_1parsetimeunits}{parsetimeunits}( unlimited\_units )
1005     \textcolor{keywordflow}{if} ( unit\_symbol == \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err} ) unit\_symbol = 
      \hyperlink{namespacedc__date__types_a5dbd685bd8334def6bf91a9f86e6a2a3}{unit\_symbol\_sec}
1006     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(interval)) \textcolor{keywordflow}{then}
1007       intervald = \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}( interval, \textcolor{stringliteral}{''}, unit\_symbol )
1008     \textcolor{keywordflow}{else}
1009       intervald = 1.0\_dp
1010 \textcolor{keywordflow}{    end if}
1011     origind = \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}( origin, \textcolor{stringliteral}{''}, unit\_symbol )
1012     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}( & 
1013       & file = file, title = title, &
1014       & source = source, institution = institution, &
1015       & dims = dims, dimsizes = dimsizes, &
1016       & longnames = longnames, \hyperlink{structdc__units_1_1units}{units} = \hyperlink{structdc__units_1_1units}{units}, &
1017       & xtypes = xtypes, history = history, &
1018       & origind = origind, intervald = intervald, &
1019       & conventions = conventions, gt\_version = gt\_version, &
1020       & overwrite = overwrite, quiet = quiet, &
1021       & flag\_mpi\_gather = flag\_mpi\_gather, flag\_mpi\_split = flag\_mpi\_split, &
1022       & err = err )
1023     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(history)) \textcolor{keywordflow}{then}
1024       hst => history
1025     \textcolor{keywordflow}{else}
1026       hst => \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
1027 \textcolor{keywordflow}{    endif}
1028 999 \textcolor{keywordflow}{continue}
1029     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, cause\_c=cause\_c)
1030     \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]{historycreate_8f90_af500a09f0e2f79576ba8618b15181607_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{historycreate_8f90_a0740ccfcac12536c8438a81c9885f6f1}\label{historycreate_8f90_a0740ccfcac12536c8438a81c9885f6f1}} 
\index{historycreate.\+f90@{historycreate.\+f90}!historycreate3@{historycreate3}}
\index{historycreate3@{historycreate3}!historycreate.\+f90@{historycreate.\+f90}}
\subsubsection{\texorpdfstring{historycreate3()}{historycreate3()}}
{\footnotesize\ttfamily subroutine historycreate3 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{file,  }\item[{character($\ast$), intent(in)}]{title,  }\item[{character($\ast$), intent(in)}]{source,  }\item[{character($\ast$), intent(in)}]{institution,  }\item[{type(gt\+\_\+history\+\_\+axis), dimension(\+:), intent(in)}]{axes,  }\item[{real, intent(in), optional}]{origin,  }\item[{real, intent(in), optional}]{interval,  }\item[{type(gt\+\_\+history), intent(out), optional, target}]{history,  }\item[{real(dp), intent(in), optional}]{origind,  }\item[{real(dp), intent(in), optional}]{intervald,  }\item[{character($\ast$), intent(in), optional}]{conventions,  }\item[{character($\ast$), intent(in), optional}]{gt\+\_\+version,  }\item[{logical, intent(in), optional}]{overwrite,  }\item[{logical, intent(in), optional}]{quiet,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+gather,  }\item[{logical, intent(in), optional}]{flag\+\_\+mpi\+\_\+split,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 1036 of file historycreate.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.


\begin{DoxyCode}
1036     \textcolor{comment}{!}
1037     \textcolor{comment}{!== gtool4 データ出力用初期設定}
1038     \textcolor{comment}{!}
1039     \textcolor{comment}{! *HistoryCreate* というサブルーチン名は 2 つの別々の}
1040     \textcolor{comment}{! サブルーチンの総称名です。まずは HistoryCreate を参照ください。}
1041     \textcolor{comment}{!}
1042     \textcolor{comment}{! もう 1 つのサブルーチンと異なる点は、座標軸の情報を}
1043     \textcolor{comment}{! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes* といった}
1044     \textcolor{comment}{! 個別の引数で与えるのではなく、構造体 GT\_HISTORY\_AXIS 型の}
1045     \textcolor{comment}{! 引数 *axes* で与える点にあります。}
1046     \textcolor{comment}{!}
1047     \textcolor{comment}{! GT\_HISTORY\_AXIS 型変数の生成 (constructer) は}
1048     \textcolor{comment}{! HistoryAxisCreate にて行います。}
1049     \textcolor{comment}{!}
1050     \textcolor{comment}{!}
1051     \textcolor{comment}{! Two specific subroutines shares common part:}
1052     \textcolor{comment}{!}
1053     \textcolor{comment}{! Both two ones initializes a dataset *file*.}
1054     \textcolor{comment}{! The result of type GT\_HISTORY will be returned by *history*}
1055     \textcolor{comment}{! or managed internally if omitted.}
1056     \textcolor{comment}{! Mandatory global attributes are defined by arguments}
1057     \textcolor{comment}{! *title*, *source*, and *institution*;}
1058     \textcolor{comment}{! they are all declared as ((character(len = *))).}
1059     \textcolor{comment}{! Spatial axis definitions have two different forms:}
1060     \textcolor{comment}{! a primitive one uses several arrays of various types:}
1061     \textcolor{comment}{! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.}
1062     \textcolor{comment}{! Another sophisticated one has only array of type GT\_HISTORY\_AXIS,}
1063     \textcolor{comment}{! *axes*.}
1064     \textcolor{comment}{! Temporal definition is done without *origin*, *interval*.}
1065     \textcolor{comment}{!}
1066     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
1067     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
1068     \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}
1069     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}
1070     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__types}{gtool\_history\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}, 
      \hyperlink{structgtool__history__types_1_1gt__history__axis}{gt\_history\_axis}, \hyperlink{structgtool__history__types_1_1gt__history__varinfo}{gt\_history\_varinfo}, 
      \hyperlink{structgtool__history__types_1_1gt__history__attr}{gt\_history\_attr}
1071     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}, 
      \hyperlink{interfacegtool__history__internal_1_1copy__attrs}{copy\_attrs}, \hyperlink{interfacegtool__history__internal_1_1append__attrs}{append\_attrs}
1072     \textcolor{keywordtype}{implicit none}
1073     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: file
1074                               \textcolor{comment}{! HistoryCreate 参照}
1075                               \textcolor{comment}{! (以下 axes を除く引数も同様)}
1076                               \textcolor{comment}{!}
1077     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: title, source, institution
1078     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history__axis}{gt\_history\_axis}), \textcolor{keywordtype}{intent(in)}:: axes(:)
1079                               \textcolor{comment}{! 次元情報を格納した構造型変数}
1080                               \textcolor{comment}{!}
1081                               \textcolor{comment}{! GT\_HISTORY\_AXIS 型変数の生成}
1082                               \textcolor{comment}{! (constructer) は}
1083                               \textcolor{comment}{! HistoryAxisCreate にて行いま}
1084                               \textcolor{comment}{! す。配列の大きさに制限は}
1085                               \textcolor{comment}{! ありません。}
1086                               \textcolor{comment}{!}
1087     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin, interval
1088     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: history
1089     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origind, intervald
1090     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{optional}:: conventions, gt\_version
1091     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: overwrite
1092     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: quiet
1093                               \textcolor{comment}{! .true. を与えた場合, }
1094                               \textcolor{comment}{! メッセージ出力が抑制されます. }
1095                               \textcolor{comment}{! デフォルトは .false. です. }
1096                               \textcolor{comment}{!}
1097                               \textcolor{comment}{! If ".true." is given, }
1098                               \textcolor{comment}{! messages are suppressed. }
1099                               \textcolor{comment}{! Default value is ".false.".}
1100                               \textcolor{comment}{! }
1101     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_gather
1102                               \textcolor{comment}{! MPI 使用時に, 各ノードで HistoryPut}
1103                               \textcolor{comment}{! に与えたデータを一つのファイルに統合して出力}
1104                               \textcolor{comment}{! する場合には .true. を与えてください. }
1105                               \textcolor{comment}{! デフォルトは .false. です. }
1106                               \textcolor{comment}{! }
1107                               \textcolor{comment}{! .true. を与えた場合, HistoryPutAxisMPI}
1108                               \textcolor{comment}{! に全体の軸データを与えてください. }
1109                               \textcolor{comment}{!}
1110                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
1111                               \textcolor{comment}{! data given to "HistoryPut" on each node}
1112                               \textcolor{comment}{! is integrated and output to one file. }
1113                               \textcolor{comment}{! Default value is ".false.".}
1114                               \textcolor{comment}{! }
1115                               \textcolor{comment}{! If .true. is given, give data of axes in}
1116                               \textcolor{comment}{! whole area to "HistoryPutAxisMPI"}
1117                               \textcolor{comment}{! }
1118     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: flag\_mpi\_split
1119                               \textcolor{comment}{! MPI 使用時にこの引数に .true. を与えると, }
1120                               \textcolor{comment}{! 各ノードごとに}
1121                               \textcolor{comment}{! *file* 引数に "\_rankXXXXXX" }
1122                               \textcolor{comment}{! (X は [0-9] の数値で, ノード番号を指す) }
1123                               \textcolor{comment}{! を付加したファイルを出力します. }
1124                               \textcolor{comment}{! 例えば, *file* に "output.nc" を与えた場合. }
1125                               \textcolor{comment}{! ノード 0 では "output\_rank000000.nc", }
1126                               \textcolor{comment}{! ノード 12 では "output\_rank000012.nc"}
1127                               \textcolor{comment}{! を出力します. }
1128                               \textcolor{comment}{! デフォルトは .false. です. }
1129                               \textcolor{comment}{!}
1130                               \textcolor{comment}{! When MPI is used, if ".true." is given, }
1131                               \textcolor{comment}{! files that have names with suffixes}
1132                               \textcolor{comment}{! "\_rankXXXXXX" }
1133                               \textcolor{comment}{! (X is [0-9] that indicates node number) }
1134                               \textcolor{comment}{! are output on each node. }
1135                               \textcolor{comment}{! For example, "output.nc" is given to *file*, }
1136                               \textcolor{comment}{! "output\_rank000000.nc", "output\_rank000012.nc"}
1137                               \textcolor{comment}{! are output on node 0 and node 12. }
1138                               \textcolor{comment}{! Default value is ".false.".}
1139                               \textcolor{comment}{! }
1140     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
1141                               \textcolor{comment}{! 例外処理用フラグ.}
1142                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
1143                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
1144                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
1145                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
1146                               \textcolor{comment}{! *err* に .true. が代入されます.}
1147                               \textcolor{comment}{!}
1148                               \textcolor{comment}{! Exception handling flag. }
1149                               \textcolor{comment}{! By default, when error occur in }
1150                               \textcolor{comment}{! this procedure, the program aborts. }
1151                               \textcolor{comment}{! If this *err* argument is given, }
1152                               \textcolor{comment}{! .true. is substituted to *err* and }
1153                               \textcolor{comment}{! the program does not abort. }
1154     \textcolor{comment}{! 構造体 GT\_HISTORY\_AXIS のデータ蓄積用}
1155     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}:: axes\_name(:)
1156     \textcolor{keywordtype}{integer}          , \textcolor{keywordtype}{allocatable}:: axes\_length(:)
1157     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}:: axes\_longname(:)
1158     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}:: axes\_units(:)
1159     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}:: axes\_xtype(:)
1160     \textcolor{keywordtype}{integer}:: i, ndims
1161     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryCreate3"}
1162   \textcolor{keywordflow}{continue}
1163     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'file=%c ndims=%d'}, &
1164       & c1=trim(file), i=(/\textcolor{keyword}{size}(axes)/) )
1165     \textcolor{comment}{! 構造体 GT\_HISTORY\_AXIS の axes からのデータ取得}
1166     \textcolor{comment}{!   (Fujitsu Fortran などなら axes(:)%name という表記で配列}
1167     \textcolor{comment}{!    データをそのまま引き渡せるが、Intel Fortran 8 などだと}
1168     \textcolor{comment}{!    その表記をまともに解釈してくれないので、美しくないけど}
1169     \textcolor{comment}{!    いったん他の配列に情報を引き渡す)。2004/11/27 morikawa}
1170     ndims = \textcolor{keyword}{size}( axes(:) )
1171     \textcolor{keyword}{allocate}( axes\_name(ndims) )
1172     \textcolor{keyword}{allocate}( axes\_length(ndims) )
1173     \textcolor{keyword}{allocate}( axes\_longname(ndims) )
1174     \textcolor{keyword}{allocate}( axes\_units(ndims) )
1175     \textcolor{keyword}{allocate}( axes\_xtype(ndims) )
1176     \textcolor{keywordflow}{do} i = 1, ndims
1177       axes\_name(i)     = axes(i) % name
1178       axes\_length(i)   = axes(i) % length
1179       axes\_longname(i) = axes(i) % longname
1180       axes\_units(i)    = axes(i) % units
1181       axes\_xtype(i)    = axes(i) % xtype
1182       \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'axes(%d):name=<%c>, length=<%d>, '} // & 
1183         &             \textcolor{stringliteral}{'longname=<%c>, units=<%c>'}     , &
1184         &              i=(/i, axes(i) % length/)        , &
1185         &              c1=( trim(axes(i) % name) )      , &
1186         &              c2=( trim(axes(i) % longname) )  , &
1187         &              c3=( trim(axes(i) % units) )    )
1188 \textcolor{keywordflow}{    enddo}
1189     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}(file, title, source, institution, &
1190       & dims = axes\_name(:), dimsizes = axes\_length(:), &
1191       & longnames = axes\_longname(:), \hyperlink{structdc__units_1_1units}{units} = axes\_units(:), &
1192       & xtypes = axes\_xtype(:), &
1193       & origin = origin, interval = interval, &
1194       & history = history, &
1195       & origind = origind, intervald = intervald, &
1196       & conventions = conventions, &
1197       & gt\_version = gt\_version, overwrite = overwrite, quiet = quiet, &
1198       & flag\_mpi\_gather = flag\_mpi\_gather, &
1199       & flag\_mpi\_split = flag\_mpi\_split, &
1200       & err = err )
1201     \textcolor{keyword}{deallocate}( axes\_name )
1202     \textcolor{keyword}{deallocate}( axes\_length )
1203     \textcolor{keyword}{deallocate}( axes\_longname )
1204     \textcolor{keyword}{deallocate}( axes\_units )
1205     \textcolor{keyword}{deallocate}( axes\_xtype )
1206     \textcolor{keywordflow}{do} i = 1, ndims
1207       \textcolor{keywordflow}{if} ( .not. \textcolor{keyword}{associated}( axes(i) % attrs ) ) cycle
1208       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__internal_1_1append__attrs}{append\_attrs}( axes(i) % name, axes(i) % attrs, history )
1209 \textcolor{keywordflow}{    end do}
1210     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(subname)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{historycreate_8f90_a0740ccfcac12536c8438a81c9885f6f1_cgraph}
\end{center}
\end{figure}
