51 |
be called from any routine. The available utilities and the CALL |
be called from any routine. The available utilities and the CALL |
52 |
sequences are listed below. |
sequences are listed below. |
53 |
|
|
54 |
\noindent |
\noindent |
55 |
{\bf DIAGNOSTICS\_ADDTOLIST} |
{\bf DIAGNOSTICS\_ADDTOLIST} |
56 |
(\filelink{pkg/diagnostics/diagnostics\_addtolist.F}{pkg-diagnostics-diagnostics\_addtolist.F}): |
(\filelink{pkg/diagnostics/diagnostics\_addtolist.F}{pkg-diagnostics-diagnostics\_addtolist.F}): |
57 |
%This subroutine enables a diagnostic from the Diagnostic Menu, |
%This subroutine enables a diagnostic from the Diagnostic Menu, |
58 |
%meaning that space is allocated for the |
%meaning that space is allocated for the |
59 |
%diagnostic and the model routines will increment the diagnostic value |
%diagnostic and the model routines will increment the diagnostic value |
60 |
%during execution. |
%during execution. |
61 |
This routine is the underlying interface routine for defining a new permanent |
This routine is the underlying interface routine for defining a new permanent |
62 |
diagnostic in the main model or in a package. The calling sequence is: |
diagnostic in the main model or in a package. The calling sequence is: |
63 |
|
|
64 |
\begin{verbatim} |
\begin{verbatim} |
80 |
|
|
81 |
|
|
82 |
\noindent |
\noindent |
83 |
{\bf DIAGNOSTICS\_FILL} |
{\bf DIAGNOSTICS\_FILL} |
84 |
(\filelink{pkg/diagnostics/diagnostics\_fill.F}{pkg-diagnostics-diagnostics\_fill.F}): |
(\filelink{pkg/diagnostics/diagnostics\_fill.F}{pkg-diagnostics-diagnostics\_fill.F}): |
85 |
This is the main user interface routine to the diagnostics package. |
This is the main user interface routine to the diagnostics package. |
86 |
This routine will increment the specified |
This routine will increment the specified |
87 |
diagnostic quantity with a field sent through the argument list. |
diagnostic quantity with a field sent through the argument list. |
88 |
|
|
89 |
\begin{verbatim} |
\begin{verbatim} |
90 |
CALL DIAGNOSTICS_FILL( |
CALL DIAGNOSTICS_FILL( |
91 |
I inpFld, chardiag, |
I inpFld, diagName, |
92 |
I kLev, nLevs, bibjFlg, bi, bj, myThid ) |
I kLev, nLevs, bibjFlg, bi, bj, myThid ) |
93 |
|
|
94 |
where: |
where: |
117 |
\end{verbatim} |
\end{verbatim} |
118 |
|
|
119 |
\noindent |
\noindent |
120 |
{\bf DIAGNOSTICS\_SCALE\_FILL} |
{\bf DIAGNOSTICS\_SCALE\_FILL} |
121 |
(\filelink{pkg/diagnostics/diagnostics\_scale\_fill.F}{pkg-diagnostics-diagnostics\_scale\_fill.F}): |
(\filelink{pkg/diagnostics/diagnostics\_scale\_fill.F}{pkg-diagnostics-diagnostics\_scale\_fill.F}): |
122 |
This is a possible alternative routine to |
This is a possible alternative routine to |
123 |
DIAGNOSTICS\_FILL which performs the same functions and has an additional option |
DIAGNOSTICS\_FILL which performs the same functions and has an additional option |
125 |
|
|
126 |
\begin{verbatim} |
\begin{verbatim} |
127 |
CALL DIAGNOSTICS_SCALE_FILL( |
CALL DIAGNOSTICS_SCALE_FILL( |
128 |
I inpFld, scaleFact, power, chardiag, |
I inpFld, scaleFact, power, diagName, |
129 |
I kLev, nLevs, bibjFlg, bi, bj, myThid ) |
I kLev, nLevs, bibjFlg, bi, bj, myThid ) |
130 |
|
|
131 |
|
|
132 |
where all the arguments are the same as for DIAGNOSTICS_FILL with |
where all the arguments are the same as for DIAGNOSTICS_FILL with |
133 |
the addition of: |
the addition of: |
134 |
scaleFact = Scaling factor to apply to the input field product |
scaleFact = Scaling factor to apply to the input field product |
135 |
power = Integer power to which to raise the input field (before scaling) |
power = Integer power to which to raise the input field (before scaling) |
136 |
\end{verbatim} |
\end{verbatim} |
137 |
|
|
138 |
\noindent |
\noindent |
139 |
{\bf DIAGNOSTICS\_IS\_ON}: Function call to inquire whether a |
{\bf DIAGNOSTICS\_FRACT\_FILL} |
140 |
diagnostic is active and can be incremented. Useful when there is a |
(\filelink{pkg/diagnostics/diagnostics\_fract\_fill.F}{pkg-diagnostics-diagnostics\_fract\_fill.F}): |
141 |
computation that must be done locally before a call to |
This is a specific alternative routine to DIAGNOSTICS\_[SCALE]\_FILL |
142 |
DIAGNOSTICS\_FILL. The call sequence: |
for the case of a diagnostics which is associated to |
143 |
|
a fraction-weight factor (referred to as the diagnostics "counter mate"). |
144 |
|
This fraction-weight field is expected to vary during the simulation |
145 |
|
and is provided as argument to DIAGNOSTICS\_FRACT\_FILL |
146 |
|
in order to perform fraction-weighted time-average diagnostics. |
147 |
|
Note that the fraction-weight field has to correspond to the diagnostics |
148 |
|
counter-mate which has to be filled independently with a call to DIAGNOSTICS\_FILL. |
149 |
|
|
150 |
\begin{verbatim} |
\begin{verbatim} |
151 |
flag = DIAGNOSTICS_IS_ON( diagName, myThid ) |
CALL DIAGNOSTICS_FRACT_FILL( |
152 |
|
I inpFld, fractFld, scaleFact, power, diagName, |
153 |
|
I kLev, nLevs, bibjFlg, bi, bj, myThid ) |
154 |
|
|
155 |
where: |
|
156 |
diagName = diagnostic identificator name (8 characters long) |
where all the arguments are the same as for DIAGNOSTICS_SCALE_FILL with |
157 |
myThid = my thread Id number |
the addition of: |
158 |
|
fractFld = fraction used for weighted average diagnostics |
159 |
\end{verbatim} |
\end{verbatim} |
160 |
|
|
161 |
\noindent |
\noindent |
162 |
{\bf DIAGNOSTICS\_GET\_POINTERS} |
{\bf DIAGNOSTICS\_IS\_ON}: Function call to inquire whether a |
163 |
(\filelink{pkg/diagnostics/diagnostics\_utils.F}{pkg-diagnostics-diagnostics\_utils.F}): |
diagnostic is active and should be incremented. Useful when there is a |
164 |
This subroutine retrieves the value of a the diagnostics pointers |
computation that must be done locally before a call to |
165 |
that other routines require as input - can be useful if the diagnostics common |
DIAGNOSTICS\_FILL. The call sequence: |
|
blocks are not local to a routine. |
|
166 |
|
|
167 |
\begin{verbatim} |
\begin{verbatim} |
168 |
CALL DIAGNOSTICS_GET_POINTERS( |
flag = DIAGNOSTICS_IS_ON( diagName, myThid ) |
|
I diagName, listId, |
|
|
O ndId, ip, |
|
|
I myThid ) |
|
169 |
|
|
170 |
where: |
where: |
171 |
diagName = diagnostic identificator name (8 characters long) |
diagName = diagnostic identificator name (8 characters long) |
172 |
listId = list number that specifies the output frequency |
myThid = my thread Id number |
|
ndId = diagnostics Id number (in available diagnostics list) |
|
|
ip = diagnostics pointer to storage array |
|
|
myThid = my Thread Id number |
|
173 |
\end{verbatim} |
\end{verbatim} |
174 |
|
|
175 |
\noindent |
\noindent |
176 |
{\bf GETDIAG} |
{\bf DIAGNOSTICS\_COUNT} |
177 |
(\filelink{pkg/diagnostics/diagnostics\_utils.F}{pkg-diagnostics-diagnostics\_utils.F}): |
(\filelink{pkg/diagnostics/diagnostics\_utils.F}{pkg-diagnostics-diagnostics\_utils.F}): |
178 |
This subroutine retrieves the value of a model diagnostic. |
This subroutine increments the diagnostics counter only. |
179 |
This routine is particularly useful when called from a |
In general, the diagnostics counter is incremented at the same time as the |
180 |
user output routine, although it can be called from any routine. This |
diagnostics is filled, by calling DIAGNOSTICS\_FILL. |
181 |
routine returns the time-averaged value of the diagnostic by dividing |
However, there are few cases where the counter is not incremented |
182 |
the current accumulated diagnostic value by its corresponding counter. |
during the filling (e.g., when the filling is done level per level but |
183 |
This routine does not change the value of the diagnostic itself, that |
level 1 is skipped) and needs to be done explicitly with a call to subroutine |
184 |
is, it does not replace the diagnostic with its time-average. The |
DIAGNOSTICS\_COUNT. The call sequence is: |
|
calling sequence for this routine is givin by: |
|
185 |
|
|
186 |
\begin{verbatim} |
\begin{verbatim} |
187 |
CALL GETDIAG( |
CALL DIAGNOSTICS_COUNT( |
188 |
I levreal, undef, |
I diagName, bi, bj, myThid ) |
|
O qtmp, |
|
|
I ndId, mate, ip, im, bi, bj, myThid ) |
|
189 |
|
|
190 |
where: |
where: |
191 |
lev = Model Level at which the diagnostic is desired |
diagName = name of diagnostic to increment the counter |
192 |
undef = Fill value to be used when diagnostic is undefined |
bi = X-direction tile number, or 0 if called outside bi,bj loops |
193 |
qtmp = Time-Averaged Diagnostic Output |
bj = Y-direction tile number, or 0 if called outside bi,bj loops |
194 |
ndId = diagnostics Id number (in available diagnostics list) |
myThid = my thread Id number |
|
mate = counter diagnostic number if any ; 0 otherwise |
|
|
ip = pointer to storage array location for diag. |
|
|
im = pointer to storage array location for mate |
|
|
bi = X-direction tile number |
|
|
bj = Y-direction tile number |
|
|
myThid = my thread Id number |
|
|
\end{verbatim} |
|
|
|
|
|
\noindent |
|
|
{\bf DIAGNOSTICS\_CLRDIAG} |
|
|
(\filelink{pkg/diagnostics/diagnostics\_clear.F}{pkg-diagnostics-diagnostics\_clear.F}): |
|
|
This subroutine initializes the values of model |
|
|
diagnostics to zero, and is particularly useful when called from user |
|
|
output routines to re-initialize diagnostics during the run. |
|
|
The calling sequence is: |
|
195 |
|
|
|
\begin{verbatim} |
|
|
CALL DIAGNOSTICS_CLRDIAG ( ipt, nLev, myThid ) |
|
|
|
|
|
where: |
|
|
ipt :: diagnostic pointer to storage array |
|
|
nLev :: number of levels (in storage array) to reset |
|
|
myThid :: my Thread Id number |
|
196 |
\end{verbatim} |
\end{verbatim} |
197 |
|
|
198 |
\noindent |
%\noindent |
199 |
The diagnostics are computed at various times and places within the |
%{\bf DIAGNOSTICS\_GET\_POINTERS} |
200 |
GCM. Because MITgcm may employ a staggered grid, diagnostics may be |
%(\filelink{pkg/diagnostics/diagnostics\_utils.F}{pkg-diagnostics-diagnostics\_utils.F}): |
201 |
computed at grid box centers, corners, or edges, and at the middle or |
%This subroutine retrieves the value of a the diagnostics pointers |
202 |
edge in the vertical. Some diagnostics are scalars, while others are |
%that other routines require as input - can be useful if the diagnostics common |
203 |
components of vectors. An internal array is defined which contains |
%blocks are not local to a routine. |
204 |
information concerning various grid attributes of each diagnostic. The |
% |
205 |
GDIAG array (in common block {\tt diagnostics} in file {\tt |
%\begin{verbatim} |
206 |
DIAGNOSTICS.h}) is internally defined as a character*10 variable, and |
% CALL DIAGNOSTICS_GET_POINTERS( |
207 |
is equivalenced to a character*1 "parse" array in output in order to |
% I diagName, listId, |
208 |
extract the grid-attribute information. The GDIAG array is described |
% O ndId, ip, |
209 |
in Table \ref{tab:diagnostics:gdiag.tabl}. |
% I myThid ) |
210 |
|
% |
211 |
|
% where: |
212 |
|
% diagName = diagnostic identificator name (8 characters long) |
213 |
|
% listId = list number that specifies the output frequency |
214 |
|
% ndId = diagnostics Id number (in available diagnostics list) |
215 |
|
% ip = diagnostics pointer to storage array |
216 |
|
% myThid = my Thread Id number |
217 |
|
%\end{verbatim} |
218 |
|
% |
219 |
|
%\noindent |
220 |
|
%{\bf GETDIAG} |
221 |
|
%%(\filelink{pkg/diagnostics/diagnostics\_utils.F}{pkg-diagnostics-diagnostics\_utils.F}): |
222 |
|
%This subroutine retrieves the value of a model diagnostic. |
223 |
|
%This routine is particularly useful when called from a |
224 |
|
%user output routine, although it can be called from any routine. This |
225 |
|
%routine returns the time-averaged value of the diagnostic by dividing |
226 |
|
%the current accumulated diagnostic value by its corresponding counter. |
227 |
|
%This routine does not change the value of the diagnostic itself, that |
228 |
|
%is, it does not replace the diagnostic with its time-average. The |
229 |
|
%%calling sequence for this routine is givin by: |
230 |
|
% |
231 |
|
%\begin{verbatim} |
232 |
|
% CALL GETDIAG( |
233 |
|
% I levreal, undef, |
234 |
|
% O qtmp, |
235 |
|
% I ndId, mate, ip, im, bi, bj, myThid ) |
236 |
|
% |
237 |
|
% where: |
238 |
|
%% lev = Model Level at which the diagnostic is desired |
239 |
|
% undef = Fill value to be used when diagnostic is undefined |
240 |
|
% qtmp = Time-Averaged Diagnostic Output |
241 |
|
% ndId = diagnostics Id number (in available diagnostics list) |
242 |
|
% mate = counter diagnostic number if any ; 0 otherwise |
243 |
|
% ip = pointer to storage array location for diag. |
244 |
|
% im = pointer to storage array location for mate |
245 |
|
% bi = X-direction tile number |
246 |
|
% bj = Y-direction tile number |
247 |
|
% myThid = my thread Id number |
248 |
|
%\end{verbatim} |
249 |
|
% |
250 |
|
%\noindent |
251 |
|
%{\bf DIAGNOSTICS\_CLRDIAG} |
252 |
|
%(\filelink{pkg/diagnostics/diagnostics\_clear.F}{pkg-diagnostics-diagnostics\_clear.F}): |
253 |
|
%This subroutine initializes the values of model |
254 |
|
%diagnostics to zero, and is particularly useful when called from user |
255 |
|
%output routines to re-initialize diagnostics during the run. |
256 |
|
%The calling sequence is: |
257 |
|
% |
258 |
|
%\begin{verbatim} |
259 |
|
% CALL DIAGNOSTICS_CLRDIAG ( ipt, nLev, myThid ) |
260 |
|
% |
261 |
|
% where: |
262 |
|
% ipt :: diagnostic pointer to storage array |
263 |
|
% nLev :: number of levels (in storage array) to reset |
264 |
|
% myThid :: my Thread Id number |
265 |
|
%\end{verbatim} |
266 |
|
|
267 |
\begin{table} |
\begin{table} |
268 |
\caption{Diagnostic Parsing Array} |
\caption{Diagnostic Parsing Array} |
270 |
\begin{center} |
\begin{center} |
271 |
\begin{tabular}{ |c|c|l| } |
\begin{tabular}{ |c|c|l| } |
272 |
\hline |
\hline |
273 |
\multicolumn{3}{|c|}{\bf Diagnostic Parsing Array} \\ |
\multicolumn{3}{|c|}{\bf Diagnostic Parsing Array} \\ |
274 |
\hline |
\hline |
275 |
\hline |
\hline |
276 |
Array & Value & Description \\ |
Array & Value & Description \\ |
277 |
\hline |
\hline |
278 |
parse(1) & $\rightarrow$ S & Scalar Diagnostic \\ |
parse(1) & $\rightarrow$ S & Scalar Diagnostic \\ |
279 |
& $\rightarrow$ U & U-vector component Diagnostic \\ |
& $\rightarrow$ U & U-vector component Diagnostic \\ |
280 |
& $\rightarrow$ V & V-vector component Diagnostic \\ \hline |
& $\rightarrow$ V & V-vector component Diagnostic \\ \hline |
281 |
parse(2) & $\rightarrow$ U & C-Grid U-Point \\ |
parse(2) & $\rightarrow$ U & C-Grid U-Point \\ |
282 |
& $\rightarrow$ V & C-Grid V-Point \\ |
& $\rightarrow$ V & C-Grid V-Point \\ |
283 |
& $\rightarrow$ M & C-Grid Mass Point \\ |
& $\rightarrow$ M & C-Grid Mass Point \\ |
284 |
& $\rightarrow$ Z & C-Grid Vorticity (Corner) Point \\ \hline |
& $\rightarrow$ Z & C-Grid Vorticity (Corner) Point \\ \hline |
285 |
parse(3) & $\rightarrow$ & Used for Level Integrated output: cumulate levels \\ |
parse(3) & $\rightarrow$ & Used for Level Integrated output: cumulate levels \\ |
286 |
& $\rightarrow$ r & same but cumulate product by model level thickness \\ |
& $\rightarrow$ r & same but cumulate product by model level thickness \\ |
287 |
& $\rightarrow$ R & same but cumulate product by hFac \& level thickness \\ \hline |
& $\rightarrow$ R & same but cumulate product by hFac \& level thickness \\ \hline |
288 |
parse(4) & $\rightarrow$ P & Positive Definite Diagnostic \\ \hline |
parse(4) & $\rightarrow$ P & Positive Definite Diagnostic \\ \hline |
289 |
parse(5) & $\rightarrow$ C & with Counter array \\ |
parse(5) & $\rightarrow$ C & with Counter array \\ |
290 |
|
& $\rightarrow$ P & post-processed (not filled up) from other diags \\ |
291 |
& $\rightarrow$ D & Disabled Diagnostic for output \\ \hline |
& $\rightarrow$ D & Disabled Diagnostic for output \\ \hline |
292 |
parse(6-8)& & retired, formerly: 3-digit mate number \\ \hline |
parse(6-8)& & retired, formerly: 3-digit mate number \\ \hline |
293 |
parse(9) & $\rightarrow$ U & model-level plus 1/2 \\ |
parse(9) & $\rightarrow$ U & model-level plus 1/2 \\ |
306 |
\end{center} |
\end{center} |
307 |
\end{table} |
\end{table} |
308 |
|
|
309 |
|
\noindent |
310 |
|
The diagnostics are computed at various times and places within the |
311 |
|
GCM. Because MITgcm may employ a staggered grid, diagnostics may be |
312 |
|
computed at grid box centers, corners, or edges, and at the middle or |
313 |
|
edge in the vertical. Some diagnostics are scalars, while others are |
314 |
|
components of vectors. An internal array is defined which contains |
315 |
|
information concerning various grid attributes of each diagnostic. The |
316 |
|
GDIAG array (in common block {\tt diagnostics} in file {\tt |
317 |
|
DIAGNOSTICS.h}) is internally defined as a character*16 variable, and |
318 |
|
is equivalenced to a character*1 "parse" array in output in order to |
319 |
|
extract the grid-attribute information. The GDIAG array is described |
320 |
|
in Table \ref{tab:diagnostics:gdiag.tabl}. |
321 |
|
|
322 |
\noindent |
\noindent |
323 |
As an example, consider a diagnostic whose associated GDIAG parameter is equal |
As an example, consider a diagnostic whose associated GDIAG parameter is equal |
324 |
to ``UUR\hspace{5mm}MR''. From GDIAG we can determine that this diagnostic is a |
to ``UUR\hspace{5mm}MR''. From GDIAG we can determine that this diagnostic is a |
325 |
U-vector component located at the C-grid U-point, model mid-level (M) |
U-vector component located at the C-grid U-point, model mid-level (M) |
326 |
with Nr levels (last R). |
with Nr levels (last R). |
327 |
|
|
328 |
\noindent |
\noindent |
329 |
In this way, each Diagnostic in the model has its attributes (ie. vector or scalar, |
In this way, each Diagnostic in the model has its attributes (ie. vector or scalar, |
330 |
C-grid location, etc.) defined internally. The Output routines use this information |
C-grid location, etc.) defined internally. The Output routines use this information |
331 |
in order to determine what type of transformations need to be performed. Any |
in order to determine what type of transformations need to be performed. Any |
332 |
interpolations are done at the time of output rather than during each model step. |
interpolations are done at the time of output rather than during each model step. |
333 |
In this way the User has flexibility in determining the type of gridded data which |
In this way the User has flexibility in determining the type of gridded data which |
334 |
is output. |
is output. |
335 |
|
|
336 |
|
%\newpage |
337 |
\subsection{Usage Notes} |
\subsection{Usage Notes} |
338 |
\label{sec:diagnostics:usersguide} |
\label{sec:diagnostics:usersguide} |
339 |
|
|
340 |
|
\subsubsection{Using available diagnostics} |
341 |
\noindent |
\noindent |
342 |
To use the diagnostics package, other than enabling it in {\tt packages.conf} |
To use the diagnostics package, other than enabling it in {\tt packages.conf} |
343 |
and turning the {\tt useDiagnostics} flag in {\tt data.pkg} to .TRUE., there are two |
and turning the {\tt useDiagnostics} flag in {\tt data.pkg} to .TRUE., there are two |
344 |
further steps the user must take to enable the diagnostics package for |
further steps the user must take to enable the diagnostics package for |
345 |
output of quantities that are already defined in the GCM under an experiment's |
output of quantities that are already defined in the GCM under an experiment's |
346 |
configuration of packages. |
configuration of packages. |
347 |
A parameter file {\tt data.diagnostics} must be supplied in the run directory, |
A parameter file {\tt data.diagnostics} must be supplied in the run directory, |
348 |
and the file DIAGNOSTICS\_SIZE.h must be included in the |
and the file DIAGNOSTICS\_SIZE.h must be included in the |
349 |
code directory. The steps for defining a new (permanent or experiment-specific |
code directory. The steps for defining a new (permanent or experiment-specific |
350 |
temporary) diagnostic quantity will be outlined later. |
temporary) diagnostic quantity will be outlined later. |
351 |
|
|
352 |
\noindent The namelist in parameter file {\tt data.diagnostics} will activate |
\noindent The namelist in parameter file {\tt data.diagnostics} will activate |
353 |
a user-defined list of diagnostics quantities to be computed, |
a user-defined list of diagnostics quantities to be computed, |
354 |
specify the frequency and type of output, the number of levels, and |
specify the frequency and type of output, the number of levels, and |
355 |
the name of all the separate output files. |
the name of all the separate output files. |
356 |
A sample {\tt data.diagnostics} namelist file: |
A sample {\tt data.diagnostics} namelist file: |
357 |
|
|
358 |
\begin{verbatim} |
\begin{verbatim} |
376 |
# fileFlags(n) : specific code (8c string) for output file "n" |
# fileFlags(n) : specific code (8c string) for output file "n" |
377 |
#-------------------- |
#-------------------- |
378 |
&DIAGNOSTICS_LIST |
&DIAGNOSTICS_LIST |
379 |
fields(1:2,1) = 'UVEL ','VVEL ', |
fields(1:2,1) = 'UVEL ','VVEL ', |
380 |
levels(1:5,1) = 1.,2.,3.,4.,5., |
levels(1:5,1) = 1.,2.,3.,4.,5., |
381 |
filename(1) = 'diagout1', |
filename(1) = 'diagout1', |
382 |
frequency(1) = 86400., |
frequency(1) = 86400., |
383 |
fields(1:3,2) = 'THETA ','SALT ', |
fields(1:3,2) = 'THETA ','SALT ', |
384 |
filename(2) = 'diagout2', |
filename(2) = 'diagout2', |
385 |
fileflags(2) = ' P1 ', |
fileflags(2) = ' P1 ', |
386 |
frequency(2) = 3600., |
frequency(2) = 3600., |
387 |
& |
& |
388 |
|
|
|
#-------------------- |
|
|
# Parameter for Diagnostics of per level statistics: |
|
|
#-------------------- |
|
|
# diagSt_mnc (logical): write stat-diags to NetCDF files (default=diag_mnc) |
|
|
# diagSt_regMaskFile : file containing the region-mask to read-in |
|
|
# nSetRegMskFile : number of region-mask sets within the region-mask file |
|
|
# set_regMask(i) : region-mask set-index that identifies the region "i" |
|
|
# val_regMask(i) : region "i" identifier value in the region mask |
|
|
#--for each output-stream: |
|
|
# stat_fName(n) : prefix of the output file name (max 80c long) for outp.stream n |
|
|
# stat_freq(n):< 0 : write snap-shot output every |stat_freq| seconds |
|
|
# > 0 : write time-average output every stat_freq seconds |
|
|
# stat_phase(n) : write at time = stat_phase + multiple of |stat_freq| |
|
|
# stat_region(:,n) : list of "regions" (default: 1 region only=global) |
|
|
# stat_fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n |
|
|
# (see "available_diagnostics.log" file for the full list of diags) |
|
|
#-------------------- |
|
389 |
&DIAG_STATIS_PARMS |
&DIAG_STATIS_PARMS |
390 |
& |
& |
391 |
\end{verbatim} |
\end{verbatim} |
409 |
numperList, and diagSt\_size. |
numperList, and diagSt\_size. |
410 |
|
|
411 |
\noindent numDiags (and diagSt\_size): \\ |
\noindent numDiags (and diagSt\_size): \\ |
412 |
\noindent All GCM diagnostic quantities are stored in the single diagnostic array QDIAG |
\noindent All GCM diagnostic quantities are stored in the single diagnostic array QDIAG |
413 |
which is located in the file |
which is located in the file |
414 |
\filelink{pkg/diagnostics/DIAGNOSTICS.h}{pkg-diagnostics-DIAGNOSTICS.h} |
\filelink{pkg/diagnostics/DIAGNOSTICS.h}{pkg-diagnostics-DIAGNOSTICS.h} |
415 |
and has the form:\\ |
and has the form:\\ |
416 |
\begin{verbatim} |
\begin{verbatim} |
444 |
namelist file data.diagnostics. The parameter numperList corresponds |
namelist file data.diagnostics. The parameter numperList corresponds |
445 |
to the maximum number of diagnostics requested per output streams. |
to the maximum number of diagnostics requested per output streams. |
446 |
|
|
447 |
|
\subsubsection{Adding new diagnostics to the code} |
448 |
|
|
449 |
\noindent |
\noindent |
450 |
In order to define and include as part of the diagnostic output any |
In order to define and include as part of the diagnostic output any |
451 |
field that is desired for a particular experiment, two steps must be |
field that is desired for a particular experiment, two steps must be |
464 |
menu, the subroutine DIAGNOSTICS\_ADDTOLIST should be called during the |
menu, the subroutine DIAGNOSTICS\_ADDTOLIST should be called during the |
465 |
initialization phase of the main model or package. For the main model, |
initialization phase of the main model or package. For the main model, |
466 |
the call should be made from subroutine DIAGNOSTICS\_MAIN\_INIT, and |
the call should be made from subroutine DIAGNOSTICS\_MAIN\_INIT, and |
467 |
for a package, the call should probably be made from |
for a package, the call should probably be made from |
468 |
%somewhere in the PACKAGES\_INIT\_FIXED sequence (probably |
%somewhere in the PACKAGES\_INIT\_FIXED sequence (probably |
469 |
from inside the particular package's init\_fixed routine. |
from inside the particular package's init\_fixed routine. |
470 |
A typical code sequence to set the |
A typical code sequence to set the |
471 |
input arguments to DIAGNOSTICS\_ADDTOLIST would look like: |
input arguments to DIAGNOSTICS\_ADDTOLIST would look like: |
472 |
|
|
481 |
|
|
482 |
\noindent If the new diagnostic quantity is associated with either a |
\noindent If the new diagnostic quantity is associated with either a |
483 |
vector pair or a diagnostic counter, the diagMate argument must be |
vector pair or a diagnostic counter, the diagMate argument must be |
484 |
provided with the proper index corresponding to the ``mate''. |
provided with the proper index corresponding to the ``mate''. |
485 |
The output argument from DIAGNOSTICS\_ADDTOLIST that is called diagNum here |
The output argument from DIAGNOSTICS\_ADDTOLIST that is called diagNum here |
486 |
contains a running total of the number of diagnostics defined in the code up to |
contains a running total of the number of diagnostics defined in the code up to |
487 |
any point during the run. The sequence number for the next two |
any point during the run. The sequence number for the next two |
488 |
diagnostics defined (the two components of the vector pair, for |
diagnostics defined (the two components of the vector pair, for |