1 | \documentclass[../main/NEMO_manual]{subfiles} |
---|
2 | |
---|
3 | \begin{document} |
---|
4 | |
---|
5 | \chapter{Miscellaneous Topics} |
---|
6 | \label{chap:MISC} |
---|
7 | |
---|
8 | \thispagestyle{plain} |
---|
9 | |
---|
10 | \chaptertoc |
---|
11 | |
---|
12 | \paragraph{Changes record} ~\\ |
---|
13 | |
---|
14 | {\footnotesize |
---|
15 | \begin{tabularx}{\textwidth}{l||X|X} |
---|
16 | Release & Author(s) & Modifications \\ |
---|
17 | \hline |
---|
18 | {\em 4.0} & {\em ...} & {\em ...} \\ |
---|
19 | {\em 3.6} & {\em ...} & {\em ...} \\ |
---|
20 | {\em 3.4} & {\em ...} & {\em ...} \\ |
---|
21 | {\em <=3.4} & {\em ...} & {\em ...} |
---|
22 | \end{tabularx} |
---|
23 | } |
---|
24 | |
---|
25 | \clearpage |
---|
26 | |
---|
27 | %% ================================================================================================= |
---|
28 | \section{Representation of unresolved straits} |
---|
29 | \label{sec:MISC_strait} |
---|
30 | |
---|
31 | In climate modeling, it often occurs that a crucial connections between water masses is broken as |
---|
32 | the grid mesh is too coarse to resolve narrow straits. |
---|
33 | For example, coarse grid spacing typically closes off the Mediterranean from the Atlantic at |
---|
34 | the Strait of Gibraltar. |
---|
35 | In this case, it is important for climate models to include the effects of salty water entering the Atlantic from |
---|
36 | the Mediterranean. |
---|
37 | Likewise, it is important for the Mediterranean to replenish its supply of water from the Atlantic to |
---|
38 | balance the net evaporation occurring over the Mediterranean region. |
---|
39 | This problem occurs even in eddy permitting simulations. |
---|
40 | For example, in ORCA 1/4\deg\ several straits of the Indonesian archipelago (Ombai, Lombok...) |
---|
41 | are much narrow than even a single ocean grid-point. |
---|
42 | |
---|
43 | We describe briefly here the two methods that can be used in \NEMO\ to handle such |
---|
44 | improperly resolved straits. The methods consist of opening the strait while ensuring |
---|
45 | that the mass exchanges through the strait are not too large by either artificially |
---|
46 | reducing the cross-sectional area of the strait grid-cells or, locally increasing the |
---|
47 | lateral friction. |
---|
48 | |
---|
49 | %% ================================================================================================= |
---|
50 | \subsection{Hand made geometry changes} |
---|
51 | \label{subsec:MISC_strait_hand} |
---|
52 | |
---|
53 | The first method involves reducing the scale factor in the cross-strait direction to a |
---|
54 | value in better agreement with the true mean width of the strait |
---|
55 | (\autoref{fig:MISC_strait_hand}). This technique is sometime called "partially open face" |
---|
56 | or "partially closed cells". The key issue here is only to reduce the faces of $T$-cell |
---|
57 | (\ie\ change the value of the horizontal scale factors at $u$- or $v$-point) but not the |
---|
58 | volume of the $T$-cell. Indeed, reducing the volume of strait $T$-cell can easily produce |
---|
59 | a numerical instability at that grid point which would require a reduction of the model |
---|
60 | time step. Thus to instigate a local change in the width of a Strait requires two steps: |
---|
61 | |
---|
62 | \begin{itemize} |
---|
63 | |
---|
64 | \item Add \texttt{e1e2u} and \texttt{e1e2v} arrays to the \np{cn_domcfg}{cn\_domcfg} file. These 2D |
---|
65 | arrays should contain the products of the unaltered values of: $\texttt{e1u}*\texttt{e2u}$ |
---|
66 | and $\texttt{e1u}*\texttt{e2v}$ respectively. That is the original surface areas of $u$- |
---|
67 | and $v$- cells respectively. These areas are usually defined by the corresponding product |
---|
68 | within the \NEMO\ code but the presence of \texttt{e1e2u} and \texttt{e1e2v} in the |
---|
69 | \np{cn_domcfg}{cn\_domcfg} file will suppress this calculation and use the supplied fields instead. |
---|
70 | If the model domain is provided by user-supplied code in \mdl{usrdef\_hgr}, then this |
---|
71 | routine should also return \texttt{e1e2u} and \texttt{e1e2v} and set the integer return |
---|
72 | argument \texttt{ie1e2u\_v} to a non-zero value. Values other than 0 for this argument |
---|
73 | will suppress the calculation of the areas. |
---|
74 | |
---|
75 | \item Change values of \texttt{e2u} or \texttt{e1v} (either in the \np{cn_domcfg}{cn\_domcfg} file or |
---|
76 | via code in \mdl{usrdef\_hgr}), whereever a Strait reduction is required. The choice of |
---|
77 | whether to alter \texttt{e2u} or \texttt{e1v} depends. respectively, on whether the |
---|
78 | Strait in question is North-South orientated (\eg\ Gibraltar) or East-West orientated (\eg |
---|
79 | Lombok). |
---|
80 | |
---|
81 | \end{itemize} |
---|
82 | |
---|
83 | The second method is to increase the viscous boundary layer thickness by a local increase |
---|
84 | of the fmask value at the coast. This method can also be effective in wider passages. The |
---|
85 | concept is illustarted in the second part of \autoref{fig:MISC_strait_hand} and changes |
---|
86 | to specific locations can be coded in \mdl{usrdef\_fmask}. The \forcode{usr_def_fmask} |
---|
87 | routine is always called after \texttt{fmask} has been defined according to the choice of |
---|
88 | lateral boundary condition as discussed in \autoref{sec:LBC_coast}. The default version of |
---|
89 | \mdl{usrdef\_fmask} contains settings specific to ORCA2 and ORCA1 configurations. These are |
---|
90 | meant as examples only; it is up to the user to verify settings and provide alternatives |
---|
91 | for their own configurations. The default \forcode{usr_def_fmask} makes no changes to |
---|
92 | \texttt{fmask} for any other configuration. |
---|
93 | |
---|
94 | \begin{figure}[!tbp] |
---|
95 | \centering |
---|
96 | \includegraphics[width=0.66\textwidth]{MISC_Gibraltar} |
---|
97 | \includegraphics[width=0.66\textwidth]{MISC_Gibraltar2} |
---|
98 | \caption[Two methods to defined the Gibraltar strait]{ |
---|
99 | Example of the Gibraltar strait defined in a 1\deg\ $\times$ 1\deg\ mesh. |
---|
100 | \textit{Top}: using partially open cells. |
---|
101 | The meridional scale factor at $v$-point is reduced on both sides of the strait to |
---|
102 | account for the real width of the strait (about 20 km). |
---|
103 | Note that the scale factors of the strait $T$-point remains unchanged. |
---|
104 | \textit{Bottom}: using viscous boundary layers. |
---|
105 | The four fmask parameters along the strait coastlines are set to a value larger than 4, |
---|
106 | \ie\ "strong" no-slip case (see \autoref{fig:LBC_shlat}) creating a large viscous boundary layer |
---|
107 | that allows a reduced transport through the strait.} |
---|
108 | \label{fig:MISC_strait_hand} |
---|
109 | \end{figure} |
---|
110 | |
---|
111 | \begin{figure}[!tbp] |
---|
112 | \centering |
---|
113 | \includegraphics[width=0.66\textwidth]{MISC_closea_mask_example} |
---|
114 | \caption[Mask fields for the \protect\mdl{closea} module]{ |
---|
115 | Example of mask fields for the \protect\mdl{closea} module. |
---|
116 | \textit{Left}: a closea\_mask field; |
---|
117 | \textit{Right}: a closea\_mask\_rnf field. |
---|
118 | In this example, if \protect\np{ln_closea}{ln\_closea} is set to \forcode{.true.}, |
---|
119 | the mean freshwater flux over each of the American Great Lakes will be set to zero, |
---|
120 | and the total residual for all the lakes, if negative, will be put into |
---|
121 | the St Laurence Seaway in the area shown.} |
---|
122 | \label{fig:MISC_closea_mask_example} |
---|
123 | \end{figure} |
---|
124 | |
---|
125 | %% ================================================================================================= |
---|
126 | \section[Closed seas (\textit{closea.F90})]{Closed seas (\protect\mdl{closea})} |
---|
127 | \label{sec:MISC_closea} |
---|
128 | |
---|
129 | Some configurations include inland seas and lakes as ocean |
---|
130 | points. This is particularly the case for configurations that are |
---|
131 | coupled to an atmosphere model where one might want to include inland |
---|
132 | seas and lakes as ocean model points in order to provide a better |
---|
133 | bottom boundary condition for the atmosphere. However there is no |
---|
134 | route for freshwater to run off from the lakes to the ocean and this |
---|
135 | can lead to large drifts in the sea surface height over the lakes. The |
---|
136 | closea module provides options to either fill in closed seas and lakes |
---|
137 | at run time, or to set the net surface freshwater flux for each lake |
---|
138 | to zero and put the residual flux into the ocean. |
---|
139 | |
---|
140 | Prior to \NEMO\ 4 the locations of inland seas and lakes was set via |
---|
141 | hardcoded indices for various ORCA configurations. From \NEMO\ 4 onwards |
---|
142 | the inland seas and lakes are defined using mask fields in the |
---|
143 | domain configuration file. The options are as follows. |
---|
144 | |
---|
145 | \begin{enumerate} |
---|
146 | \item {{\bfseries No ``closea\_mask'' field is included in domain configuration |
---|
147 | file.} In this case the closea module does nothing.} |
---|
148 | |
---|
149 | \item {{\bfseries A field called closea\_mask is included in the domain |
---|
150 | configuration file and ln\_closea=.false. in namelist namcfg.} In this |
---|
151 | case the inland seas defined by the closea\_mask field are filled in |
---|
152 | (turned to land points) at run time. That is every point in |
---|
153 | closea\_mask that is nonzero is set to be a land point.} |
---|
154 | |
---|
155 | \item {{\bfseries A field called closea\_mask is included in the domain |
---|
156 | configuration file and ln\_closea=.true. in namelist namcfg.} Each |
---|
157 | inland sea or group of inland seas is set to a positive integer value |
---|
158 | in the closea\_mask field (see \autoref{fig:MISC_closea_mask_example} |
---|
159 | for an example). The net surface flux over each inland sea or group of |
---|
160 | inland seas is set to zero each timestep and the residual flux is |
---|
161 | distributed over the global ocean (ie. all ocean points where |
---|
162 | closea\_mask is zero).} |
---|
163 | |
---|
164 | \item {{\bfseries Fields called closea\_mask and closea\_mask\_rnf are |
---|
165 | included in the domain configuration file and ln\_closea=.true. in |
---|
166 | namelist namcfg.} This option works as for option 3, except that if |
---|
167 | the net surface flux over an inland sea is negative (net |
---|
168 | precipitation) it is put into the ocean at specified runoff points. A |
---|
169 | net positive surface flux (net evaporation) is still spread over the |
---|
170 | global ocean. The mapping from inland seas to runoff points is defined |
---|
171 | by the closea\_mask\_rnf field. Each mapping is defined by a positive |
---|
172 | integer value for the inland sea(s) and the corresponding runoff |
---|
173 | points. An example is given in |
---|
174 | \autoref{fig:MISC_closea_mask_example}. If no mapping is provided for a |
---|
175 | particular inland sea then the residual is spread over the global |
---|
176 | ocean.} |
---|
177 | |
---|
178 | \item {{\bfseries Fields called closea\_mask and closea\_mask\_emp are |
---|
179 | included in the domain configuration file and ln\_closea=.true. in |
---|
180 | namelist namcfg.} This option works the same as option 4 except that |
---|
181 | the nonzero net surface flux is sent to the ocean at the specified |
---|
182 | runoff points regardless of whether it is positive or negative. The |
---|
183 | mapping from inland seas to runoff points in this case is defined by |
---|
184 | the closea\_mask\_emp field.} |
---|
185 | \end{enumerate} |
---|
186 | |
---|
187 | There is a python routine to create the closea\_mask fields and append |
---|
188 | them to the domain configuration file in the utils/tools/DOMAINcfg directory. |
---|
189 | |
---|
190 | %% ================================================================================================= |
---|
191 | \section{Sub-domain functionality} |
---|
192 | \label{sec:MISC_zoom} |
---|
193 | |
---|
194 | %% ================================================================================================= |
---|
195 | \subsection{Simple subsetting of input files via NetCDF attributes} |
---|
196 | |
---|
197 | The extended grids for use with the under-shelf ice cavities will result in redundant rows |
---|
198 | around Antarctica if the ice cavities are not active. A simple mechanism for subsetting |
---|
199 | input files associated with the extended domains has been implemented to avoid the need to |
---|
200 | maintain different sets of input fields for use with or without active ice cavities. This |
---|
201 | subsetting operates for the j-direction only and works by optionally looking for and using |
---|
202 | a global file attribute (named: \np{open_ocean_jstart}{open\_ocean\_jstart}) to determine the starting j-row |
---|
203 | for input. The use of this option is best explained with an example: |
---|
204 | \medskip |
---|
205 | |
---|
206 | \noindent Consider an ORCA1 |
---|
207 | configuration using the extended grid domain configuration file: \ifile{eORCA1\_domcfg.nc} |
---|
208 | This file define a horizontal domain of 362x332. The first row with |
---|
209 | open ocean wet points in the non-isf bathymetry for this set is row 42 (\fortran\ indexing) |
---|
210 | then the formally correct setting for \np{open_ocean_jstart}{open\_ocean\_jstart} is 41. Using this value as |
---|
211 | the first row to be read will result in a 362x292 domain which is the same size as the |
---|
212 | original ORCA1 domain. Thus the extended domain configuration file can be used with all |
---|
213 | the original input files for ORCA1 if the ice cavities are not active (\np{ln\_isfcav = |
---|
214 | .false.}). Full instructions for achieving this are: |
---|
215 | |
---|
216 | \begin{itemize} |
---|
217 | \item Add the new attribute to any input files requiring a j-row offset, i.e: |
---|
218 | \begin{cmds} |
---|
219 | ncatted -a open_ocean_jstart,global,a,d,41 eORCA1_domcfg.nc |
---|
220 | \end{cmds} |
---|
221 | |
---|
222 | \item Add the logical switch \np{ln_use_jattr}{ln\_use\_jattr} to \nam{cfg}{cfg} in the configuration |
---|
223 | namelist (if it is not already there) and set \forcode{.true.} |
---|
224 | \end{itemize} |
---|
225 | |
---|
226 | \noindent Note that with this option, the j-size of the global domain is (extended |
---|
227 | j-size minus \np{open_ocean_jstart}{open\_ocean\_jstart} + 1 ) and this must match the \texttt{jpjglo} value |
---|
228 | for the configuration. This means an alternative version of \ifile{eORCA1\_domcfg.nc} must |
---|
229 | be created for when \np{ln_use_jattr}{ln\_use\_jattr} is active. The \texttt{ncap2} tool provides a |
---|
230 | convenient way of achieving this: |
---|
231 | |
---|
232 | \begin{cmds} |
---|
233 | ncap2 -s 'jpjglo=292' eORCA1_domcfg.nc nORCA1_domcfg.nc |
---|
234 | \end{cmds} |
---|
235 | |
---|
236 | The domain configuration file is unique in this respect since it also contains the value of \jp{jpjglo} |
---|
237 | that is read and used by the model. |
---|
238 | Any other global, 2D and 3D, netcdf, input field can be prepared for use in a reduced domain by adding the |
---|
239 | \texttt{open\_ocean\_jstart} attribute to the file's global attributes. |
---|
240 | In particular this is true for any field that is read by \NEMO\ using the following optional argument to |
---|
241 | the appropriate call to \np{iom_get}{iom\_get}. |
---|
242 | |
---|
243 | \begin{forlines} |
---|
244 | lrowattr=ln_use_jattr |
---|
245 | \end{forlines} |
---|
246 | |
---|
247 | Currently, only the domain configuration variables make use of this optional argument so |
---|
248 | this facility is of little practical use except for tests where no other external input |
---|
249 | files are needed or you wish to use an extended domain configuration with inputs from |
---|
250 | earlier, non-extended configurations. Alternatively, it should be possible to exclude |
---|
251 | empty rows for extended domain, forced ocean runs using interpolation on the fly, by |
---|
252 | adding the optional argument to \texttt{iom\_get} calls for the weights and initial |
---|
253 | conditions. Experimenting with this remains an exercise for the user. |
---|
254 | |
---|
255 | %% ================================================================================================= |
---|
256 | \section[Accuracy and reproducibility (\textit{lib\_fortran.F90})]{Accuracy and reproducibility (\protect\mdl{lib\_fortran})} |
---|
257 | \label{sec:MISC_fortran} |
---|
258 | |
---|
259 | %% ================================================================================================= |
---|
260 | \subsection[Issues with intrinsinc SIGN function (\texttt{\textbf{key\_nosignedzero}})]{Issues with intrinsinc SIGN function (\protect\key{nosignedzero})} |
---|
261 | \label{subsec:MISC_sign} |
---|
262 | |
---|
263 | The SIGN(A, B) is the \fortran\ intrinsic function delivers the magnitude of A with the sign of B. |
---|
264 | For example, SIGN(-3.0,2.0) has the value 3.0. |
---|
265 | The problematic case is when the second argument is zero, because, on platforms that support IEEE arithmetic, |
---|
266 | zero is actually a signed number. |
---|
267 | There is a positive zero and a negative zero. |
---|
268 | |
---|
269 | In \fninety, the processor was required always to deliver a positive result for SIGN(A, B) if B was zero. |
---|
270 | Nevertheless, in \fninety, the processor is allowed to do the correct thing and deliver ABS(A) when |
---|
271 | B is a positive zero and -ABS(A) when B is a negative zero. |
---|
272 | This change in the specification becomes apparent only when B is of type real, and is zero, |
---|
273 | and the processor is capable of distinguishing between positive and negative zero, |
---|
274 | and B is negative real zero. |
---|
275 | Then SIGN delivers a negative result where, under \fninety\ rules, it used to return a positive result. |
---|
276 | This change may be especially sensitive for the ice model, |
---|
277 | so we overwrite the intrinsinc function with our own function simply performing : \\ |
---|
278 | \verb? IF( B >= 0.e0 ) THEN ; SIGN(A,B) = ABS(A) ? \\ |
---|
279 | \verb? ELSE ; SIGN(A,B) =-ABS(A) ? \\ |
---|
280 | \verb? ENDIF ? \\ |
---|
281 | This feature can be found in \mdl{lib\_fortran} module and is effective when \key{nosignedzero} is defined. |
---|
282 | We use a CPP key as the overwritting of a intrinsic function can present performance issues with |
---|
283 | some computers/compilers. |
---|
284 | |
---|
285 | %% ================================================================================================= |
---|
286 | \subsection{MPP reproducibility} |
---|
287 | \label{subsec:MISC_glosum} |
---|
288 | |
---|
289 | The numerical reproducibility of simulations on distributed memory parallel computers is a critical issue. |
---|
290 | In particular, within \NEMO\ global summation of distributed arrays is most susceptible to rounding errors, |
---|
291 | and their propagation and accumulation cause uncertainty in final simulation reproducibility on |
---|
292 | different numbers of processors. |
---|
293 | To avoid so, based on \citet{he.ding_JS01} review of different technics, |
---|
294 | we use a so called self-compensated summation method. |
---|
295 | The idea is to estimate the roundoff error, store it in a buffer, and then add it back in the next addition. |
---|
296 | |
---|
297 | Suppose we need to calculate $b = a_1 + a_2 + a_3$. |
---|
298 | The following algorithm will allow to split the sum in two |
---|
299 | ($sum_1 = a_{1} + a_{2}$ and $b = sum_2 = sum_1 + a_3$) with exactly the same rounding errors as |
---|
300 | the sum performed all at once. |
---|
301 | \begin{align*} |
---|
302 | sum_1 \ \ &= a_1 + a_2 \\ |
---|
303 | error_1 &= a_2 + ( a_1 - sum_1 ) \\ |
---|
304 | sum_2 \ \ &= sum_1 + a_3 + error_1 \\ |
---|
305 | error_2 &= a_3 + error_1 + ( sum_1 - sum_2 ) \\ |
---|
306 | b \qquad \ &= sum_2 \\ |
---|
307 | \end{align*} |
---|
308 | An example of this feature can be found in \mdl{lib\_fortran} module. |
---|
309 | It is systematicallt used in glob\_sum function (summation over the entire basin excluding duplicated rows and |
---|
310 | columns due to cyclic or north fold boundary condition as well as overlap MPP areas). |
---|
311 | The self-compensated summation method should be used in all summation in i- and/or j-direction. |
---|
312 | See \mdl{closea} module for an example. |
---|
313 | Note also that this implementation may be sensitive to the optimization level. |
---|
314 | |
---|
315 | %% ================================================================================================= |
---|
316 | \subsection{MPP scalability} |
---|
317 | \label{subsec:MISC_mppsca} |
---|
318 | |
---|
319 | The default method of communicating values across the north-fold in distributed memory applications (\key{mpp\_mpi}) |
---|
320 | uses a \textsc{MPI\_ALLGATHER} function to exchange values from each processing region in |
---|
321 | the northern row with every other processing region in the northern row. |
---|
322 | This enables a global width array containing the top 4 rows to be collated on every northern row processor and then |
---|
323 | folded with a simple algorithm. |
---|
324 | Although conceptually simple, this "All to All" communication will hamper performance scalability for |
---|
325 | large numbers of northern row processors. |
---|
326 | From version 3.4 onwards an alternative method is available which only performs direct "Peer to Peer" communications |
---|
327 | between each processor and its immediate "neighbours" across the fold line. |
---|
328 | This is achieved by using the default \textsc{MPI\_ALLGATHER} method during initialisation to |
---|
329 | help identify the "active" neighbours. |
---|
330 | Stored lists of these neighbours are then used in all subsequent north-fold exchanges to |
---|
331 | restrict exchanges to those between associated regions. |
---|
332 | The collated global width array for each region is thus only partially filled but is guaranteed to |
---|
333 | be set at all the locations actually required by each individual for the fold operation. |
---|
334 | This alternative method should give identical results to the default \textsc{ALLGATHER} method and |
---|
335 | is recommended for large values of \np{jpni}{jpni}. |
---|
336 | The new method is activated by setting \np{ln_nnogather}{ln\_nnogather} to be true (\nam{mpp}{mpp}). |
---|
337 | The reproducibility of results using the two methods should be confirmed for each new, |
---|
338 | non-reference configuration. |
---|
339 | |
---|
340 | %% ================================================================================================= |
---|
341 | \section{Model optimisation, control print and benchmark} |
---|
342 | \label{sec:MISC_opt} |
---|
343 | |
---|
344 | \begin{listing} |
---|
345 | \nlst{namctl} |
---|
346 | \caption{\forcode{&namctl}} |
---|
347 | \label{lst:namctl} |
---|
348 | \end{listing} |
---|
349 | |
---|
350 | Options are defined through the \nam{ctl}{ctl} namelist variables. |
---|
351 | |
---|
352 | %% ================================================================================================= |
---|
353 | \subsection{Vector optimisation} |
---|
354 | |
---|
355 | \key{vectopt\_loop} enables the internal loops to collapse. |
---|
356 | This is very a very efficient way to increase the length of vector calculations and thus |
---|
357 | to speed up the model on vector computers. |
---|
358 | |
---|
359 | % Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade. |
---|
360 | |
---|
361 | % Add also one word on NEC specific optimisation (Novercheck option for example) |
---|
362 | |
---|
363 | %% ================================================================================================= |
---|
364 | \subsection{Status and debugging information output} |
---|
365 | |
---|
366 | |
---|
367 | NEMO can produce a range of text information output either: in the main output |
---|
368 | file (ocean.output) written by the normal reporting processor (narea == 1) or various |
---|
369 | specialist output files (e.g. layout.dat, run.stat, tracer.stat etc.). Some, for example |
---|
370 | run.stat and tracer.stat, contain globally collected values for which a single file is |
---|
371 | sufficient. Others, however, contain information that could, potentially, be different |
---|
372 | for each processing region. For computational efficiency, the default volume of text |
---|
373 | information produced is reduced to just a few files from the narea=1 processor. |
---|
374 | |
---|
375 | When more information is required for monitoring or debugging purposes, the various |
---|
376 | forms of output can be selected via the \np{sn\_cfctl} structure. As well as simple |
---|
377 | on-off switches this structure also allows selection of a range of processors for |
---|
378 | individual reporting (where appropriate) and a time-increment option to restrict |
---|
379 | globally collected values to specified time-step increments. |
---|
380 | |
---|
381 | Most options within the structure are influenced by the top-level switches shown here |
---|
382 | with their default settings: |
---|
383 | |
---|
384 | \begin{forlines} |
---|
385 | sn_cfctl%l_allon = .FALSE. ! IF T activate all options. If F deactivate all unless l_config is T |
---|
386 | sn_cfctl%l_config = .TRUE. ! IF .true. then control which reports are written with the following |
---|
387 | \end{forlines} |
---|
388 | |
---|
389 | The first switch is a convenience option which can be used to switch on and off all |
---|
390 | sub-options. However, if it is false then switching off all sub-options is only done |
---|
391 | if \forcode{sn_cfctl%l\_config} is also false. Specifically, the logic is: |
---|
392 | |
---|
393 | \begin{forlines} |
---|
394 | IF ( sn_cfctl%l_allon ) THEN |
---|
395 | set all suboptions .TRUE. |
---|
396 | and set procmin, procmax and procincr so that all regions are selected ([0,10000000,1], respectively) |
---|
397 | ELSEIF ( sn_cfctl%l_config ) THEN |
---|
398 | honour individual settings of the suboptions from the namelist |
---|
399 | ELSE |
---|
400 | set all suboptions .FALSE. |
---|
401 | ENDIF |
---|
402 | \end{forlines} |
---|
403 | |
---|
404 | Details of the suboptions follow but first an explanation of the stand-alone option: |
---|
405 | \forcode{sn_cfctl%l_glochk}. This option modifies the action of the early warning checks |
---|
406 | carried out in \texttt{stpctl.F90}. These checks detect probable numerical instabilites |
---|
407 | by searching for excessive sea surface heights or velocities and salinity values |
---|
408 | outside a sensible physical range. If breaches are detected then the default behaviour |
---|
409 | is to locate and report the local indices of the grid-point in breach. These indices |
---|
410 | are included in the error message that precedes the model shutdown. When true, |
---|
411 | \forcode{sn_cfctl%l_glochk} modifies this action by performing a global location of |
---|
412 | the various minimum and maximum values and the global indices are reported. This has |
---|
413 | some value in locating the most severe error in cases where the first detected error |
---|
414 | may not be the worst culprit. |
---|
415 | |
---|
416 | \subsubsection{Control print suboptions} |
---|
417 | |
---|
418 | The options that can be individually selected fall into three categories: |
---|
419 | |
---|
420 | \begin{enumerate} \item{Time step progress information} This category includes |
---|
421 | \texttt{run.stat} and \texttt{tracer.stat} files which record certain physical and |
---|
422 | passive tracer metrics (respectively). Typical contents of \texttt{run.stat} include |
---|
423 | global maximums of ssh, velocity; and global minimums and maximums of temperature |
---|
424 | and salinity. A netCDF version of \texttt{run.stat} (\texttt{run.stat.nc}) is also |
---|
425 | produced with the same time-series data and this can easily be expanded to include |
---|
426 | extra monitoring information. \texttt{tracer.stat} contains the volume-weighted |
---|
427 | average tracer value for each passive tracer. Collecting these metrics involves |
---|
428 | global communications and will impact on model efficiency so both these options are |
---|
429 | disabled by default by setting the respective options, \forcode{sn\_cfctl%runstat} and |
---|
430 | \forcode{sn\_cfctl%trcstat} to false. A compromise can be made by activating either or |
---|
431 | both of these options and setting the \forcode{sn\_cfctl%timincr} entry to an integer |
---|
432 | value greater than one. This increment determines the time-step frequency at which |
---|
433 | the global metrics are collected and reported. This increment also applies to the |
---|
434 | time.step file which is otherwise updated every timestep. |
---|
435 | \item{One-time configuration information/progress logs} |
---|
436 | |
---|
437 | Some run-time configuration information and limited progress information is always |
---|
438 | produced by the first ocean process. This includes the \texttt{ocean.output} file |
---|
439 | which reports on all the namelist options read by the model and remains open to catch |
---|
440 | any warning or error messages generated during execution. A \texttt{layout.dat} |
---|
441 | file is also produced which details the MPI-decomposition used by the model. The |
---|
442 | suboptions: \forcode{sn\_cfctl%oceout} and \forcode{sn\_cfctl%layout} can be used |
---|
443 | to activate the creation of these files by all ocean processes. For example, |
---|
444 | when \forcode{sn\_cfctl%oceout} is true all processors produce their own version of |
---|
445 | \texttt{ocean.output}. All files, beyond the the normal reporting processor (narea == 1), are |
---|
446 | named with a \_XXXX extension to their name, where XXXX is a 4-digit area number (with |
---|
447 | leading zeros, if required). This is useful as a debugging aid since all processes can |
---|
448 | report their local conditions. Note though that these files are buffered on most UNIX |
---|
449 | systems so bug-hunting efforts using this facility should also utilise the \fortran: |
---|
450 | |
---|
451 | \begin{forlines} |
---|
452 | CALL FLUSH(numout) |
---|
453 | \end{forlines} |
---|
454 | |
---|
455 | statement after any additional write statements to ensure that file contents reflect |
---|
456 | the last model state. Associated with the \forcode{sn\_cfctl%oceout} option is the |
---|
457 | additional \forcode{sn\_cfctl%oasout} suboption. This does not activate its own output |
---|
458 | file but rather activates the writing of addition information regarding the OASIS |
---|
459 | configuration when coupling via oasis and the sbccpl routine. This information is |
---|
460 | written to any active \texttt{ocean.output} files. |
---|
461 | \item{Control sums of trends for debugging} |
---|
462 | |
---|
463 | NEMO includes an option for debugging reproducibility differences between |
---|
464 | a MPP and mono-processor runs. This is somewhat dated and clearly only |
---|
465 | useful for this purpose when dealing with configurations that can be run |
---|
466 | on a single processor. The full details can be found in this report: \href{ |
---|
467 | http://forge.ipsl.jussieu.fr/nemo/attachment/wiki/Documentation/prtctl_NEMO_doc_v2.pdf}{The |
---|
468 | control print option in NEMO} The switches to activate production of the control sums |
---|
469 | of trends for either the physics or passive tracers are the \forcode{sn\_cfctl%prtctl} |
---|
470 | and \forcode{sn\_cfctl%prttrc} suboptions, respectively. Although, perhaps, of limited use for its |
---|
471 | original intention, the ability to produce these control sums of trends in specific |
---|
472 | areas provides another tool for diagnosing model behaviour. If only the output from a |
---|
473 | select few regions is required then additional options are available to activate options |
---|
474 | for only a simple subset of processing regions. These are: \forcode{sn\_cfctl%procmin}, |
---|
475 | \forcode{sn\_cfctl%procmax} and \forcode{sn\_cfctl%procincr} which can be used to specify |
---|
476 | the minimum and maximum active areas and the increment. The default values are set |
---|
477 | such that all regions will be active. Note this subsetting can also be used to limit |
---|
478 | which additional \texttt{ocean.output} and \texttt{layout.dat} files are produced if |
---|
479 | those suboptions are active. |
---|
480 | |
---|
481 | \end{enumerate} |
---|
482 | |
---|
483 | \begin{forlines} |
---|
484 | sn_cfctl%l_glochk = .FALSE. ! Range sanity checks are local (F) or global (T). Set T for debugging only |
---|
485 | sn_cfctl%l_allon = .FALSE. ! IF T activate all options. If F deactivate all unless l_config is T |
---|
486 | sn_cfctl%l_config = .TRUE. ! IF .true. then control which reports are written with the following |
---|
487 | sn_cfctl%l_runstat = .FALSE. ! switches and which areas produce reports with the proc integer settings. |
---|
488 | sn_cfctl%l_trcstat = .FALSE. ! The default settings for the proc integers should ensure |
---|
489 | sn_cfctl%l_oceout = .FALSE. ! that all areas report. |
---|
490 | sn_cfctl%l_layout = .FALSE. ! |
---|
491 | sn_cfctl%l_prtctl = .FALSE. ! |
---|
492 | sn_cfctl%l_prttrc = .FALSE. ! |
---|
493 | sn_cfctl%l_oasout = .FALSE. ! |
---|
494 | sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0] |
---|
495 | sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000] |
---|
496 | sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1] |
---|
497 | sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info |
---|
498 | \end{forlines} |
---|
499 | |
---|
500 | \subinc{\input{../../global/epilogue}} |
---|
501 | |
---|
502 | \end{document} |
---|