New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Chap_MISC.tex in branches/nemo_v3_3_beta/DOC/TexFiles/Chapters – NEMO

source: branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Chap_MISC.tex @ 2349

Last change on this file since 2349 was 2349, checked in by gm, 13 years ago

v3.3beta: #658 phasing of the doc - key check + many minor changes

  • Property svn:executable set to *
File size: 57.8 KB
Line 
1% ================================================================
2% Chapter Ñ Miscellaneous Topics
3% ================================================================
4\chapter{Miscellaneous Topics}
5\label{MISC}
6\minitoc
7
8\newpage
9$\ $\newline    % force a new ligne
10
11% ================================================================
12% Representation of Unresolved Straits
13% ================================================================
14\section{Representation of Unresolved Straits}
15\label{MISC_strait}
16
17In climate modeling, it often occurs that a crucial connections between water masses
18is broken as the grid mesh is too coarse to resolve narrow straits. For example, coarse
19grid spacing typically closes off the Mediterranean from the Atlantic at the Strait of
20Gibraltar. In this case, it is important for climate models to include the effects of salty
21water entering the Atlantic from the Mediterranean. Likewise, it is important for the
22Mediterranean to replenish its supply of water from the Atlantic to balance the net
23evaporation occurring over the Mediterranean region. This problem occurs even in
24eddy permitting simulations. For example, in ORCA 1/4\deg several straits of the Indonesian
25archipelago (Ombai, Lombok...) are much narrow than even a single ocean grid-point.
26
27We describe briefly here the three methods that can be used in \NEMO to handle
28such improperly resolved straits. The first two consist of opening the strait by hand
29while ensuring that the mass exchanges through the strait are not too large by
30either artificially reducing the surface of the strait grid-cells or, locally increasing
31the lateral friction. In the third one, the strait is closed but exchanges of mass,
32heat and salt across the land are allowed.
33Note that such modifications are so specific to a given configuration that no attempt
34has been made to set them in a generic way. However, examples of how
35they can be set up is given in the ORCA 2\deg and 0.5\deg configurations (search for
36\key{orca\_r2} or \key{orca\_r05} in the code).
37
38% -------------------------------------------------------------------------------------------------------------
39%       Hand made geometry changes
40% -------------------------------------------------------------------------------------------------------------
41\subsection{Hand made geometry changes}
42\label{MISC_strait_hand}
43
44$\bullet$ reduced scale factor in the cross-strait direction to a value in better agreement
45with the true mean width of the strait. (Fig.~\ref{Fig_MISC_strait_hand}).
46This technique is sometime called "partially open face" or "partially closed cells".
47The key issue here is only to reduce the faces of $T$-cell ($i.e.$ change the value
48of the horizontal scale factors at $u$- or $v$-point) but not the volume of the $T$-cell.
49Indeed, reducing the volume of strait $T$-cell can easily produce a numerical
50instability at that grid point that would require a reduction of the model time step.
51The changes associated with strait management are done in \mdl{domhgr},
52just after the definition or reading of the horizontal scale factors.
53
54$\bullet$ increase of the viscous boundary layer thickness by local increase of the
55fmask value at the coast (Fig.~\ref{Fig_MISC_strait_hand}). This is done in
56\mdl{dommsk} together with the setting of the coastal value of fmask
57(see Section \ref{LBC_coast})
58
59%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
60\begin{figure}[!tbp] \label{Fig_MISC_strait_hand}  \begin{center}
61\includegraphics[width=0.80\textwidth]{./TexFiles/Figures/Fig_Gibraltar.pdf}
62\includegraphics[width=0.80\textwidth]{./TexFiles/Figures/Fig_Gibraltar2.pdf}
63\caption {Example of the Gibraltar strait defined in a $1\deg \times 1\deg$ mesh.
64\textit{Top}: using partially open cells. The meridional scale factor at $v$-point
65is reduced on both sides of the strait to account for the real width of the strait
66(about 20 km). Note that the scale factors of the strait $T$-point remains unchanged.
67\textit{Bottom}: using viscous boundary layers. The four fmask parameters
68along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" no-slip
69case (see Fig.\ref{Fig_LBC_shlat}) creating a large viscous boundary layer
70that allows a reduced transport through the strait.}
71\end{center}   \end{figure}
72%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
73
74% -------------------------------------------------------------------------------------------------------------
75% Cross Land Advection
76% -------------------------------------------------------------------------------------------------------------
77\subsection{Cross Land Advection (\mdl{tracla})}
78\label{MISC_strait_cla}
79%--------------------------------------------namcla--------------------------------------------------------
80\namdisplay{namcla} 
81%--------------------------------------------------------------------------------------------------------------
82
83\colorbox{yellow}{Add a short description of CLA staff here or in lateral boundary condition chapter?}
84
85%The problem is resolved here by allowing the mixing of tracers and mass/volume between non-adjacent water columns at nominated regions within the model. Momentum is not mixed. The scheme conserves total tracer content, and total volume (the latter in $z*$- or $s*$-coordinate), and maintains compatibility between the tracer and mass/volume budgets. 
86
87% ================================================================
88% Closed seas
89% ================================================================
90\section{Closed seas (\mdl{closea})}
91\label{MISC_closea}
92
93\colorbox{yellow}{Add here a short description of the way closed seas are managed}
94
95
96% ================================================================
97% Sub-Domain Functionality (\textit{nizoom, njzoom}, namelist parameters)
98% ================================================================
99\section{Sub-Domain Functionality (\jp{jpizoom}, \jp{jpjzoom})}
100\label{MISC_zoom}
101
102The sub-domain functionality, also improperly called the zoom option
103(improperly because it is not associated with a change in model resolution)
104is a quite simple function that allows a simulation over a sub-domain of an
105already defined configuration ($i.e.$ without defining a new mesh, initial
106state and forcings). This option can be useful for testing the user settings
107of surface boundary conditions, or the initial ocean state of a huge ocean
108model configuration while having a small computer memory requirement.
109It can also be used to easily test specific physics in a sub-domain (for example,
110see \citep{Madec_al_JPO96} for a test of the coupling used in the global ocean
111version of OPA between sea-ice and ocean model over the Arctic or Antarctic
112ocean, using a sub-domain). In the standard model, this option does not
113include any specific treatment for the ocean boundaries of the sub-domain:
114they are considered as artificial vertical walls. Nevertheless, it is quite easy
115to add a restoring term toward a climatology in the vicinity of such boundaries
116(see \S\ref{TRA_dmp}).
117
118In order to easily define a sub-domain over which the computation can be
119performed, the dimension of all input arrays (ocean mesh, bathymetry,
120forcing, initial state, ...) are defined as \jp{jpidta}, \jp{jpjdta} and \jp{jpkdta} 
121(\mdl{par\_oce} module), while the computational domain is defined through
122\jp{jpiglo}, \jp{jpjglo} and \jp{jpk} (\mdl{par\_oce} module). When running the
123model over the whole domain, the user sets \jp{jpiglo}=\jp{jpidta} \jp{jpjglo}=\jp{jpjdta} 
124and \jp{jpk}=\jp{jpkdta}. When running the model over a sub-domain, the user
125has to provide the size of the sub-domain, (\jp{jpiglo}, \jp{jpjglo}, \jp{jpkglo}),
126and the indices of the south western corner as \jp{jpizoom} and \jp{jpjzoom} in
127the \mdl{par\_oce} module (Fig.~\ref{Fig_LBC_zoom}).
128
129Note that a third set of dimensions exist, \jp{jpi}, \jp{jpj} and \jp{jpk} which is
130actually used to perform the computation. It is set by default to \jp{jpi}=\jp{jpjglo} 
131and \jp{jpj}=\jp{jpjglo}, except for massively parallel computing where the
132computational domain is laid out on local processor memories following a 2D
133horizontal splitting. % (see {\S}IV.2-c) ref to the section to be updated
134
135%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
136\begin{figure}[!ht] \label{Fig_LBC_zoom}  \begin{center}
137\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_LBC_zoom.pdf}
138\caption {Position of a model domain compared to the data input domain when the zoom functionality is used.}
139\end{center}   \end{figure}
140%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
141
142
143% ================================================================
144% 1D model functionality
145% ================================================================
146\section{Water column model: 1D model (\key{c1d})}
147\label{MISC_1D}
148
149The 1D model option simulates a stand alone water column within the 3D \NEMO system.
150It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers
151or a biogeochemical model. It is set up by defining the \key{c1d} CPP key.
152The 1D model is a very useful tool 
153\textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes ;
154\textit{(b)} to investigate suitable parameterisations of unresolved turbulence (wind steering,
155langmuir circulation, skin layers) ;
156\textit{(c)} to compare the behaviour of different vertical mixing schemes  ;
157\textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain ;
158\textit{(d)} to produce extra diagnostics, without the large memory requirement of the full 3D model.
159
160The methodology is based on the use of the zoom functionality over the smallest possible
161domain : a 3 x 3 domain centred on the grid point of interest (see \S\ref{MISC_zoom}),
162with some extra routines. There is no need to define a new mesh, bathymetry,
163initial state or forcing, since the 1D model will use those of the configuration it is a zoom of.
164The chosen grid point is set in par\_oce.F90 module by setting the jpizoom and jpjzoom
165parameters to the indices of the location of the chosen grid point.
166
167% ================================================================
168% Accelerating the Convergence
169% ================================================================
170\section{Accelerating the Convergence (\np{nn\_acc} = 1)}
171\label{MISC_acc}
172%--------------------------------------------namdom-------------------------------------------------------
173\namdisplay{namdom} 
174%--------------------------------------------------------------------------------------------------------------
175
176Searching an equilibrium state with an global ocean model requires a very long time
177integration period (a few thousand years for a global model). Due to the size of
178the time step required for numerical stability (less than a few hours),
179this usually requires a large elapsed time. In order to overcome this problem,
180\citet{Bryan1984} introduces a technique that is intended to accelerate
181the spin up to equilibrium. It uses a larger time step in
182the tracer evolution equations than in the momentum evolution
183equations. It does not affect the equilibrium solution but modifies the
184trajectory to reach it.
185
186The acceleration of convergence option is used when \np{nn\_acc}=1. In that case,
187$\rdt=rn\_rdt$ is the time step of dynamics while $\widetilde{\rdt}=rdttra$ is the
188tracer time-step. the former is set from the \np{rn\_rdt} namelist parameter while the latter
189is computed using a hyperbolic tangent profile and the following namelist parameters :
190\np{rn\_rdtmin}, \np{rn\_rdtmax} and \np{rn\_rdth}. Those three parameters correspond
191to the surface value the deep ocean value and the depth at which the transition occurs, respectively.
192The set of prognostic equations to solve becomes:
193\begin{equation} \label{Eq_acc}
194\begin{split}
195\frac{\partial \textbf{U}_h }{\partial t} 
196   &\equiv \frac{\textbf{U}_h ^{t+1}-\textbf{U}_h^{t-1} }{2\rdt} = \ldots \\ 
197\frac{\partial T}{\partial t} &\equiv \frac{T^{t+1}-T^{t-1}}{2 \widetilde{\rdt}} = \ldots \\ 
198\frac{\partial S}{\partial t} &\equiv \frac{S^{t+1} -S^{t-1}}{2 \widetilde{\rdt}} = \ldots \\ 
199\end{split}
200\end{equation}
201
202\citet{Bryan1984} has examined the consequences of this distorted physics.
203Free waves have a slower phase speed, their meridional structure is slightly
204modified, and the growth rate of baroclinically unstable waves is reduced
205but with a wider range of instability. This technique is efficient for
206searching for an equilibrium state in coarse resolution models. However its
207application is not suitable for many oceanic problems: it cannot be used for
208transient or time evolving problems (in particular, it is very questionable
209to use this technique when there is a seasonal cycle in the forcing fields),
210and it cannot be used in high-resolution models where baroclinically
211unstable processes are important. Moreover, the vertical variation of
212$\widetilde{ \rdt}$ implies that the heat and salt contents are no longer
213conserved due to the vertical coupling of the ocean level through both
214advection and diffusion. Therefore \np{rn\_rdtmin} = \np{rn\_rdtmax} should be
215a more clever choice.
216
217% ================================================================
218% Model optimisation, Control Print and Benchmark
219% ================================================================
220\section{Model Optimisation, Control Print and Benchmark}
221\label{MISC_opt}
222%--------------------------------------------namctl-------------------------------------------------------
223\namdisplay{namctl} 
224%--------------------------------------------------------------------------------------------------------------
225
226% \gmcomment{why not make these bullets into subsections?}
227
228
229$\bullet$ Vector optimisation:
230
231\key{vectopt\_loop} enables the internal loops to collapse. This is very
232a very efficient way to increase the length of vector calculations and thus
233to speed up the model on vector computers.
234 
235% Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade.
236 
237% Add also one word on NEC specific optimisation (Novercheck option for example)
238 
239$\bullet$ Control print %: describe here 4 things:
240
2411- \np{ln\_ctl} : compute and print the trends averaged over the interior domain
242in all TRA, DYN, LDF and ZDF modules. This option is very helpful when
243diagnosing the origin of an undesired change in model results.
244
2452- also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check
246the source of differences between mono and multi processor runs.
247
2483- \key{esopa} (to be rename key\_nemo) : which is another option for model
249management. When defined, this key forces the activation of all options and
250CPP keys. For example, all tracer and momentum advection schemes are called!
251Therefore the model results have no physical meaning.
252However, this option forces both the compiler and the model to run through
253all the \textsc{Fortran} lines of the model. This allows the user to check for obvious
254compilation or execution errors with all CPP options, and errors in namelist options.
255
2564- last digit comparison (\np{nn\_bit\_cmp}). In an MPP simulation, the computation of
257a sum over the whole domain is performed as the summation over all processors of
258each of their sums over their interior domains. This double sum never gives exactly
259the same result as a single sum over the whole domain, due to truncation differences.
260The "bit comparison" option has been introduced in order to be able to check that
261mono-processor and multi-processor runs give exactly the same results.
262
263$\bullet$  Benchmark (\np{nn\_bench}). This option defines a benchmark run based on
264a GYRE configuration in which the resolution remains the same whatever the domain
265size. This allows a very large model domain to be used, just by changing the domain
266size (\jp{jpiglo}, \jp{jpjglo}) and without adjusting either the time-step or the physical
267parameterisations.
268
269
270% ================================================================
271% Elliptic solvers (SOL)
272% ================================================================
273\section{Elliptic solvers (SOL)}
274\label{MISC_sol}
275%--------------------------------------------namdom-------------------------------------------------------
276\namdisplay{namsol} 
277%--------------------------------------------------------------------------------------------------------------
278
279When the filtered sea surface height option is used, the surface pressure gradient is
280computed in \mdl{dynspg\_flt}. The force added in the momentum equation is solved implicitely.
281It is thus solution of an elliptic equation \eqref{Eq_PE_flt} for which two solvers are available:
282a Successive-Over-Relaxation scheme (SOR) and a preconditioned conjugate gradient
283scheme(PCG) \citep{Madec_al_OM88, Madec_PhD90}. The solver is selected trough the
284the value of \np{nn\_solv} (namelist parameter).
285
286The PCG is a very efficient method for solving elliptic equations on vector computers.
287It is a fast and rather easy method to use; which are attractive features for a large
288number of ocean situations (variable bottom topography, complex coastal geometry,
289variable grid spacing, islands, open or cyclic boundaries, etc ...). It does not require
290a search for an optimal parameter as in the SOR method. However, the SOR has
291been retained because it is a linear solver, which is a very useful property when
292using the adjoint model of \NEMO.
293
294At each time step, the time derivative of the sea surface height at time step $t+1$ 
295(or equivalently the divergence of the \textit{after} barotropic transport) that appears
296in the filtering forced is the solution of the elliptic equation obtained from the horizontal
297divergence of the vertical summation of \eqref{Eq_PE_flt}.
298Introducing the following coefficients:
299\begin{equation}  \label{Eq_sol_matrix}
300\begin{aligned}
301&c_{i,j}^{NS}  &&= {2 \rdt }^2 \; \frac{H_v (i,j) \; e_{1v} (i,j)}{e_{2v}(i,j)}              \\
302&c_{i,j}^{EW} &&= {2 \rdt }^2 \; \frac{H_u (i,j) \; e_{2u} (i,j)}{e_{1u}(i,j)}            \\
303&b_{i,j} &&= \delta_i \left[ e_{2u}M_u \right] - \delta_j \left[ e_{1v}M_v \right]\ ,   \\
304\end{aligned}
305\end{equation}
306the five-point finite difference equation \eqref{Eq_psi_total} can be rewritten as:
307\begin{equation}  \label{Eq_solmat}
308\begin{split}
309       c_{i+1,j}^{NS} D_{i+1,j}  + \;  c_{i,j+1}^{EW} D_{i,j+1}   
310  +   c_{i,j}    ^{NS} D_{i-1,j}   + \;  c_{i,j}    ^{EW} D_{i,j-1}                                          &    \\
311  -    \left(c_{i+1,j}^{NS} + c_{i,j+1}^{EW} + c_{i,j}^{NS} + c_{i,j}^{EW} \right)   D_{i,j}  &=  b_{i,j}
312\end{split}
313\end{equation}
314\eqref{Eq_solmat} is a linear symmetric system of equations. All the elements of
315the corresponding matrix \textbf{A} vanish except those of five diagonals. With
316the natural ordering of the grid points (i.e. from west to east and from
317south to north), the structure of \textbf{A} is block-tridiagonal with
318tridiagonal or diagonal blocks. \textbf{A} is a positive-definite symmetric
319matrix of size $(jpi \cdot jpj)^2$, and \textbf{B}, the right hand side of
320\eqref{Eq_solmat}, is a vector.
321
322Note that in the linear free surface case, the depth that appears in \eqref{Eq_sol_matrix}
323does not vary with time, and thus the matrix can be computed once for all. In non-linear free surface
324(\key{vvl} defined) the matrix have to be updated at each time step.
325
326% -------------------------------------------------------------------------------------------------------------
327%       Successive Over Relaxation
328% -------------------------------------------------------------------------------------------------------------
329\subsection{Successive Over Relaxation (\np{nn\_solv}=2, \mdl{solsor})}
330\label{MISC_solsor}
331
332Let us introduce the four cardinal coefficients:
333\begin{align*}
334a_{i,j}^S &= c_{i,j    }^{NS}/d_{i,j}     &\qquad  a_{i,j}^W &= c_{i,j}^{EW}/d_{i,j}       \\
335a_{i,j}^E &= c_{i,j+1}^{EW}/d_{i,j}    &\qquad   a_{i,j}^N &= c_{i+1,j}^{NS}/d_{i,j}   
336\end{align*}
337where $d_{i,j} = c_{i,j}^{NS}+ c_{i+1,j}^{NS} + c_{i,j}^{EW} + c_{i,j+1}^{EW}$ 
338(i.e. the diagonal of the matrix). \eqref{Eq_solmat} can be rewritten as:
339\begin{equation}  \label{Eq_solmat_p}
340\begin{split}
341a_{i,j}^{N}  D_{i+1,j} +\,a_{i,j}^{E}  D_{i,j+1} +\, a_{i,j}^{S}  D_{i-1,j} +\,a_{i,j}^{W} D_{i,j-1}  -  D_{i,j} = \tilde{b}_{i,j}
342\end{split}
343\end{equation}
344with $\tilde b_{i,j} = b_{i,j}/d_{i,j}$. \eqref{Eq_solmat_p} is the equation actually solved
345with the SOR method. This method used is an iterative one. Its algorithm can be
346summarised as follows (see \citet{Haltiner1980} for a further discussion):
347
348initialisation (evaluate a first guess from previous time step computations)
349\begin{equation}
350D_{i,j}^0 = 2 \, D_{i,j}^t - D_{i,j}^{t-1}
351\end{equation}
352iteration $n$, from $n=0$ until convergence, do :
353\begin{equation} \label{Eq_sor_algo}
354\begin{split}
355R_{i,j}^n  = &a_{i,j}^{N} D_{i+1,j}^n       +\,a_{i,j}^{E}  D_{i,j+1} ^n         
356         +\, a_{i,j}^{S}  D_{i-1,j} ^{n+1}+\,a_{i,j}^{W} D_{i,j-1} ^{n+1}
357                 -  D_{i,j}^n - \tilde{b}_{i,j}                                           \\
358D_{i,j} ^{n+1}  = &D_{i,j} ^{n}   + \omega \;R_{i,j}^n     
359\end{split}
360\end{equation}
361where \textit{$\omega $ }satisfies $1\leq \omega \leq 2$. An optimal value exists for
362\textit{$\omega$} which significantly accelerates the convergence, but it has to be
363adjusted empirically for each model domain (except for a uniform grid where an
364analytical expression for \textit{$\omega$} can be found \citep{Richtmyer1967}).
365The value of $\omega$ is set using \np{rn\_sor}, a \textbf{namelist} parameter.
366The convergence test is of the form:
367\begin{equation}
368\delta = \frac{\sum\limits_{i,j}{R_{i,j}^n}{R_{i,j}^n}}
369                    {\sum\limits_{i,j}{ \tilde{b}_{i,j}^n}{\tilde{b}_{i,j}^n}} \leq \epsilon
370\end{equation}
371where $\epsilon$ is the absolute precision that is required. It is recommended
372that a value smaller or equal to $10^{-6}$ is used for $\epsilon$ since larger
373values may lead to numerically induced basin scale barotropic oscillations.
374The precision is specified by setting \np{rn\_eps} (\textbf{namelist} parameter).
375In addition, two other tests are used to halt the iterative algorithm. They involve
376the number of iterations and the modulus of the right hand side. If the former
377exceeds a specified value, \np{nn\_max} (\textbf{namelist} parameter),
378or the latter is greater than $10^{15}$, the whole model computation is stopped
379and the last computed time step fields are saved in a abort.nc NetCDF file.
380In both cases, this usually indicates that there is something wrong in the model
381configuration (an error in the mesh, the initial state, the input forcing,
382or the magnitude of the time step or of the mixing coefficients). A typical value of
383$nn\_max$ is a few hundred when $\epsilon = 10^{-6}$, increasing to a few
384thousand when $\epsilon = 10^{-12}$.
385The vectorization of the SOR algorithm is not straightforward. The scheme
386contains two linear recurrences on $i$ and $j$. This inhibits the vectorisation.
387\eqref{Eq_sor_algo} can be been rewritten as:
388\begin{equation} 
389\begin{split}
390R_{i,j}^n
391= &a_{i,j}^{N}  D_{i+1,j}^n +\,a_{i,j}^{E}  D_{i,j+1} ^n
392 +\,a_{i,j}^{S}  D_{i-1,j} ^{n}+\,_{i,j}^{W} D_{i,j-1} ^{n} -  D_{i,j}^n - \tilde{b}_{i,j}      \\
393R_{i,j}^n = &R_{i,j}^n - \omega \;a_{i,j}^{S}\; R_{i,j-1}^n                                             \\
394R_{i,j}^n = &R_{i,j}^n - \omega \;a_{i,j}^{W}\; R_{i-1,j}^n
395\end{split}
396\end{equation}
397This technique slightly increases the number of iteration required to reach the convergence,
398but this is largely compensated by the gain obtained by the suppression of the recurrences.
399
400Another technique have been chosen, the so-called red-black SOR. It consist in solving successively
401\eqref{Eq_sor_algo} for odd and even grid points. It also slightly reduced the convergence rate
402but allows the vectorisation. In addition, and this is the reason why it has been chosen, it is able to handle the north fold boundary condition used in ORCA configuration ($i.e.$ tri-polar global ocean mesh).
403
404The SOR method is very flexible and can be used under a wide range of conditions,
405including irregular boundaries, interior boundary points, etc. Proofs of convergence, etc.
406may be found in the standard numerical methods texts for partial differential equations.
407
408% -------------------------------------------------------------------------------------------------------------
409%       Preconditioned Conjugate Gradient
410% -------------------------------------------------------------------------------------------------------------
411\subsection{Preconditioned Conjugate Gradient  (\np{nn\_solv}=1, \mdl{solpcg}) }
412\label{MISC_solpcg}
413
414\textbf{A} is a definite positive symmetric matrix, thus solving the linear
415system \eqref{Eq_solmat} is equivalent to the minimisation of a quadratic
416functional:
417\begin{equation*}
418\textbf{Ax} = \textbf{b} \leftrightarrow \textbf{x} =\text{inf}_{y} \,\phi (\textbf{y})
419\quad , \qquad
420\phi (\textbf{y}) = 1/2 \langle \textbf{Ay},\textbf{y}\rangle - \langle \textbf{b},\textbf{y} \rangle 
421\end{equation*}
422where $\langle , \rangle$ is the canonical dot product. The idea of the
423conjugate gradient method is to search for the solution in the following
424iterative way: assuming that $\textbf{x}^n$ has been obtained, $\textbf{x}^{n+1}$ 
425is found from $\textbf {x}^{n+1}={\textbf {x}}^n+\alpha^n{\textbf {d}}^n$ which satisfies:
426\begin{equation*}
427{\textbf{ x}}^{n+1}=\text{inf} _{{\textbf{ y}}={\textbf{ x}}^n+\alpha^n \,{\textbf{ d}}^n} \,\phi ({\textbf{ y}})\;\;\Leftrightarrow \;\;\frac{d\phi }{d\alpha}=0
428\end{equation*}
429and expressing $\phi (\textbf{y})$ as a function of \textit{$\alpha $}, we obtain the
430value that minimises the functional:
431\begin{equation*}
432\alpha ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle  / \langle {\textbf{ A d}^n, \textbf{d}^n} \rangle
433\end{equation*}
434where $\textbf{r}^n = \textbf{b}-\textbf{A x}^n = \textbf{A} (\textbf{x}-\textbf{x}^n)$ 
435is the error at rank $n$. The descent vector $\textbf{d}^n$ s chosen to be dependent
436on the error: $\textbf{d}^n = \textbf{r}^n + \beta^n \,\textbf{d}^{n-1}$. $\beta ^n$ 
437is searched such that the descent vectors form an orthogonal basis for the dot
438product linked to \textbf{A}. Expressing the condition
439$\langle \textbf{A d}^n, \textbf{d}^{n-1} \rangle = 0$ the value of $\beta ^n$ is found:
440 $\beta ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle  / \langle {\textbf{r}^{n-1}, \textbf{r}^{n-1}} \rangle$.
441 As a result, the errors $ \textbf{r}^n$ form an orthogonal
442base for the canonic dot product while the descent vectors $\textbf{d}^n$ form
443an orthogonal base for the dot product linked to \textbf{A}. The resulting
444algorithm is thus the following one:
445
446initialisation :
447\begin{equation*} 
448\begin{split}
449\textbf{x}^0 &= D_{i,j}^0   = 2 D_{i,j}^t - D_{i,j}^{t-1}       \quad, \text{the initial guess }     \\
450\textbf{r}^0 &= \textbf{d}^0 = \textbf{b} - \textbf{A x}^0       \\
451\gamma_0 &= \langle{ \textbf{r}^0 , \textbf{r}^0} \rangle
452\end{split}
453\end{equation*}
454
455iteration $n,$ from $n=0$ until convergence, do :
456\begin{equation} 
457\begin{split}
458\text{z}^n& = \textbf{A d}^n \\
459\alpha_n &= \gamma_n /  \langle{ \textbf{z}^n , \textbf{d}^n} \rangle \\
460\textbf{x}^{n+1} &= \textbf{x}^n + \alpha_n \,\textbf{d}^n \\
461\textbf{r}^{n+1} &= \textbf{r}^n - \alpha_n \,\textbf{z}^n \\
462\gamma_{n+1} &= \langle{ \textbf{r}^{n+1} , \textbf{r}^{n+1}} \rangle \\
463\beta_{n+1} &= \gamma_{n+1}/\gamma_{n}  \\
464\textbf{d}^{n+1} &= \textbf{r}^{n+1} + \beta_{n+1}\; \textbf{d}^{n}\\
465\end{split}
466\end{equation}
467
468
469The convergence test is:
470\begin{equation}
471\delta = \gamma_{n}\; / \langle{ \textbf{b} , \textbf{b}} \rangle \leq \epsilon
472\end{equation}
473where $\epsilon $ is the absolute precision that is required. As for the SOR algorithm,
474the whole model computation is stopped when the number of iterations, \np{nn\_max}, or
475the modulus of the right hand side of the convergence equation exceeds a
476specified value (see \S\ref{MISC_solsor} for a further discussion). The required
477precision and the maximum number of iterations allowed are specified by setting
478\np{rn\_eps} and \np{nn\_max} (\textbf{namelist} parameters).
479
480It can be demonstrated that the above algorithm is optimal, provides the exact
481solution in a number of iterations equal to the size of the matrix, and that
482the convergence rate is faster as the matrix is closer to the identity matrix,
483$i.e.$ its eigenvalues are closer to 1. Therefore, it is more efficient to solve
484a better conditioned system which has the same solution. For that purpose,
485we introduce a preconditioning matrix \textbf{Q} which is an approximation
486of \textbf{A} but much easier to invert than \textbf{A}, and solve the system:
487\begin{equation} \label{Eq_pmat}
488\textbf{Q}^{-1} \textbf{A x} = \textbf{Q}^{-1} \textbf{b}
489\end{equation}
490
491The same algorithm can be used to solve \eqref{Eq_pmat} if instead of the
492canonical dot product the following one is used:
493${\langle{ \textbf{a} , \textbf{b}} \rangle}_Q = \langle{ \textbf{a} , \textbf{Q b}} \rangle$, and
494if $\textbf{\~{b}} = \textbf{Q}^{-1}\;\textbf{b}$ and $\textbf{\~{A}} = \textbf{Q}^{-1}\;\textbf{A}$ 
495are substituted to \textbf{b} and \textbf{A} \citep{Madec_al_OM88}.
496In \NEMO, \textbf{Q} is chosen as the diagonal of \textbf{ A}, i.e. the simplest form for
497\textbf{Q} so that it can be easily inverted. In this case, the discrete formulation of
498\eqref{Eq_pmat} is in fact given by \eqref{Eq_solmat_p} and thus the matrix and
499right hand side are computed independently from the solver used.
500
501% ================================================================
502% Diagnostics
503% ================================================================
504\section{Diagnostics (DIA, IOM, TRD, FLO)}
505\label{MISC_diag}
506
507% -------------------------------------------------------------------------------------------------------------
508%       Standard Model Output
509% -------------------------------------------------------------------------------------------------------------
510\subsection{Model Output (default or \key{iomput} or \key{dimgout})}
511\label{MISC_iom}
512
513%to be updated with Seb documentation on the IO
514
515The model outputs are of three types: the restart file, the output listing,
516and the output file(s). The restart file is used internally by the code when
517the user wants to start the model with initial conditions defined by a
518previous simulation. It contains all the information that is necessary in
519order for there to be no changes in the model results (even at the computer
520precision) between a run performed with several restarts and the same run
521performed in one step. It should be noted that this requires that the restart file
522contain two consecutive time steps for all the prognostic variables, and
523that it is saved in the same binary format as the one used by the computer
524that is to read it (in particular, 32 bits binary IEEE format must not be used for
525this file). The output listing and file(s) are predefined but should be checked
526and eventually adapted to the user's needs. The output listing is stored in
527the $ocean.output$ file. The information is printed from within the code on the
528logical unit $numout$. To locate these prints, use the UNIX command
529"\textit{grep -i numout}" in the source code directory.
530
531In the standard configuration, the user will find the model results in
532NetCDF files containing mean values (or instantaneous values if
533\key{diainstant} is defined) for every time-step where output is demanded.
534These outputs are defined in the \mdl{diawri} module.
535When defining \key{dimgout}, the output are written in DIMG format,
536an IEEE output format.
537
538Since version 3.2, an I/O server has been added which provides more
539flexibility in the choice of the fields to be output as well as how the
540writing work is distributed over the processors in massively parallel
541computing. It is activated when \key{iomput} is defined.
542
543% -------------------------------------------------------------------------------------------------------------
544%       Tracer/Dynamics Trends
545% -------------------------------------------------------------------------------------------------------------
546\subsection[Tracer/Dynamics Trends (TRD)]
547                  {Tracer/Dynamics Trends (\key{trdmld}, \key{trdtra}, \key{trddyn}, \key{trdmld\_trc})}
548\label{MISC_tratrd}
549
550%------------------------------------------namtrd----------------------------------------------------
551\namdisplay{namtrd} 
552%-------------------------------------------------------------------------------------------------------------
553
554When \key{trddyn} and/or \key{trddyn} CPP variables are defined, each
555trend of the dynamics and/or temperature and salinity time evolution equations
556is stored in three-dimensional arrays just after their computation ($i.e.$ at the end
557of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). These trends are then
558used in \mdl{trdmod} (see TRD directory) every \textit{nn\_trd } time-steps.
559
560What is done depends on the CPP keys defined:
561\begin{description}
562\item[\key{trddyn}, \key{trdtra}] : a check of the basin averaged properties of the momentum
563and/or tracer equations is performed ;
564\item[\key{trdvor}] : a vertical summation of the moment tendencies is performed,
565then the curl is computed to obtain the barotropic vorticity tendencies which are output ;
566\item[\key{trdmld}] : output of the tracer tendencies averaged vertically 
567either over the mixed layer (\np{nn\_ctls}=0),
568or       over a fixed number of model levels (\np{nn\_ctls}$>$1 provides the number of level),
569or       over a spatially varying but temporally fixed number of levels (typically the base
570of the winter mixed layer) read in \ifile{ctlsurf\_idx} (\np{nn\_ctls}=1).
571\end{description}
572
573The units in the output file can be changed using the \np{nn\_ucf} namelist parameter.
574For example, in case of salinity tendency the units are given by PSU/s/\np{nn\_ucf}.
575Setting \np{nn\_ucf}=86400 provides the tendencies in PSU/d.
576
577When \key{trdmld} is defined, two time averaging procedure are proposed.
578Setting \np{ln\_trdmld\_instant} to \textit{true}, a simple time averaging is performed,
579so that the resulting tendency is the contribution to the change of a quantity between
580the two instantaneous values taken at the extremities of the time averaging period.
581Setting \np{ln\_trdmld\_instant} to \textit{false}, a double time averaging is performed,
582so that the resulting tendency is the contribution to the change of a quantity between
583two \textit{time mean} values. The later option requires the use of an extra file, \ifile{restart\_mld} 
584(\np{ln\_trdmld\_restart}=true), to restart a run.
585
586
587Note that the mixed layer tendency diagnostic can also be used on biogeochemical models
588via Êthe \key{trdtrc} and \key{trdmld\_trc} CPP keys.
589
590% -------------------------------------------------------------------------------------------------------------
591%       On-line Floats trajectories
592% -------------------------------------------------------------------------------------------------------------
593\subsection{On-line Floats trajectories (FLO) (\key{floats}}
594\label{FLO}
595%--------------------------------------------namflo-------------------------------------------------------
596\namdisplay{namflo} 
597%--------------------------------------------------------------------------------------------------------------
598
599The on-line computation of floats advected either by the three dimensional velocity
600field or constraint to remain at a given depth ($w = 0$ in the computation) have been
601introduced in the system during the CLIPPER project. The algorithm used is based
602either on the work of \cite{Blanke_Raynaud_JPO97} (default option), or on a $4^th$
603Runge-Hutta algorithm (\np{ln\_flork4}=true). Note that the \cite{Blanke_Raynaud_JPO97} 
604algorithm have the advantage of providing trajectories which are consistent with the
605numeric of the code, so that the trajectories never intercept the bathymetry.
606
607See also the web site describing the off-line use of this marvellous diagnostic tool
608(http://stockage.univ-brest.fr/~grima/Ariane/).
609
610% -------------------------------------------------------------------------------------------------------------
611%       Other Diagnostics
612% -------------------------------------------------------------------------------------------------------------
613\subsection{Other Diagnostics (\key{diahth}, \key{diaar5})}
614\label{MISC_diag_others}
615
616
617Aside from the standard model variables, other diagnostics can be computed
618on-line. The available ready-to-add diagnostics routines can be found in directory DIA.
619Among the available diagnostics the following ones are obtained when defining
620the \key{diahth} CPP key:
621
622- the mixed layer depth (based on a density criterion, \citet{de_Boyer_Montegut_al_JGR04}) (\mdl{diahth})
623
624- the turbocline depth (based on a turbulent mixing coefficient criterion) (\mdl{diahth})
625
626- the depth of the 20\deg C isotherm (\mdl{diahth})
627
628- the depth of the thermocline (maximum of the vertical temperature gradient) (\mdl{diahth})
629
630The poleward heat and salt transports, their advective and diffusive component, and
631the meriodional stream function can be computed on-line in \mdl{diaptr} by setting
632\np{ln\_diaptr} to true (see the \textit{namptr} namelist below). 
633When \np{ln\_subbas}~=~true, transports and stream function are computed
634for the Atlantic, Indian, Pacific and Indo-Pacific Oceans (defined north of 30\deg S)
635as well as for the World Ocean. The sub-basin decomposition requires an input file
636(\ifile{subbasins}) which contains three 2D mask arrays, the Indo-Pacific mask
637been deduced from the sum of the Indian and Pacific mask (Fig~\ref{Fig_mask_subasins}).
638
639%------------------------------------------namptr----------------------------------------------------
640\namdisplay{namptr} 
641%-------------------------------------------------------------------------------------------------------------
642%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
643\begin{figure}[!t] \label{Fig_mask_subasins}  \begin{center}
644\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_mask_subasins.pdf}
645\caption {Decomposition of the World Ocean (here ORCA2) into sub-basin used in to compute
646the heat and salt transports as well as the meridional stream-function: Atlantic basin (red),
647Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green).
648Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay
649are removed from the sub-basin. Note also that the Arctic Ocean has been split
650into Atlantic and Pacific basins along the North fold line.  }
651\end{center}   \end{figure}
652%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
653
654In addition, a series of diagnostics has been added in the \mdl{diaar5}.
655They corresponds to outputs that are required for AR5 simulations
656(see Section \ref{MISC_steric} below for one of them).
657Activating those outputs requires to define the \key{diaar5} CPP key.
658
659
660
661% ================================================================
662% Steric effect in sea surface height
663% ================================================================
664\section{Steric effect in sea surface height}
665\label{MISC_steric}
666
667
668Changes in steric sea level are caused when changes in the density of the water
669column imply an expansion or contraction of the column. It is essentially produced
670through surface heating/cooling and to a lesser extent through non-linear effects of
671the equation of state (cabbeling, thermobaricity...).
672Non-Boussinesq models contain all ocean effects within the ocean acting
673on the sea level. In particular, they include the steric effect. In contrast,
674Boussinesq models, such as \NEMO, conserve volume, rather than mass,
675and so do not properly represent expansion or contraction. The steric effect is
676therefore not explicitely represented.
677This approximation does not represent a serious error with respect to the flow field
678calculated by the model \citep{Greatbatch_JGR94}, but extra attention is required
679when investigating sea level, as steric changes are an important
680contribution to local changes in sea level on seasonal and climatic time scales.
681This is especially true for investigation into sea level rise due to global warming.
682
683Fortunately, the steric contribution to the sea level consists of a spatially uniform
684component that can be diagnosed by considering the mass budget of the world
685ocean \citep{Greatbatch_JGR94}.
686In order to better understand how global mean sea level evolves and thus how
687the steric sea level can be diagnosed, we compare, in the following, the
688non-Boussinesq and Boussinesq cases.
689
690Let denote
691$\mathcal{M}$ the total mass of liquid seawater ($\mathcal{M}=\int_D \rho dv$),
692$\mathcal{V}$ the total volume of seawater ($\mathcal{V}=\int_D dv$),
693$\mathcal{A}$ the total surface of the ocean ($\mathcal{A}=\int_S ds$),
694$\bar{\rho}$ the global mean seawater (\textit{in situ}) density ($\bar{\rho}= 1/\mathcal{V} \int_D \rho \,dv$), and
695$\bar{\eta}$ the global mean sea level ($\bar{\eta}=1/\mathcal{A}\int_S \eta \,ds$).
696
697A non-Boussinesq fluid conserves mass. It satisfies the following relations:
698\begin{equation} \label{Eq_MV_nBq} 
699\begin{split} 
700\mathcal{M} &\mathcal{V}  \;\bar{\rho}       \\
701\mathcal{V} &\mathcal{A}  \;\bar{\eta} 
702\end{split}
703\end{equation}
704Temporal changes in total mass is obtained from the density conservation equation :
705\begin{equation}  \label{Eq_Co_nBq}
706\frac{1}{e_3} \partial_t ( e_3\,\rho) + \nabla( \rho \, \textbf{U} ) = \left. \frac{\textit{emp}}{e_3}\right|_\textit{surface}
707\end{equation}
708where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass
709exchanges with the other media of the Earth system (atmosphere, sea-ice, land).
710Its global averaged leads to the total mass change
711\begin{equation}  \label{Eq_Mass_nBq}
712\partial_t \mathcal{M} = \mathcal{A} \;\overline{\textit{emp}}
713\end{equation}
714where $\overline{\textit{emp}}=\int_S \textit{emp}\,ds$ is the net mass flux
715through the ocean surface.
716Bringing \eqref{Eq_Mass_nBq} and the time derivative of \eqref{Eq_MV_nBq} 
717together leads to the evolution equation of the mean sea level
718\begin{equation} \label{Eq_ssh_nBq}
719  \partial_t \bar{\eta} =  \frac{\overline{\textit{emp}}}{ \bar{\rho}} 
720               - \frac{\mathcal{V}}{\mathcal{A}}  \;\frac{\partial_t \bar{\rho} }{\bar{\rho}}
721\end{equation}
722The first term in equation \eqref{Eq_ssh_nBq} alters sea level by adding or
723subtracting mass from the ocean.
724The second term arises from temporal changes in the global mean
725density; $i.e.$ from steric effects.
726
727In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ 
728appears multiplied by the gravity ($i.e.$ in the hydrostatic balance of the primitive Equations).
729In particular, the mass conservation equation, \eqref{Eq_Co_nBq}, degenerates into
730the incompressibility equation:
731\begin{equation}  \label{Eq_Co_Bq}
732\frac{1}{e_3} \partial_t ( e_3 ) + \nabla( \textbf{U} ) =  \left. \frac{\textit{emp}}{\rho_o \,e_3}\right|_ \textit{surface}
733\end{equation}
734and the global average of this equation now gives the temporal change of the total volume,
735\begin{equation}  \label{Eq_V_Bq}
736  \partial_t \mathcal{V} =   \mathcal{A} \;\frac{\overline{\textit{emp}}}{\rho_o} 
737\end{equation}
738Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is the
739Boussinesq mass, $\mathcal{M}_o = \rho_o \mathcal{V}$. The total volume (or equivalently 
740the global mean sea level) is altered only by net volume fluxes across the ocean surface, 
741not by changes in mean mass of the ocean: the steric effect is missing in a Boussinesq fluid.
742 
743Nevertheless, following \citep{Greatbatch_JGR94}, the steric effect on the volume can be
744diagnosed by considering the mass budget of the ocean.
745The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by surface
746mass flux must be compensated by a spatially uniform change in the mean sea level due to
747expansion/contraction of the ocean \citep{Greatbatch_JGR94}. In others words, the Boussinesq
748mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$, the  total mass of the ocean seen
749by the Boussinesq model, via the steric contribution to the sea level, $\eta_s$, a spatially
750uniform variable, as follows:
751\begin{equation}  \label{Eq_M_Bq}
752   \mathcal{M}_o  =  \mathcal{M} + \rho_o \,\eta_s \,\mathcal{A} 
753\end{equation}
754Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through
755the ocean surface is converted into a mean change in sea level. Introducing the total density
756anomaly, $\mathcal{D}= \int_D d_a \,dv$, where $d_a= (\rho -\rho_o ) / \rho_o$ 
757is the density anomaly used in \NEMO (cf. \S\ref{TRA_eos}) in \eqref{Eq_M_Bq}
758leads to a very simple form for the steric height:
759\begin{equation}  \label{Eq_steric_Bq}
760   \eta_s = - \frac{1}{\mathcal{A}} \mathcal{D} 
761\end{equation}
762
763The above formulation of the steric height of a Boussinesq ocean requires four remarks.
764First, one can be tempted to define $\rho_o$ as the initial value of $\mathcal{M}/\mathcal{V}$,
765$i.e.$ set $\mathcal{D}_{t=0}=0$, so that the initial steric height is zero. We do not
766recommend that. Indeed, in this case $\rho_o$ depends on the initial state of the ocean.
767Since $\rho_o$ has a direct effect on the dynamics of the ocean (it appears in the pressure
768gradient term of the momentum equation) it is definitively not a good idea when
769inter-comparing experiments.
770We better recommend to fixe once for all $\rho_o$ to $1035\;Kg\,m^{-3}$. This value is a
771sensible choice for the reference density used in a Boussinesq ocean climate model since,
772with the exception of only a small percentage of the ocean, density in the World Ocean
773varies by no more than 2$\%$ from this value (\cite{Gill1982}, page 47).
774
775Second, we have assumed here that the total ocean surface, $\mathcal{A}$, does not
776change when the sea level is changing as it is the case in all global ocean GCMs
777(wetting and drying of grid point is not allowed).
778 
779Third, the discretisation of \eqref{Eq_steric_Bq} depends on the type of free surface
780which is considered. In the non linear free surface case, $i.e.$ \key{vvl} defined, it is
781given by
782\begin{equation}  \label{Eq_discrete_steric_Bq}
783   \eta_s =  - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t} e_{2t} e_{3t} }
784                  { \sum_{i,\,j,\,k}         e_{1t} e_{2t} e_{3t} } 
785\end{equation}
786whereas in the linear free surface, the volume above the \textit{z=0} surface must be explicitly taken
787into account to better approximate the total ocean mass and thus the steric sea level:
788\begin{equation}  \label{Eq_discrete_steric_Bq}
789   \eta_s =  - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} d_a\; e_{1t}e_{2t} \eta }
790                     {\sum_{i,\,j,\,k} e_{1t}e_{2t}e_{3t} + \sum_{i,\,j}           e_{1t}e_{2t} \eta } 
791\end{equation}
792
793The fourth and last remark concerns the effective sea level and the presence of sea-ice.
794In the real ocean, sea ice (and snow above it)  depresses the liquid seawater through
795its mass loading. This depression is a result of the mass of sea ice/snow system acting
796on the liquid ocean. There is, however, no dynamical effect associated with these depressions
797in the liquid ocean sea level, so that there are no associated ocean currents. Hence, the
798dynamically relevant sea level is the effective sea level, $i.e.$ the sea level as if sea ice
799(and snow) were converted to liquid seawater \citep{Campin_al_OM08}. However,
800in the current version of \NEMO the sea-ice is levitating above the ocean without
801mass exchanges between ice and ocean. Therefore the model effective sea level
802is always given by $\eta + \eta_s$, whether or not there is sea ice present.
803
804In AR5 outputs, the thermosteric sea level is demanded. It is steric sea level due to
805changes in ocean density arising just from changes in temperature. It is given by:
806\begin{equation}  \label{Eq_thermosteric_Bq}
807   \eta_s = - \frac{1}{\mathcal{A}} \int_D d_a(T,S_o,p_o) \,dv
808\end{equation}
809where $S_o$ and $p_o$ are the initial salinity and pressure, respectively.
810
811Both steric and thermosteric sea level are computed in \mdl{diaar5} which needs
812the \key{diaar5} defined to be called.
813
814
815% ================================================================
816% predefined configurations
817% ================================================================
818\section{predefined configurations}
819\label{MISC_config}
820
821There is several predefined ocean configuration which use is controlled by a specific CPP key.
822
823The key set the domain sizes (\jp{jpiglo}, \jp{jpjglo}, \jp{jpk}), the mesh and the bathymetry,
824and, in some cases, add to the model physics some specific treatments.
825
826% -------------------------------------------------------------------------------------------------------------
827%       ORCA family configurations
828% -------------------------------------------------------------------------------------------------------------
829\subsection{ORCA family: global ocean with tripolar grid}
830\label{MISC_config_orca}
831
832The NEMO system is provided with four built-in ORCA configurations which differ in the
833horizontal resolution used:
834\begin{description}
835\item[\key{orca\_r4}]  \jp{cp\_cfg}~=~orca ; \jp{jp\_cfg}~=~4
836\item[\key{orca\_r2}]  \jp{cp\_cfg}~=~orca ; \jp{jp\_cfg}~=~2
837\item[\key{orca\_r1}]  \jp{cp\_cfg}~=~orca ; \jp{jp\_cfg}~=~1
838\item[\key{orca\_r05}]  \jp{cp\_cfg}~=~orca ; \jp{jp\_cfg}~=~05
839\item[\key{orca\_r025}]  \jp{cp\_cfg}~=~orca ; \jp{jp\_cfg}~=~025
840\end{description}
841
842\subsubsection{ORCA mesh}
843
844%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
845\begin{figure}[!t] \label{Fig_MISC_ORCA_msh}  \begin{center}
846\includegraphics[width=0.98\textwidth]{./TexFiles/Figures/Fig_ORCA_NH_mesh.pdf}
847\caption {ORCA mesh conception. The departure from an isotropic Mercator grid start poleward of 20\deg N.
848The two "north pole" are the foci of a series of embedded ellipses (blue curves)
849which are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes).
850Then, following \citet{Madec_Imbard_CD96}, the normal to the series of ellipses (red curves) is computed
851which provide the j-lines of the mesh (pseudo longitudes).
852 }
853\end{center}   \end{figure}
854%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
855
856
857%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
858\begin{figure}[!tbp] \label{Fig_MISC_ORCA_e1e2}  \begin{center}
859\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_ORCA_NH_msh05_e1_e2.pdf}
860\includegraphics[width=0.80\textwidth]{./TexFiles/Figures/Fig_ORCA_aniso.pdf}
861\caption {\textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and
862\textit{Bottom}: ratio of anisotropy ($e_1 / e_2$)
863for ORCA 0.5\deg ~mesh. South of 20\deg N a Mercator grid is used ($e_1 = e_2$)
864so that the anisotropy ratio is 1. Poleward of 20\deg N, the two "north pole"
865introduce a weak anisotropy over the ocean areas ($< 1.2$) except in vicinity of Victoria Island
866(Canadian Arctic Archipelago). }
867\end{center}   \end{figure}
868%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
869
870%--------------------------------------------------TABLE--------------------------------------------------
871\begin{table}[htbp]  \label{Tab_ORCA}
872\begin{center}
873\begin{tabular}{ccccc}
874key                         & \jp{jp\_cfg} &  \jp{jpiglo} & \jp{jpiglo} &       \\ 
875\hline  \hline
876\key{orca\_r4}        &        4         &         92     &      76      &       \\
877\key{orca\_r2}       &        2         &       182     &    149      &        \\
878%\key{orca\_r1}       &        1         &       362     &     511     &        \\
879\key{orca\_r05}     &        05       &       722     &     261     &        \\
880\key{orca\_r025}   &        025     &      1442    &   1021     &        \\
881%\key{orca\_r8}       &        8         &      2882    &   2042     &        \\
882%\key{orca\_r12}     &      12         &      4322    &   3062      &       \\
883\hline
884\hline
885\end{tabular}
886\caption {Set of predefined ORCA parameters. }
887\end{center}
888\end{table}
889%--------------------------------------------------------------------------------------------------------------
890
891The tripolar grid used in ORCA configuration ....
892
893NB: the two north poles position has been chosen to minimise the anisotropy ratio in
894the Gulf Stream and kuroshio areas, two highly turbulent regions.
895
896ORCA~2 : a $2\deg$ zonal resolution, and a meridional resolution varying from $0.5\deg$ at the
897equator to $2\deg cos\phi$ south of $20\deg$S (Fig. 1). The grid features two points of convergence in the
898Northern Hemisphere, both situated on continents. Minimum resolution in high latitudes is about
89965~km in the Arctic and 50~km in the Antarctic. Local mesh refinements are applied to the
900Mediterranean, Red, Black and Caspian Seas. None of them appears to be of particular
901importance for the study of high latitude climate, but the fine resolution is needed in order to have
902their local circulation and their role in the World Ocean's circulation considered correctly.
903
904
905 
906ORCA2-LIM (global ocean sea-ice configuration \citep{Timmermann_al_OM05}.
907The horizontal mesh is based on a $2\deg \times 2\deg$ Mercator grid ($i.e.$ same zonal and
908meridional grid spacing) which has been modified poleward 
909of $20\deg$N in order to include two numerical inland poles \citep{Murray_JCP96}.
910This modification is semi-analytical \citep{Madec_Imbard_CD96} 
911and based on a series of embedded ellipses. It insures that the mesh remains
912close to isotropy and that the smallest grid cell is along Antarctica.
913In order to refine the meridional resolution up to $0.5\deg$ at the equator,
914additional local transformations were applied with in the Tropics.
915Local mesh refinements are also applied to the Mediterranean, Red, Black
916and Caspian Seas so that the resolution is $1\deg \time 1\deg$ there.
917There are 31 levels in the vertical, with the highest resolution (10m)
918in the upper 150m. The bottom topography and the coastlines are derived
919from the global atlas of Smith and Sandwell (1997).
920
921\key{orca\_lev10} 10 time more vertical levels
922
923\key{agrif}  : ORCA2-LIM plus an AGRIF zoom over the Agulhas current area
924
925\key{arctic}, \key{antarctic}  (not used in ORCA\_R4)
926
927
928We thus only provide a brief introduction in this chapter.
929The global coupled ocean-ice configuration is very similar to that used as part of the climate
930model developed at GFDL for the 4th IPCC assessment of climate change (Griffies et al., 2005;
931Gnanadesikan et al., 2006).
932The ORCA2-LIM configuration is also the basis for the \NEMO contribution to the
933Coordinate Ocean-ice Reference Experiments (COREs) documented in \citet{Griffies_al_OM09}.
934These experiments employ the boundary forcing from \citet{Large_Yeager_Rep04} (see \S\ref{SBC_blk_core}),
935which was developed for the purpose of running global coupled ocean-ice simulations without an
936interactive atmosphere. This \citet{Large_Yeager_Rep04} dataset is available through the GFDL web
937site \footnote{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}.
938The "normal year" of \citet{Large_Yeager_Rep04} has been chosen of the \NEMO distribution
939since release v3.3.
940
941% -------------------------------------------------------------------------------------------------------------
942%       GYRE family configuration
943% -------------------------------------------------------------------------------------------------------------
944\subsection{GYRE family: double gyre basin (\key{gyre})}
945\label{MISC_config_gyre}
946
947The GYRE configuration \citep{Levy_al_OM10} have been built to simulated
948the seasonal cycle of a double-gyre box model. It consist in an idealized domain
949similar to that used in the studies of \citet{Drijfhout_JPO94} and \citet{Hazeleger_Drijfhout_JPO98,
950Hazeleger_Drijfhout_JPO99, Hazeleger_Drijfhout_JGR00, Hazeleger_Drijfhout_JPO00},
951over which an analytical seasonal forcing is applied. This allows to investigate the
952spontaneous generation of a large number of interacting, transient mesoscale eddies
953and their contribution to the large scale circulation.
954
955The domain geometry is a closed rectangular basin on the $\beta$-plane centred
956at $\sim 30\deg$N and rotated by 45\deg, 3180~km long, 2120~km wide
957and 4~km deep (Fig.~\ref{Fig_MISC_strait_hand}).
958The domain is bounded by vertical walls and by a ßat bottom. The configuration is
959meant to represent an idealized North Atlantic or North Pacific basin.
960The circulation is forced by analytical profiles of wind and buoyancy ßuxes.
961The applied forcings vary seasonally in a sinusoidal manner between winter
962and summer extrema \citep{Levy_al_OM10}.
963The wind stress is zonal and its curl changes sign at 22\deg N and 36\deg N.
964It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain
965and a small recirculation gyre in the southern corner.
966The net heat ßux takes the form of a restoring toward a zonal apparent air
967temperature profile. A portion of the net heat ßux which comes from the solar radiation
968is allowed to penetrate within the water column.
969The fresh water ßux is also prescribed and varies zonally.
970It is determined such as, at each time step, the basin-integrated ßux is zero.
971The basin is initialised at rest with vertical profiles of temperature and salinity
972uniformly applied to the whole domain.
973
974The GYRE configuration is set through the \key{gyre} CPP key. Its horizontal resolution
975(and thus the size of the domain) is determined by setting \jp{jp\_cfg} in \hf{par\_GYRE} file: \\
976\jp{jpiglo} $= 30 \times$ \jp{jp\_cfg} + 2   \\
977\jp{jpjglo} $= 20 \times$ \jp{jp\_cfg} + 2   \\
978Obviously, the namelist parameters have to be adjusted to the chosen resolution.
979In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}=31) (Fig.~\ref{Fig_zgr}).
980
981The GYRE configuration is also used in benchmark test as it is very simple to increase
982its resolution and as it does not requires any input file. For example, keeping a same model size
983on each processor while increasing the number of processor used is very easy, even though the
984physical integrity of the solution can be compromised.
985
986%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
987\begin{figure}[!t] \label{Fig_GYRE}  \begin{center}
988\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_GYRE.pdf}
989\caption {Snapshot of relative vorticity at the surface of the model domain
990in GYRE R9, R27 and R54. From \citet{Levy_al_OM10}.}
991\end{center}   \end{figure}
992%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
993
994% -------------------------------------------------------------------------------------------------------------
995%       EEL family configuration
996% -------------------------------------------------------------------------------------------------------------
997\subsection{EEL family: periodic channel}
998\label{MISC_config_EEL}
999
1000\begin{description}
1001\item[\key{eel\_r2}] 
1002\item[\key{eel\_r5}] 
1003\item[\key{eel\_r6}] 
1004\end{description}
1005
1006% -------------------------------------------------------------------------------------------------------------
1007%       POMME configuration
1008% -------------------------------------------------------------------------------------------------------------
1009\subsection{POMME: mid-latitude sub-domain}
1010\label{MISC_config_POMME}
1011
1012
1013\key{pomme\_r025} 
1014
1015
1016
Note: See TracBrowser for help on using the repository browser.