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.
Changeset 6497 for trunk – NEMO

Changeset 6497 for trunk


Ignore:
Timestamp:
2016-04-27T09:33:46+02:00 (8 years ago)
Author:
gm
Message:

#1720 - trunk: add Casimir tidal parameterization

Location:
trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/DOC/TexFiles/Chapters/Chap_DIA.tex

    r6289 r6497  
    14091409 
    14101410% ------------------------------------------------------------------------------------------------------------- 
    1411 %       25 hour mean and hourly Surface, Mid and Bed  
    1412 % ------------------------------------------------------------------------------------------------------------- 
    1413 \section{25 hour mean output for tidal models } 
    1414  
    1415 A module is available to compute a crudely detided M2 signal by obtaining a 25 hour mean. 
    1416 The 25 hour mean is available for daily runs by summing up the 25 hourly instantananeous hourly values from 
    1417 midnight at the start of the day to midight at the day end. 
    1418 This diagnostic is actived with the logical  $ln\_dia25h$ 
    1419  
    1420 %------------------------------------------nam_dia25h------------------------------------------------------ 
    1421 \namdisplay{nam_dia25h} 
    1422 %---------------------------------------------------------------------------------------------------------- 
    1423  
    1424 \section{Top Middle and Bed hourly output } 
    1425  
    1426 A module is available to output the surface (top), mid water and bed diagnostics of a set of standard variables.  
    1427 This can be a useful diagnostic when hourly or sub-hourly output is required in high resolution tidal outputs. 
    1428 The tidal signal is retained but the overall data usage is cut to just three vertical levels. Also the bottom level  
    1429 is calculated for each cell. 
    1430 This diagnostic is actived with the logical  $ln\_diatmb$ 
    1431  
    1432 %------------------------------------------nam_diatmb----------------------------------------------------- 
    1433 \namdisplay{nam_diatmb} 
    1434 %---------------------------------------------------------------------------------------------------------- 
    1435  
    1436 % ------------------------------------------------------------------------------------------------------------- 
    14371411%       Sections transports 
    14381412% ------------------------------------------------------------------------------------------------------------- 
     
    14401414\label{DIA_diag_dct} 
    14411415 
     1416%------------------------------------------namdct---------------------------------------------------- 
     1417\namdisplay{namdct} 
     1418%------------------------------------------------------------------------------------------------------------- 
     1419 
    14421420A module is available to compute the transport of volume, heat and salt through sections.  
    14431421This diagnostic is actived with \key{diadct}. 
     
    14591437and the time scales over which they are averaged, as well as the level of output for debugging: 
    14601438 
    1461 %------------------------------------------namdct---------------------------------------------------- 
    1462 \namdisplay{namdct} 
    1463 %------------------------------------------------------------------------------------------------------------- 
    1464  
    14651439\np{nn\_dct}: frequency of instantaneous transports computing 
    14661440 
     
    14691443\np{nn\_debug}: debugging of the section 
    14701444 
    1471 \subsubsection{ To create a binary file containing the pathway of each section } 
    1472  
    1473 In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, the file \texttt{ {list\_sections.ascii\_global}} 
     1445\subsubsection{ Creating a binary file containing the pathway of each section } 
     1446 
     1447In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, the file \textit{ {list\_sections.ascii\_global}} 
    14741448contains a list of all the sections that are to be computed (this list of sections is based on MERSEA project metrics). 
    14751449 
     
    15831557\texttt{=/0, =/ 1000.}   &  diagonal   & eastward  & westward  & postive: eastward  \\ \hline                 
    15841558\end{tabular} 
    1585  
    1586  
    1587  
    1588 % ------------------------------------------------------------------------------------------------------------- 
    1589 %       Other Diagnostics 
    1590 % ------------------------------------------------------------------------------------------------------------- 
    1591 \section{Other Diagnostics (\key{diahth}, \key{diaar5})} 
    1592 \label{DIA_diag_others} 
    1593  
    1594  
    1595 Aside from the standard model variables, other diagnostics can be computed  
    1596 on-line. The available ready-to-add diagnostics routines can be found in directory DIA.  
    1597 Among the available diagnostics the following ones are obtained when defining  
    1598 the \key{diahth} CPP key:  
    1599  
    1600 - the mixed layer depth (based on a density criterion \citep{de_Boyer_Montegut_al_JGR04}) (\mdl{diahth}) 
    1601  
    1602 - the turbocline depth (based on a turbulent mixing coefficient criterion) (\mdl{diahth}) 
    1603  
    1604 - the depth of the 20\deg C isotherm (\mdl{diahth}) 
    1605  
    1606 - the depth of the thermocline (maximum of the vertical temperature gradient) (\mdl{diahth}) 
    1607  
    1608 The poleward heat and salt transports, their advective and diffusive component, and  
    1609 the meriodional stream function can be computed on-line in \mdl{diaptr}  
    1610 \np{ln\_diaptr} to true (see the \textit{\ngn{namptr} } namelist below).   
    1611 When \np{ln\_subbas}~=~true, transports and stream function are computed  
    1612 for the Atlantic, Indian, Pacific and Indo-Pacific Oceans (defined north of 30\deg S)  
    1613 as well as for the World Ocean. The sub-basin decomposition requires an input file  
    1614 (\ifile{subbasins}) which contains three 2D mask arrays, the Indo-Pacific mask  
    1615 been deduced from the sum of the Indian and Pacific mask (Fig~\ref{Fig_mask_subasins}).  
    1616  
    1617 %------------------------------------------namptr---------------------------------------------------- 
    1618 \namdisplay{namptr}  
    1619 %------------------------------------------------------------------------------------------------------------- 
    1620 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1621 \begin{figure}[!t]     \begin{center} 
    1622 \includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_mask_subasins.pdf} 
    1623 \caption{   \label{Fig_mask_subasins} 
    1624 Decomposition of the World Ocean (here ORCA2) into sub-basin used in to compute 
    1625 the heat and salt transports as well as the meridional stream-function: Atlantic basin (red),  
    1626 Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green).  
    1627 Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay  
    1628 are removed from the sub-basins. Note also that the Arctic Ocean has been split  
    1629 into Atlantic and Pacific basins along the North fold line.  } 
    1630 \end{center}   \end{figure}   
    1631 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1632  
    1633 In addition, a series of diagnostics has been added in the \mdl{diaar5}.  
    1634 They corresponds to outputs that are required for AR5 simulations  
    1635 (see Section \ref{DIA_steric} below for one of them).  
    1636 Activating those outputs requires to define the \key{diaar5} CPP key. 
    1637 \\ 
    1638 \\ 
    1639  
    1640 \section{Courant numbers} 
    1641 Courant numbers provide a theoretical indication of the model's numerical stability. The advective Courant numbers can be calculated according to 
    1642 \begin{equation} 
    1643 \label{eq:CFL} 
    1644 C_u = |u|\frac{\rdt}{e_{1u}}, \quad C_v = |v|\frac{\rdt}{e_{2v}}, \quad C_w = |w|\frac{\rdt}{e_{3w}} 
    1645 \end{equation} 
    1646 in the zonal, meridional and vertical directions respectively. The vertical component is included although it is not strictly valid as the vertical velocity is calculated from the continuity equation rather than as a prognostic variable. Physically this represents the rate at which information is propogated across a grid cell. Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. 
    1647  
    1648 The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \ngn{namctl} namelist. The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of where the maximum value occurs. At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along with the coordinates of each. The maximum values from the run are also copied to the ocean.output file.  
    16491559 
    16501560 
     
    18021712the \key{diaar5} defined to be called. 
    18031713 
     1714 
     1715 
     1716% ------------------------------------------------------------------------------------------------------------- 
     1717%       Other Diagnostics 
     1718% ------------------------------------------------------------------------------------------------------------- 
     1719\section{Other Diagnostics (\key{diahth}, \key{diaar5})} 
     1720\label{DIA_diag_others} 
     1721 
     1722 
     1723Aside from the standard model variables, other diagnostics can be computed on-line.  
     1724The available ready-to-add diagnostics modules can be found in directory DIA.  
     1725 
     1726\subsection{Depth of various quantities (\mdl{diahth})} 
     1727 
     1728Among the available diagnostics the following ones are obtained when defining  
     1729the \key{diahth} CPP key:  
     1730 
     1731- the mixed layer depth (based on a density criterion \citep{de_Boyer_Montegut_al_JGR04}) (\mdl{diahth}) 
     1732 
     1733- the turbocline depth (based on a turbulent mixing coefficient criterion) (\mdl{diahth}) 
     1734 
     1735- the depth of the 20\deg C isotherm (\mdl{diahth}) 
     1736 
     1737- the depth of the thermocline (maximum of the vertical temperature gradient) (\mdl{diahth}) 
     1738 
     1739% ----------------------------------------------------------- 
     1740%     Poleward heat and salt transports 
     1741% ----------------------------------------------------------- 
     1742 
     1743\subsection{Poleward heat and salt transports (\mdl{diaptr})} 
     1744 
     1745%------------------------------------------namptr----------------------------------------- 
     1746\namdisplay{namptr}  
     1747%----------------------------------------------------------------------------------------- 
     1748 
     1749The poleward heat and salt transports, their advective and diffusive component, and  
     1750the meriodional stream function can be computed on-line in \mdl{diaptr}  
     1751\np{ln\_diaptr} to true (see the \textit{\ngn{namptr} } namelist below).   
     1752When \np{ln\_subbas}~=~true, transports and stream function are computed  
     1753for the Atlantic, Indian, Pacific and Indo-Pacific Oceans (defined north of 30\deg S)  
     1754as well as for the World Ocean. The sub-basin decomposition requires an input file  
     1755(\ifile{subbasins}) which contains three 2D mask arrays, the Indo-Pacific mask  
     1756been deduced from the sum of the Indian and Pacific mask (Fig~\ref{Fig_mask_subasins}).  
     1757 
     1758%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1759\begin{figure}[!t]     \begin{center} 
     1760\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_mask_subasins.pdf} 
     1761\caption{   \label{Fig_mask_subasins} 
     1762Decomposition of the World Ocean (here ORCA2) into sub-basin used in to compute 
     1763the heat and salt transports as well as the meridional stream-function: Atlantic basin (red),  
     1764Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green).  
     1765Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay  
     1766are removed from the sub-basins. Note also that the Arctic Ocean has been split  
     1767into Atlantic and Pacific basins along the North fold line.  } 
     1768\end{center}   \end{figure}   
     1769%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1770 
     1771 
     1772% ----------------------------------------------------------- 
     1773%       CMIP specific diagnostics  
     1774% ----------------------------------------------------------- 
     1775\subsection{CMIP specific diagnostics (\mdl{diaar5})} 
     1776 
     1777A series of diagnostics has been added in the \mdl{diaar5}.  
     1778They corresponds to outputs that are required for AR5 simulations (CMIP5) 
     1779(see also Section \ref{DIA_steric} for one of them).  
     1780Activating those outputs requires to define the \key{diaar5} CPP key. 
     1781 
     1782 
     1783% ----------------------------------------------------------- 
     1784%       25 hour mean and hourly Surface, Mid and Bed  
     1785% ----------------------------------------------------------- 
     1786\subsection{25 hour mean output for tidal models } 
     1787 
     1788%------------------------------------------nam_dia25h------------------------------------- 
     1789\namdisplay{nam_dia25h} 
     1790%----------------------------------------------------------------------------------------- 
     1791 
     1792A module is available to compute a crudely detided M2 signal by obtaining a 25 hour mean. 
     1793The 25 hour mean is available for daily runs by summing up the 25 hourly instantananeous hourly values from 
     1794midnight at the start of the day to midight at the day end. 
     1795This diagnostic is actived with the logical  $ln\_dia25h$ 
     1796 
     1797 
     1798% ----------------------------------------------------------- 
     1799%     Top Middle and Bed hourly output 
     1800% ----------------------------------------------------------- 
     1801\subsection{Top Middle and Bed hourly output } 
     1802 
     1803%------------------------------------------nam_diatmb----------------------------------------------------- 
     1804\namdisplay{nam_diatmb} 
     1805%---------------------------------------------------------------------------------------------------------- 
     1806 
     1807A module is available to output the surface (top), mid water and bed diagnostics of a set of standard variables.  
     1808This can be a useful diagnostic when hourly or sub-hourly output is required in high resolution tidal outputs. 
     1809The tidal signal is retained but the overall data usage is cut to just three vertical levels. Also the bottom level  
     1810is calculated for each cell. 
     1811This diagnostic is actived with the logical  $ln\_diatmb$ 
     1812 
     1813 
     1814 
     1815% ----------------------------------------------------------- 
     1816%     Courant numbers 
     1817% ----------------------------------------------------------- 
     1818\subsection{Courant numbers} 
     1819Courant numbers provide a theoretical indication of the model's numerical stability. The advective Courant numbers can be calculated according to 
     1820\begin{equation} 
     1821\label{eq:CFL} 
     1822C_u = |u|\frac{\rdt}{e_{1u}}, \quad C_v = |v|\frac{\rdt}{e_{2v}}, \quad C_w = |w|\frac{\rdt}{e_{3w}} 
     1823\end{equation} 
     1824in the zonal, meridional and vertical directions respectively. The vertical component is included although it is not strictly valid as the vertical velocity is calculated from the continuity equation rather than as a prognostic variable. Physically this represents the rate at which information is propogated across a grid cell. Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. 
     1825 
     1826The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \ngn{namctl} namelist. The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of where the maximum value occurs. At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along with the coordinates of each. The maximum values from the run are also copied to the ocean.output file.  
     1827 
     1828 
    18041829% ================================================================ 
    18051830 
  • trunk/DOC/TexFiles/Chapters/Chap_DOM.tex

    r6320 r6497  
    486486The last choice in terms of vertical coordinate concerns the presence (or not) in the model domain  
    487487of ocean cavities beneath ice shelves. Setting \np{ln\_isfcav} to true allows to manage ocean cavities,  
    488 otherwise they are filled in. 
     488otherwise they are filled in. This option is currently only available in $z$- or $zps$-coordinate, 
     489and partial step are also applied at the ocean/ice shelf interface.  
    489490 
    490491Contrary to the horizontal grid, the vertical grid is computed in the code and no  
     
    772773\end{equation} 
    773774 
    774 where $s_{min}$ is the depth at which the s-coordinate stretching starts and  
    775 allows a z-coordinate to placed on top of the stretched coordinate,  
    776 and z is the depth (negative down from the asea surface). 
     775where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and  
     776allows a $z$-coordinate to placed on top of the stretched coordinate,  
     777and $z$ is the depth (negative down from the asea surface). 
    777778 
    778779\begin{equation} 
     
    886887that do not communicate with another ocean point at the same level are eliminated. 
    887888 
    888 In case of ice shelf cavities, as for the representation of bathymetry, a 2D integer array, misfdep, is created.  
    889 misfdep defines the level of the first wet $t$-point (ie below the ice-shelf/ocean interface). All the cells between $k=1$ and $misfdep(i,j)-1$ are masked.  
    890 By default, $misfdep(:,:)=1$ and no cells are masked. 
    891 Modifications of the model bathymetry and ice shelf draft into  
     889As for the representation of bathymetry, a 2D integer array, misfdep, is created.  
     890misfdep defines the level of the first wet $t$-point. All the cells between $k=1$ and $misfdep(i,j)-1$ are masked.  
     891By default, misfdep(:,:)=1 and no cells are masked. 
     892 
     893In case of ice shelf cavities, modifications of the model bathymetry and ice shelf draft into  
    892894the cavities are performed in the \textit{zgr\_isf} routine. The compatibility between ice shelf draft and bathymetry is checked.  
    893895All the locations where the isf cavity is thinnest than \np{rn\_isfhmin} meters are grounded ($i.e.$ masked).  
     
    903905vmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j+1,k)   \\ 
    904906fmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\ 
    905                    & \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k) \\ 
     907             &    \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k) \\ 
    906908wmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j,k-1) \text{ with } wmask(i,j,1) = tmask(i,j,1)  
    907909\end{align*} 
    908910 
    909 Note, wmask is now defined. It allows, in case of ice shelves,  
    910 to deal with the top boundary (ice shelf/ocean interface) exactly in the same way as for the bottom boundary.  
     911Note that, without ice shelves cavities, masks at $t-$ and $w-$points are identical with  
     912the numerical indexing used (\S~\ref{DOM_Num_Index}). Nevertheless, $wmask$ are required  
     913with oceean cavities to deal with the top boundary (ice shelf/ocean interface)  
     914exactly in the same way as for the bottom boundary.  
    911915 
    912916The specification of closed lateral boundaries requires that at least the first and last  
     
    916920(and so too the mask arrays) (see \S~\ref{LBC_jperio}). 
    917921 
    918 %%% 
    919 \gmcomment{   \colorbox{yellow}{Add one word on tricky trick !} mbathy in further modified in zdfbfr{\ldots}.  } 
    920 %%% 
    921922 
    922923% ================================================================ 
  • trunk/DOC/TexFiles/Chapters/Chap_SBC.tex

    r6320 r6497  
    128128The ocean model provides, at each time step, to the surface module (\mdl{sbcmod})  
    129129the surface currents, temperature and salinity.   
    130 These variables are averaged over \np{nf\_sbc} time-step (\ref{Tab_ssm}),  
     130These variables are averaged over \np{nn\_fsbc} time-step (\ref{Tab_ssm}),  
    131131and it is these averaged fields which are used to computes the surface fluxes  
    132 at a frequency of \np{nf\_sbc} time-step. 
     132at a frequency of \np{nn\_fsbc} time-step. 
    133133 
    134134 
     
    144144\caption{  \label{Tab_ssm}    
    145145Ocean variables provided by the ocean to the surface module (SBC).  
    146 The variable are averaged over nf{\_}sbc time step, $i.e.$ the frequency of  
    147 computation of surface fluxes.} 
     146The variable are averaged over nn{\_}fsbc time step,  
     147$i.e.$ the frequency of computation of surface fluxes.} 
    148148\end{center}   \end{table} 
    149149%-------------------------------------------------------------------------------------------------------------- 
     
    592592or larger than the one of the input atmospheric fields. 
    593593 
     594The \np{sn\_wndi}, \np{sn\_wndj}, \np{sn\_qsr}, \np{sn\_qlw}, \np{sn\_tair}, \np{sn\_humi}, 
     595\np{sn\_prec}, \np{sn\_snow}, \np{sn\_tdif} parameters describe the fields  
     596and the way they have to be used (spatial and temporal interpolations).  
     597 
     598\np{cn\_dir} is the directory of location of bulk files 
     599\np{ln\_taudif} is the flag to specify if we use Hight Frequency (HF) tau information (.true.) or not (.false.) 
     600\np{rn\_zqt}: is the height of humidity and temperature measurements (m) 
     601\np{rn\_zu}: is the height of wind measurements (m) 
     602 
     603Three multiplicative factors are availables :  
     604\np{rn\_pfac} and \np{rn\_efac} allows to adjust (if necessary) the global freshwater budget  
     605by increasing/reducing the precipitations (total and snow) and or evaporation, respectively. 
     606The third one,\np{rn\_vfac}, control to which extend the ice/ocean velocities are taken into account  
     607in the calculation of surface wind stress. Its range should be between zero and one,  
     608and it is recommended to set it to 0. 
     609 
    594610% ------------------------------------------------------------------------------------------------------------- 
    595611%        CLIO Bulk formulea 
     
    926942\begin{description} 
    927943\item[\np{nn\_isf}~=~1] 
    928 The ice shelf cavity is represented (\np{ln\_isfcav}~=~true needed). The fwf and heat flux are computed. Two different bulk formula are available: 
     944The ice shelf cavity is represented (\np{ln\_isfcav}~=~true needed). The fwf and heat flux are computed.  
     945Two different bulk formula are available: 
    929946   \begin{description} 
    930947   \item[\np{nn\_isfblk}~=~1] 
     
    9881005This parameter is only used if \np{nn\_isf}~=~1 or \np{nn\_isf}~=~4 
    9891006 
    990 If \np{rn\_hisf\_tbl} = 0.0, the fluxes are put in the top level whatever is its tickness.  
    991  
    992 If \np{rn\_hisf\_tbl} $>$ 0.0, the fluxes are spread over the first \np{rn\_hisf\_tbl} m (ie over one or several cells).\\ 
     1007If \np{rn\_hisf\_tbl} = 0., the fluxes are put in the top level whatever is its tickness.  
     1008 
     1009If \np{rn\_hisf\_tbl} $>$ 0., the fluxes are spread over the first \np{rn\_hisf\_tbl} m (ie over one or several cells).\\ 
    9931010 
    9941011The ice shelf melt is implemented as a volume flux with in the same way as for the runoff. 
  • trunk/DOC/TexFiles/Chapters/Chap_STO.tex

    r6289 r6497  
    55\label{STO} 
    66 
     7Authors: P.-A. Bouttier 
     8 
    79\minitoc 
    810 
     11\newpage 
    912 
    10 \newpage 
    11 $\ $\newline    % force a new line 
     13 
     14The stochastic parametrization module aims to explicitly simulate uncertainties in the model.  
     15More particularly, \cite{Brankart_OM2013} has shown that,  
     16because of the nonlinearity of the seawater equation of state, unresolved scales represent  
     17a major source of uncertainties in the computation of the large scale horizontal density gradient  
     18(from T/S large scale fields), and that the impact of these uncertainties can be simulated  
     19by random processes representing unresolved T/S fluctuations. 
     20 
     21The stochastic formulation of the equation of state can be written as: 
     22\begin{equation} 
     23 \label{eq:eos_sto} 
     24  \rho = \frac{1}{2} \sum_{i=1}^m\{ \rho[T+\Delta T_i,S+\Delta S_i,p_o(z)] + \rho[T-\Delta T_i,S-\Delta S_i,p_o(z)] \} 
     25\end{equation} 
     26where $p_o(z)$ is the reference pressure depending on the depth and,  
     27$\Delta T_i$ and $\Delta S_i$ are a set of T/S perturbations defined as the scalar product  
     28of the respective local T/S gradients with random walks $\mathbf{\xi}$: 
     29\begin{equation} 
     30 \label{eq:sto_pert} 
     31 \Delta T_i = \mathbf{\xi}_i \cdot \nabla T \qquad \hbox{and} \qquad \Delta S_i = \mathbf{\xi}_i \cdot \nabla S 
     32\end{equation} 
     33$\mathbf{\xi}_i$ are produced by a first-order autoregressive processes (AR-1) with  
     34a parametrized decorrelation time scale, and horizontal and vertical standard deviations $\sigma_s$.  
     35$\mathbf{\xi}$ are uncorrelated over the horizontal and fully correlated along the vertical. 
     36 
     37 
     38\section{Stochastic processes} 
     39\label{STO_the_details} 
     40 
     41The starting point of our implementation of stochastic parameterizations 
     42in NEMO is to observe that many existing parameterizations are based 
     43on autoregressive processes, which are used as a basic source of randomness 
     44to transform a deterministic model into a probabilistic model. 
     45A generic approach is thus to add one single new module in NEMO, 
     46generating processes with appropriate statistics 
     47to simulate each kind of uncertainty in the model 
     48(see \cite{Brankart_al_GMD2015} for more details). 
     49 
     50In practice, at every model grid point, independent Gaussian autoregressive 
     51processes~$\xi^{(i)},\,i=1,\ldots,m$ are first generated 
     52using the same basic equation: 
     53 
     54\begin{equation} 
     55\label{eq:autoreg} 
     56\xi^{(i)}_{k+1} = a^{(i)} \xi^{(i)}_k + b^{(i)} w^{(i)} + c^{(i)} 
     57\end{equation} 
     58 
     59\noindent 
     60where $k$ is the index of the model timestep; and 
     61$a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are parameters defining 
     62the mean ($\mu^{(i)}$) standard deviation ($\sigma^{(i)}$) 
     63and correlation timescale ($\tau^{(i)}$) of each process: 
     64 
     65\begin{itemize} 
     66\item for order~1 processes, $w^{(i)}$ is a Gaussian white noise, 
     67with zero mean and standard deviation equal to~1, and the parameters 
     68$a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
     69 
     70\begin{equation} 
     71\label{eq:ord1} 
     72\left\{ 
     73\begin{array}{l} 
     74a^{(i)} = \varphi \\ 
     75b^{(i)} = \sigma^{(i)} \sqrt{ 1 - \varphi^2 }  
     76 \qquad\qquad\mbox{with}\qquad\qquad 
     77\varphi = \exp \left( - 1 / \tau^{(i)} \right) \\ 
     78c^{(i)} = \mu^{(i)} \left( 1 - \varphi \right) \\ 
     79\end{array} 
     80\right. 
     81\end{equation} 
     82 
     83\item for order~$n>1$ processes, $w^{(i)}$ is an order~$n-1$ autoregressive process, 
     84with zero mean, standard deviation equal to~$\sigma^{(i)}$; correlation timescale 
     85equal to~$\tau^{(i)}$; and the parameters $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
     86 
     87\begin{equation} 
     88\label{eq:ord2} 
     89\left\{ 
     90\begin{array}{l} 
     91a^{(i)} = \varphi \\ 
     92b^{(i)} = \frac{n-1}{2(4n-3)} \sqrt{ 1 - \varphi^2 }  
     93 \qquad\qquad\mbox{with}\qquad\qquad 
     94\varphi = \exp \left( - 1 / \tau^{(i)} \right) \\ 
     95c^{(i)} = \mu^{(i)} \left( 1 - \varphi \right) \\ 
     96\end{array} 
     97\right. 
     98\end{equation} 
     99 
     100\end{itemize} 
     101 
     102\noindent 
     103In this way, higher order processes can be easily generated recursively using  
     104the same piece of code implementing Eq.~(\ref{eq:autoreg}),  
     105and using succesively processes from order $0$ to~$n-1$ as~$w^{(i)}$. 
     106The parameters in Eq.~(\ref{eq:ord2}) are computed so that this recursive application 
     107of Eq.~(\ref{eq:autoreg}) leads to processes with the required standard deviation 
     108and correlation timescale, with the additional condition that 
     109the $n-1$ first derivatives of the autocorrelation function 
     110are equal to zero at~$t=0$, so that the resulting processes 
     111become smoother and smoother as $n$ is increased. 
     112 
     113Overall, this method provides quite a simple and generic way of generating  
     114a wide class of stochastic processes.  
     115However, this also means that new model parameters are needed to specify each of  
     116these stochastic processes. As in any parameterization of lacking physics,  
     117a very important issues then to tune these new parameters using either first principles,  
     118model simulations, or real-world observations. 
     119 
     120\section{Implementation details} 
     121\label{STO_thech_details} 
     122 
    12123%---------------------------------------namsbc-------------------------------------------------- 
    13124\namdisplay{namsto} 
    14125%-------------------------------------------------------------------------------------------------------------- 
    15 $\ $\newline    % force a new ligne 
    16126 
     127The computer code implementing stochastic parametrisations can be found in the STO directory. 
     128It involves three modules :  
     129\begin{description} 
     130\item[\mdl{stopar}] : define the Stochastic parameters and their time evolution. 
     131\item[\mdl{storng}] : a random number generator based on (and includes) the 64-bit KISS  
     132                      (Keep It Simple Stupid) random number generator distributed by George Marsaglia  
     133                      (see \href{https://groups.google.com/forum/#!searchin/comp.lang.fortran/64-bit$20KISS$20RNGs}{here}) 
     134\item[\mdl{stopts}] : stochastic parametrisation associated with the non-linearity of the equation of seawater,  
     135 implementing Eq~\ref{eq:sto_pert} and specific piece of code in the equation of state implementing Eq~\ref{eq:eos_sto}. 
     136\end{description} 
    17137 
    18 See \cite{Brankart_OM2013} and \cite{Brankart_al_GMD2015} papers for a description of the parameterization. 
     138The \mdl{stopar} module has 3 public routines to be called by the model (in our case, NEMO): 
     139 
     140The first routine (\rou{sto\_par}) is a direct implementation of Eq.~(\ref{eq:autoreg}), 
     141applied at each model grid point (in 2D or 3D),  
     142and called at each model time step ($k$) to update 
     143every autoregressive process ($i=1,\ldots,m$). 
     144This routine also includes a filtering operator, applied to $w^{(i)}$, 
     145to introduce a spatial correlation between the stochastic processes. 
     146 
     147The second routine (\rou{sto\_par\_init}) is an initialization routine mainly dedicated 
     148to the computation of parameters $a^{(i)}, b^{(i)}, c^{(i)}$ 
     149for each autoregressive process, as a function of the statistical properties 
     150required by the model user (mean, standard deviation, time correlation, 
     151order of the process,\ldots).  
     152 
     153Parameters for the processes can be specified through the following \ngn{namsto} namelist parameters: 
     154\begin{description} 
     155   \item[\np{nn\_sto\_eos}]   : number of independent random walks  
     156   \item[\np{rn\_eos\_stdxy}] : random walk horz. standard deviation (in grid points) 
     157   \item[\np{rn\_eos\_stdz}]  : random walk vert. standard deviation (in grid points) 
     158   \item[\np{rn\_eos\_tcor}]  : random walk time correlation (in timesteps) 
     159   \item[\np{nn\_eos\_ord}]   : order of autoregressive processes 
     160   \item[\np{nn\_eos\_flt}]   : passes of Laplacian filter 
     161   \item[\np{rn\_eos\_lim}]   : limitation factor (default = 3.0) 
     162\end{description} 
     163This routine also includes the initialization (seeding) of the random number generator. 
     164 
     165The third routine (\rou{sto\_rst\_write}) writes a restart file (which suffix name is  
     166given by \np{cn\_storst\_out} namelist parameter) containing the current value of  
     167all autoregressive processes to allow restarting a simulation from where it has been interrupted. 
     168This file also contains the current state of the random number generator. 
     169When \np{ln\_rststo} is set to \textit{true}), the restart file (which suffix name is  
     170given by \np{cn\_storst\_in} namelist parameter) is read by the initialization routine  
     171(\rou{sto\_par\_init}). The simulation will continue exactly as if it was not interrupted 
     172only  when \np{ln\_rstseed} is set to \textit{true}, $i.e.$ when the state of  
     173the random number generator is read in the restart file. 
  • trunk/DOC/TexFiles/Chapters/Chap_TRA.tex

    r6320 r6497  
    734734(see \S\ref{SBC_rnf} for further detail of how it acts on temperature and salinity tendencies) 
    735735 
    736 $\bullet$ \textit{fwfisf}, the mass flux associated with ice shelf melt, (see \S\ref{SBC_isf} for further details  
    737 on how the ice shelf melt is computed and applied). 
     736$\bullet$ \textit{fwfisf}, the mass flux associated with ice shelf melt,  
     737(see \S\ref{SBC_isf} for further details on how the ice shelf melt is computed and applied). 
    738738 
    739739The surface boundary condition on temperature and salinity is applied as follows: 
     
    840840($i.e.$ the inverses of the extinction length scales) are tabulated over 61 nonuniform  
    841841chlorophyll classes ranging from 0.01 to 10 g.Chl/L (see the routine \rou{trc\_oce\_rgb}  
    842 in \mdl{trc\_oce} module). Three types of chlorophyll can be chosen in the RGB formulation: 
    843 (1) a constant 0.05 g.Chl/L value everywhere (\np{nn\_chdta}=0) ; (2) an observed  
    844 time varying chlorophyll (\np{nn\_chdta}=1) ; (3) simulated time varying chlorophyll 
    845 by TOP biogeochemical model (\np{ln\_qsr\_bio}=true). In the latter case, the RGB  
    846 formulation is used to calculate both the phytoplankton light limitation in PISCES  
    847 or LOBSTER and the oceanic heating rate.  
    848  
     842in \mdl{trc\_oce} module). Four types of chlorophyll can be chosen in the RGB formulation: 
     843\begin{description}  
     844\item[\np{nn\_chdta}=0]  
     845a constant 0.05 g.Chl/L value everywhere ;  
     846\item[\np{nn\_chdta}=1]   
     847an observed time varying chlorophyll deduced from satellite surface ocean color measurement  
     848spread uniformly in the vertical direction ;  
     849\item[\np{nn\_chdta}=2]   
     850same as previous case except that a vertical profile of chlorophyl is used.  
     851Following \cite{Morel_Berthon_LO89}, the profile is computed from the local surface chlorophyll value ; 
     852\item[\np{ln\_qsr\_bio}=true]   
     853simulated time varying chlorophyll by TOP biogeochemical model.  
     854In this case, the RGB formulation is used to calculate both the phytoplankton  
     855light limitation in PISCES or LOBSTER and the oceanic heating rate.  
     856\end{description}  
    849857The trend in \eqref{Eq_tra_qsr} associated with the penetration of the solar radiation  
    850858is added to the temperature trend, and the surface heat flux is modified in routine \mdl{traqsr}.  
     
    13851393                   I've changed "derivative" to "difference" and "mean" to "average"} 
    13861394 
    1387 With partial cells (\np{ln\_zps}=true) at bottom and top (\np{ln\_isfcav}=true), in general, tracers in horizontally  
    1388 adjacent cells live at different depths. Horizontal gradients of tracers are needed  
    1389 for horizontal diffusion (\mdl{traldf} module) and for the hydrostatic pressure  
    1390 gradient (\mdl{dynhpg} module) to be active. The partial cell properties  
    1391 at the top (\np{ln\_isfcav}=true) are computed in the same way as for the bottom. So, only the bottom interpolation is shown. 
    1392 \gmcomment{STEVEN from gm : question: not sure of  what -to be active- means} 
     1395With partial cells (\np{ln\_zps}=true) at bottom and top (\np{ln\_isfcav}=true), in general,  
     1396tracers in horizontally adjacent cells live at different depths.  
     1397Horizontal gradients of tracers are needed for horizontal diffusion (\mdl{traldf} module)  
     1398and the hydrostatic pressure gradient calculations (\mdl{dynhpg} module).  
     1399The partial cell properties at the top (\np{ln\_isfcav}=true) are computed in the same way as for the bottom.  
     1400So, only the bottom interpolation is explained below. 
    13931401 
    13941402Before taking horizontal gradients between the tracers next to the bottom, a linear  
  • trunk/DOC/TexFiles/Chapters/Chap_ZDF.tex

    r6320 r6497  
    262262\end{equation} 
    263263 
    264 At the ocean surface, a non zero length scale is set through the  \np{rn\_lmin0} namelist  
     264At the ocean surface, a non zero length scale is set through the  \np{rn\_mxl0} namelist  
    265265parameter. Usually the surface scale is given by $l_o = \kappa \,z_o$  
    266266where $\kappa = 0.4$ is von Karman's constant and $z_o$ the roughness  
    267267parameter of the surface. Assuming $z_o=0.1$~m \citep{Craig_Banner_JPO94}  
    268 leads to a 0.04~m, the default value of \np{rn\_lsurf}. In the ocean interior  
     268leads to a 0.04~m, the default value of \np{rn\_mxl0}. In the ocean interior  
    269269a minimum length scale is set to recover the molecular viscosity when $\bar{e}$  
    270270reach its minimum value ($1.10^{-6}= C_k\, l_{min} \,\sqrt{\bar{e}_{min}}$ ). 
     
    295295As the surface boundary condition on TKE is prescribed through $\bar{e}_o = e_{bb} |\tau| / \rho_o$,  
    296296with $e_{bb}$ the \np{rn\_ebb} namelist parameter, setting \np{rn\_ebb}~=~67.83 corresponds  
    297 to $\alpha_{CB} = 100$. further setting  \np{ln\_lsurf} to true applies \eqref{ZDF_Lsbc}  
    298 as surface boundary condition on length scale, with $\beta$ hard coded to the Stacet's value. 
     297to $\alpha_{CB} = 100$. Further setting  \np{ln\_mxl0} to true applies \eqref{ZDF_Lsbc}  
     298as surface boundary condition on length scale, with $\beta$ hard coded to the Stacey's value. 
    299299Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters)  
    300300is applied on surface $\bar{e}$ value. 
     
    852852The bottom friction represents the friction generated by the bathymetry.  
    853853The top friction represents the friction generated by the ice shelf/ocean interface.  
    854 As the friction processes at the top and bottom are represented similarly, only the bottom friction is described in detail below.\\ 
     854As the friction processes at the top and bottom are treated in similar way,  
     855only the bottom friction is described in detail below. 
    855856 
    856857 
     
    926927$H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{-4}$~m\;s$^{-1}$.  
    927928This is the default value used in \NEMO. It corresponds to a decay time scale  
    928 of 115~days. It can be changed by specifying \np{rn\_bfric1} (namelist parameter). 
     929of 115~days. It can be changed by specifying \np{rn\_bfri1} (namelist parameter). 
    929930 
    930931For the linear friction case the coefficients defined in the general  
     
    936937\end{split} 
    937938\end{equation} 
    938 When \np{nn\_botfr}=1, the value of $r$ used is \np{rn\_bfric1}.  
     939When \np{nn\_botfr}=1, the value of $r$ used is \np{rn\_bfri1}.  
    939940Setting \np{nn\_botfr}=0 is equivalent to setting $r=0$ and leads to a free-slip  
    940941bottom boundary condition. These values are assigned in \mdl{zdfbfr}.  
     
    943944in the \ifile{bfr\_coef} input NetCDF file. The mask values should vary from 0 to 1.  
    944945Locations with a non-zero mask value will have the friction coefficient increased  
    945 by $mask\_value$*\np{rn\_bfrien}*\np{rn\_bfric1}. 
     946by $mask\_value$*\np{rn\_bfrien}*\np{rn\_bfri1}. 
    946947 
    947948% ------------------------------------------------------------------------------------------------------------- 
     
    963964$e_b = 2.5\;10^{-3}$m$^2$\;s$^{-2}$, while the FRAM experiment \citep{Killworth1992}  
    964965uses $C_D = 1.4\;10^{-3}$ and $e_b =2.5\;\;10^{-3}$m$^2$\;s$^{-2}$.  
    965 The CME choices have been set as default values (\np{rn\_bfric2} and \np{rn\_bfeb2}  
     966The CME choices have been set as default values (\np{rn\_bfri2} and \np{rn\_bfeb2}  
    966967namelist parameters). 
    967968 
     
    978979\end{equation} 
    979980 
    980 The coefficients that control the strength of the non-linear bottom friction are  
    981 initialised as namelist parameters: $C_D$= \np{rn\_bfri2}, and $e_b$ =\np{rn\_bfeb2}.  
    982 Note for applications which treat tides explicitly a low or even zero value of  
    983 \np{rn\_bfeb2} is recommended. From v3.2 onwards a local enhancement of $C_D$  
    984 is possible via an externally defined 2D mask array (\np{ln\_bfr2d}=true).  
    985 See previous section for details. 
     981The coefficients that control the strength of the non-linear bottom friction are 
     982initialised as namelist parameters: $C_D$= \np{rn\_bfri2}, and $e_b$ =\np{rn\_bfeb2}. 
     983Note for applications which treat tides explicitly a low or even zero value of 
     984\np{rn\_bfeb2} is recommended. From v3.2 onwards a local enhancement of $C_D$ is possible 
     985via an externally defined 2D mask array (\np{ln\_bfr2d}=true).  This works in the same way 
     986as for the linear bottom friction case with non-zero masked locations increased by 
     987$mask\_value$*\np{rn\_bfrien}*\np{rn\_bfri2}. 
     988 
     989% ------------------------------------------------------------------------------------------------------------- 
     990%       Bottom Friction Log-layer 
     991% ------------------------------------------------------------------------------------------------------------- 
     992\subsection{Log-layer Bottom Friction enhancement (\np{nn\_botfr} = 2, \np{ln\_loglayer} = .true.)} 
     993\label{ZDF_bfr_loglayer} 
     994 
     995In the non-linear bottom friction case, the drag coefficient, $C_D$, can be optionally 
     996enhanced using a "law of the wall" scaling. If  \np{ln\_loglayer} = .true., $C_D$ is no 
     997longer constant but is related to the thickness of the last wet layer in each column by: 
     998 
     999\begin{equation} 
     1000C_D = \left ( {\kappa \over {\rm log}\left ( 0.5e_{3t}/rn\_bfrz0 \right ) } \right )^2 
     1001\end{equation} 
     1002 
     1003\noindent where $\kappa$ is the von-Karman constant and \np{rn\_bfrz0} is a roughness 
     1004length provided via the namelist. 
     1005 
     1006For stability, the drag coefficient is bounded such that it is kept greater or equal to 
     1007the base \np{rn\_bfri2} value and it is not allowed to exceed the value of an additional 
     1008namelist parameter: \np{rn\_bfri2\_max}, i.e.: 
     1009 
     1010\begin{equation} 
     1011rn\_bfri2 \leq C_D \leq rn\_bfri2\_max 
     1012\end{equation} 
     1013 
     1014\noindent Note also that a log-layer enhancement can also be applied to the top boundary 
     1015friction if under ice-shelf cavities are in use (\np{ln\_isfcav}=.true.).  In this case, the 
     1016relevant namelist parameters are \np{rn\_tfrz0}, \np{rn\_tfri2} 
     1017and \np{rn\_tfri2\_max}. 
    9861018 
    9871019% ------------------------------------------------------------------------------------------------------------- 
     
    12671299 
    12681300% ================================================================ 
     1301% Internal wave-driven mixing 
     1302% ================================================================ 
     1303\section{Internal wave-driven mixing (\key{zdftmx\_new})} 
     1304\label{ZDF_tmx_new} 
     1305 
     1306%--------------------------------------------namzdf_tmx_new------------------------------------------ 
     1307\namdisplay{namzdf_tmx_new} 
     1308%-------------------------------------------------------------------------------------------------------------- 
     1309 
     1310The parameterization of mixing induced by breaking internal waves is a generalization  
     1311of the approach originally proposed by \citet{St_Laurent_al_GRL02}.  
     1312A three-dimensional field of internal wave energy dissipation $\epsilon(x,y,z)$ is first constructed,  
     1313and the resulting diffusivity is obtained as  
     1314\begin{equation} \label{Eq_Kwave} 
     1315A^{vT}_{wave} =  R_f \,\frac{ \epsilon }{ \rho \, N^2 } 
     1316\end{equation} 
     1317where $R_f$ is the mixing efficiency and $\epsilon$ is a specified three dimensional distribution  
     1318of the energy available for mixing. If the \np{ln\_mevar} namelist parameter is set to false,  
     1319the mixing efficiency is taken as constant and equal to 1/6 \citep{Osborn_JPO80}.  
     1320In the opposite (recommended) case, $R_f$ is instead a function of the turbulence intensity parameter  
     1321$Re_b = \frac{ \epsilon}{\nu \, N^2}$, with $\nu$ the molecular viscosity of seawater,  
     1322following the model of \cite{Bouffard_Boegman_DAO2013}  
     1323and the implementation of \cite{de_lavergne_JPO2016_efficiency}. 
     1324Note that $A^{vT}_{wave}$ is bounded by $10^{-2}\,m^2/s$, a limit that is often reached when the mixing efficiency is constant. 
     1325 
     1326In addition to the mixing efficiency, the ratio of salt to heat diffusivities can chosen to vary  
     1327as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to true, a recommended choice).  
     1328This parameterization of differential mixing, due to \cite{Jackson_Rehmann_JPO2014},  
     1329is implemented as in \cite{de_lavergne_JPO2016_efficiency}. 
     1330 
     1331The three-dimensional distribution of the energy available for mixing, $\epsilon(i,j,k)$, is constructed  
     1332from three static maps of column-integrated internal wave energy dissipation, $E_{cri}(i,j)$,  
     1333$E_{pyc}(i,j)$, and $E_{bot}(i,j)$, combined to three corresponding vertical structures  
     1334(de Lavergne et al., in prep): 
     1335\begin{align*} 
     1336F_{cri}(i,j,k) &\propto e^{-h_{ab} / h_{cri} }\\ 
     1337F_{pyc}(i,j,k) &\propto N^{n\_p}\\ 
     1338F_{bot}(i,j,k) &\propto N^2 \, e^{- h_{wkb} / h_{bot} } 
     1339\end{align*}  
     1340In the above formula, $h_{ab}$ denotes the height above bottom,  
     1341$h_{wkb}$ denotes the WKB-stretched height above bottom, defined by 
     1342\begin{equation*} 
     1343h_{wkb} = H \, \frac{ \int_{-H}^{z} N \, dz' } { \int_{-H}^{\eta} N \, dz'  } \; , 
     1344\end{equation*} 
     1345The $n_p$ parameter (given by \np{nn\_zpyc} in \ngn{namzdf\_tmx\_new} namelist)  controls the stratification-dependence of the pycnocline-intensified dissipation.  
     1346It can take values of 1 (recommended) or 2. 
     1347Finally, the vertical structures $F_{cri}$ and $F_{bot}$ require the specification of  
     1348the decay scales $h_{cri}(i,j)$ and $h_{bot}(i,j)$, which are defined by two additional input maps.  
     1349$h_{cri}$ is related to the large-scale topography of the ocean (etopo2)  
     1350and $h_{bot}$ is a function of the energy flux $E_{bot}$, the characteristic horizontal scale of  
     1351the abyssal hill topography \citep{Goff_JGR2010} and the latitude. 
     1352 
     1353% ================================================================ 
     1354 
     1355 
     1356 
  • trunk/NEMOGCM/CONFIG/SHARED/namelist_ref

    r6489 r6497  
    33!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    44!! NEMO/OPA  :  1 - run manager      (namrun) 
    5 !! namelists    2 - Domain           (namcfg, namzgr, namzgr_sco, namdom, namtsd) 
     5!! namelists    2 - Domain           (namcfg, namzgr, namzgr_sco, namdom, namtsd, namcrs, namc1d, namc1d_uvd) 
    66!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas 
    77!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf, 
     
    5959!!====================================================================== 
    6060!!   namcfg       parameters of the configuration 
    61 !!   namzgr       vertical coordinate 
     61!!   namzgr       vertical coordinate                                   (default: NO selection) 
    6262!!   namzgr_sco   s-coordinate or hybrid z-s-coordinate 
    6363!!   namdom       space and time domain (bathymetry, mesh, timestep) 
     64!!   namwad       Wetting and drying                                    (default F) 
     65!!   namtsd       data: temperature & salinity 
    6466!!   namcrs       coarsened grid (for outputs and/or TOP)               ("key_crs") 
    6567!!   namc1d       1D configuration options                              ("key_c1d") 
     68!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d") 
    6669!!   namc1d_uvd   1D data (currents)                                    ("key_c1d") 
    67 !!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d") 
    68 !!   namtsd       data: temperature & salinity 
    6970!!====================================================================== 
    7071! 
     
    101102/ 
    102103!----------------------------------------------------------------------- 
    103 &namzgr_sco    !   s-coordinate or hybrid z-s-coordinate 
     104&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate                (default F) 
    104105!----------------------------------------------------------------------- 
    105106   ln_s_sh94   = .false.    !  Song & Haidvogel 1994 hybrid S-sigma   (T)| 
     
    165166/ 
    166167!----------------------------------------------------------------------- 
     168&namwad        !   Wetting and drying                                   (default F) 
     169!----------------------------------------------------------------------- 
     170   ln_wd       = .false.   !  T/F activation of wetting and drying 
     171   rn_wdmin1   =  0.1      !  Minimum wet depth on dried cells 
     172   rn_wdmin2   =  0.01     !  Tolerance of min wet depth on dried cells 
     173   rn_wdld     =  20.0     !  Land elevation below which wetting/drying is allowed 
     174   nn_wdit     =  10       !  Max iterations for W/D limiter 
     175/ 
     176!----------------------------------------------------------------------- 
     177&namtsd        !   data : Temperature  & Salinity 
     178!----------------------------------------------------------------------- 
     179!              !  file name                 ! frequency (hours) ! variable ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     180!              !                            !  (if <0  months)  !   name   !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     181   sn_tem = 'data_1m_potential_temperature_nomask',     -1      ,'votemper',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     182   sn_sal = 'data_1m_salinity_nomask'             ,     -1      ,'vosaline',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     183   ! 
     184   cn_dir      = './'      !  root directory for the location of the runoff files 
     185   ln_tsd_init = .true.    !  Initialisation of ocean T & S with T & S input data (T) or not (F) 
     186   ln_tsd_tradmp = .true.  !  damping of ocean T & S toward T & S input data (T) or not (F) 
     187/ 
     188!----------------------------------------------------------------------- 
    167189&namcrs        !   coarsened grid (for outputs and/or TOP)              ("key_crs") 
    168190!----------------------------------------------------------------------- 
     
    202224   ln_uvd_init   = .false. !  Initialisation of ocean U & V with U & V input data (T) or not (F) 
    203225   ln_uvd_dyndmp = .false. !  damping of ocean U & V toward U & V input data (T) or not (F) 
    204 / 
    205 !----------------------------------------------------------------------- 
    206 &namtsd    !   data : Temperature  & Salinity 
    207 !----------------------------------------------------------------------- 
    208 !          !  file name                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    209 !          !                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    210    sn_tem  = 'data_1m_potential_temperature_nomask',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'   , ''       ,   ''    ,    '' 
    211    sn_sal  = 'data_1m_salinity_nomask'             ,         -1        ,'vosaline' ,    .true.    , .true. , 'yearly'   , ''       ,   ''    ,    '' 
    212    ! 
    213    cn_dir        = './'     !  root directory for the location of the runoff files 
    214    ln_tsd_init   = .true.   !  Initialisation of ocean T & S with T &S input data (T) or not (F) 
    215    ln_tsd_tradmp = .true.   !  damping of ocean T & S toward T &S input data (T) or not (F) 
    216226/ 
    217227 
     
    278288   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr ) 
    279289   ln_isf      = .false.   !  ice shelf                                 (T   => fill namsbc_isf) 
    280    ln_wave = .false.       !  coupling with surface wave                (T => fill namsbc_wave) 
    281    nn_lsm  = 0             !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 
     290   ln_wave     = .false.   !  coupling with surface wave                (T => fill namsbc_wave) 
     291   nn_lsm      = 0         !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 
    282292                           !  =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field) 
    283293/ 
     
    382392   sn_rcv_co2    =   'coupled'              ,    'no'    ,     ''      ,         ''          ,   '' 
    383393! 
    384    nn_cplmodel   =     1     !  Maximum number of models to/from which NEMO is potentialy sending/receiving data 
    385    ln_usecplmask = .false.   !  use a coupling mask file to merge data received from several models 
    386                              !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 
     394   nn_cplmodel   =     1   !  Maximum number of models to/from which NEMO is potentialy sending/receiving data 
     395   ln_usecplmask = .false. !  use a coupling mask file to merge data received from several models 
     396   !                       !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 
    387397/ 
    388398!----------------------------------------------------------------------- 
    389399&namsbc_sas    !   analytical surface boundary condition 
    390400!----------------------------------------------------------------------- 
    391 !              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    392 !              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    393    sn_usp      = 'sas_grid_U' ,    120           , 'vozocrtx' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    394    sn_vsp      = 'sas_grid_V' ,    120           , 'vomecrty' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    395    sn_tem      = 'sas_grid_T' ,    120           , 'sosstsst' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    396    sn_sal      = 'sas_grid_T' ,    120           , 'sosaline' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    397    sn_ssh      = 'sas_grid_T' ,    120           , 'sossheig' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    398    sn_e3t      = 'sas_grid_T' ,    120           , 'e3t_m'    ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    399    sn_frq      = 'sas_grid_T' ,    120           , 'frq_m'    ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
     401!              !  file name  ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     402!              !             !  (if <0  months)  !   name    !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     403   sn_usp      = 'sas_grid_U',     120           , 'vozocrtx',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     404   sn_vsp      = 'sas_grid_V',     120           , 'vomecrty',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     405   sn_tem      = 'sas_grid_T',     120           , 'sosstsst',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     406   sn_sal      = 'sas_grid_T',     120           , 'sosaline',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     407   sn_ssh      = 'sas_grid_T',     120           , 'sossheig',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     408   sn_e3t      = 'sas_grid_T',     120           , 'e3t_m'   ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     409   sn_frq      = 'sas_grid_T',     120           , 'frq_m'   ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    400410 
    401411   ln_3d_uve   = .true.    !  specify whether we are supplying a 3D u,v and e3 field 
    402    ln_read_frq = .false.    !  specify whether we must read frq or not 
     412   ln_read_frq = .false.   !  specify whether we must read frq or not 
    403413   cn_dir      = './'      !  root directory for the location of the bulk files are 
    404414/ 
     
    431441   sn_dep_rnf  = 'runoffs'            ,         0         , 'rodepth' ,   .false.    , .true. , 'yearly'  , ''       , ''       , '' 
    432442 
    433    cn_dir       = './'      !  root directory for the location of the runoff files 
    434    ln_rnf_mouth = .true.    !  specific treatment at rivers mouths 
    435    rn_hrnf      =  15.e0    !  depth over which enhanced vertical mixing is used 
    436    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s] 
    437    rn_rfact     =   1.e0    !  multiplicative factor for runoff 
    438    ln_rnf_depth = .false.   !  read in depth information for runoff 
    439    ln_rnf_tem   = .false.   !  read in temperature information for runoff 
    440    ln_rnf_sal   = .false.   !  read in salinity information for runoff 
    441    ln_rnf_depth_ini = .false.  ! compute depth at initialisation from runoff file 
    442    rn_rnf_max   = 5.735e-4  !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true ) 
    443    rn_dep_max   = 150.      !  depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
    444    nn_rnf_depth_file = 0    !  create (=1) a runoff depth file or not (=0) 
     443   cn_dir      = './'      !  root directory for the location of the runoff files 
     444   ln_rnf_mouth= .true.    !  specific treatment at rivers mouths 
     445      rn_hrnf     =  15.e0    !  depth over which enhanced vertical mixing is used    (ln_rnf_mouth=T) 
     446      rn_avt_rnf  =   1.e-3   !  value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T) 
     447   rn_rfact    =   1.e0    !  multiplicative factor for runoff 
     448   ln_rnf_depth= .false.   !  read in depth information for runoff 
     449   ln_rnf_tem  = .false.   !  read in temperature information for runoff 
     450   ln_rnf_sal  = .false.   !  read in salinity information for runoff 
     451   ln_rnf_depth_ini = .false. ! compute depth at initialisation from runoff file 
     452      rn_rnf_max  = 5.735e-4  !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true ) 
     453      rn_dep_max  = 150.      !  depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
     454      nn_rnf_depth_file = 0   !  create (=1) a runoff depth file or not (=0) 
    445455/ 
    446456!----------------------------------------------------------------------- 
    447457&namsbc_isf    !  Top boundary layer (ISF)                              (nn_isf >0) 
    448458!----------------------------------------------------------------------- 
    449 !              ! file name ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    450 !              !           !  (if <0  months)  !   name   !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     459!              ! file name ! frequency (hours) ! variable ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     460!              !           !  (if <0  months)  !   name   !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    451461! nn_isf == 4 
    452    sn_fwfisf   = 'rnfisf'  ,         -12       ,'sowflisf',   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
     462   sn_fwfisf   = 'rnfisf'  ,         -12       ,'sowflisf',   .false.   , .true. , 'yearly'  ,    ''    ,   ''     ,    '' 
    453463! nn_isf == 3 
    454    sn_rnfisf   = 'rnfisf'  ,         -12       ,'sofwfisf',   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
     464   sn_rnfisf   = 'rnfisf'  ,         -12       ,'sofwfisf',   .false.   , .true. , 'yearly'  ,    ''    ,   ''     ,    '' 
    455465! nn_isf == 2 and 3 
    456    sn_depmax_isf='rnfisf'  ,         -12       ,'sozisfmax',  .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    457    sn_depmin_isf='rnfisf'  ,         -12       ,'sozisfmin',  .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
     466   sn_depmax_isf='rnfisf'  ,         -12       ,'sozisfmax',  .false.   , .true. , 'yearly'  ,    ''    ,   ''     ,    '' 
     467   sn_depmin_isf='rnfisf'  ,         -12       ,'sozisfmin',  .false.   , .true. , 'yearly'  ,    ''    ,   ''     ,    '' 
    458468! nn_isf == 2 
    459    sn_Leff_isf = 'rnfisf'  ,         -12       ,'Leff'    ,   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
     469   sn_Leff_isf = 'rnfisf'  ,         -12       ,'Leff'    ,   .false.   , .true. , 'yearly'  ,    ''    ,   ''     ,    '' 
    460470! 
    461471! for all case 
     
    465475                           !  option 1 and 4 need ln_isfcav = .true. (domzgr) 
    466476! only for nn_isf = 1 or 2 
    467    rn_gammat0  = 1.e-4    ! gammat coefficient used in blk formula 
    468    rn_gammas0  = 1.e-4    ! gammas coefficient used in blk formula 
     477   rn_gammat0  = 1.e-4     ! gammat coefficient used in blk formula 
     478   rn_gammas0  = 1.e-4     ! gammas coefficient used in blk formula 
    469479! only for nn_isf = 1 or 4 
    470480   rn_hisf_tbl =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
    471                           ! 0 => thickness of the tbl = thickness of the first wet cell 
     481   !                       ! 0 => thickness of the tbl = thickness of the first wet cell 
    472482! only for nn_isf = 1 
    473    nn_isfblk   = 1        ! 1 ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
    474                           ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
    475    nn_gammablk = 1        ! 0 = cst Gammat (= gammat/s) 
    476                           ! 1 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
    477                           ! 2 = velocity and stability dependent Gamma    (Holland et al. 1999) 
     483   nn_isfblk   = 1         ! 1 ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
     484   !                       ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
     485   nn_gammablk = 1         ! 0 = cst Gammat (= gammat/s) 
     486   !                       ! 1 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
     487   !                       ! 2 = velocity and stability dependent Gamma    (Holland et al. 1999) 
    478488/ 
    479489!----------------------------------------------------------------------- 
    480490&namsbc_iscpl  !   land ice / ocean coupling option                      
    481491!----------------------------------------------------------------------- 
    482    nn_drown  = 10       ! number of iteration of the extrapolation loop (fill the new wet cells) 
    483    ln_hsb    = .false.  ! activate conservation module (conservation exact after a time of rn_fiscpl) 
    484    nn_fiscpl = 43800    ! (number of time step) conservation period (maybe should be fix to the coupling frequencey of restart frequency) 
     492   nn_drown    = 10        ! number of iteration of the extrapolation loop (fill the new wet cells) 
     493   ln_hsb      = .false.   ! activate conservation module (conservation exact after a time of rn_fiscpl) 
     494   nn_fiscpl   = 43800     ! (number of time step) conservation period (maybe should be fix to the coupling frequencey of restart frequency) 
    485495/ 
    486496!----------------------------------------------------------------------- 
    487497&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk 
    488498!----------------------------------------------------------------------- 
    489 !              !  file name ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    490 !              !            !  (if <0  months)  !   name    !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    491    sn_apr      = 'patm'     ,         -1        ,'somslpre',    .true.     , .true. , 'yearly'  ,  ''      ,   ''     , '' 
    492  
    493    cn_dir      = './'       !  root directory for the location of the bulk files 
    494    rn_pref     = 101000.    !  reference atmospheric pressure   [N/m2]/ 
    495    ln_ref_apr  = .false.    !  ref. pressure: global mean Patm (T) or a constant (F) 
    496    ln_apr_obc  = .false.    !  inverse barometer added to OBC ssh data 
     499!              ! file name ! frequency (hours) ! variable ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     500!              !           !  (if <0  months)  !   name   !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     501   sn_apr      = 'patm'    ,         -1        ,'somslpre',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,      '' 
     502 
     503   cn_dir      = './'      !  root directory for the location of the bulk files 
     504   rn_pref     = 101000.   !  reference atmospheric pressure   [N/m2]/ 
     505   ln_ref_apr  = .false.   !  ref. pressure: global mean Patm (T) or a constant (F) 
     506   ln_apr_obc  = .false.   !  inverse barometer added to OBC ssh data 
    497507/ 
    498508!----------------------------------------------------------------------- 
    499509&namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr=T) 
    500510!----------------------------------------------------------------------- 
    501 !              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    502 !              !             !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    503    sn_sst      = 'sst_data'  ,        24         ,  'sst'    ,    .false.   , .false., 'yearly'  , ''       , ''       , '' 
    504    sn_sss      = 'sss_data'  ,        -1         ,  'sss'    ,    .true.    , .true. , 'yearly'  , ''       , ''       , '' 
     511!              ! file name ! frequency (hours) ! variable ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     512!              !           !  (if <0  months)  !   name   !   (logical) !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     513   sn_sst      = 'sst_data',        24         ,  'sst'   ,    .false.  , .false., 'yearly'  ,    ''    ,    ''    ,    '' 
     514   sn_sss      = 'sss_data',        -1         ,  'sss'   ,    .true.   , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    505515 
    506516   cn_dir      = './'      !  root directory for the location of the runoff files 
     
    510520   rn_dqdt     =   -40.    !  magnitude of the retroaction on temperature   [W/m2/K] 
    511521   rn_deds     =  -166.67  !  magnitude of the damping on salinity   [mm/day] 
    512    ln_sssr_bnd =   .true.  !  flag to bound erp term (associated with nn_sssr=2) 
     522   ln_sssr_bnd =  .true.   !  flag to bound erp term (associated with nn_sssr=2) 
    513523   rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day] 
    514524/ 
     
    516526&namsbc_alb    !   albedo parameters 
    517527!----------------------------------------------------------------------- 
    518    nn_ice_alb  =    0   !  parameterization of ice/snow albedo 
    519                         !     0: Shine & Henderson-Sellers (JGR 1985) 
    520                         !     1: "home made" based on Brandt et al. (J. Climate 2005) 
    521                         !                         and Grenfell & Perovich (JGR 2004) 
    522    rn_albice   =  0.53  !  albedo of bare puddled ice (values from 0.49 to 0.58) 
    523                         !     0.53 (default) => if nn_ice_alb=0 
    524                         !     0.50 (default) => if nn_ice_alb=1 
     528   nn_ice_alb  =    0      !  parameterization of ice/snow albedo 
     529                           !     0: Shine & Henderson-Sellers (JGR 1985) 
     530                           !     1: "home made" based on Brandt et al. (J. Climate 2005) 
     531                           !                         and Grenfell & Perovich (JGR 2004) 
     532   rn_albice   =  0.53     !  albedo of bare puddled ice (values from 0.49 to 0.58) 
     533                           !     0.53 (default) => if nn_ice_alb=0 
     534                           !     0.50 (default) => if nn_ice_alb=1 
    525535/ 
    526536!----------------------------------------------------------------------- 
    527537&namsbc_wave   ! External fields from wave model                        (ln_wave=T) 
    528538!----------------------------------------------------------------------- 
    529 !              !  file name  ! frequency (hours) ! variable    ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    530 !              !             !  (if <0  months)  !   name      !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    531    sn_cdg      =  'cdg_wave' ,        1          , 'drag_coeff',     .true.   , .false., 'daily'   ,  ''      , ''       , '' 
    532    sn_usd      =  'sdw_wave' ,        1          , 'u_sd2d'    ,     .true.   , .false., 'daily'   ,  ''      , ''       , '' 
    533    sn_vsd      =  'sdw_wave' ,        1          , 'v_sd2d'    ,     .true.   , .false., 'daily'   ,  ''      , ''       , '' 
    534    sn_wn       =  'sdw_wave' ,        1          , 'wave_num'  ,     .true.   , .false., 'daily'   ,  ''      , ''       , '' 
     539!              ! file name ! frequency (hours) ! variable    ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     540!              !           !  (if <0  months)  !   name      !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
     541   sn_cdg      = 'cdg_wave',        1          , 'drag_coeff',   .true.    , .false., 'daily'   ,    ''      , ''       , '' 
     542   sn_usd      = 'sdw_wave',        1          , 'u_sd2d'    ,   .true.    , .false., 'daily'   ,    ''      , ''       , '' 
     543   sn_vsd      = 'sdw_wave',        1          , 'v_sd2d'    ,   .true.    , .false., 'daily'   ,    ''      , ''       , '' 
     544   sn_wn       = 'sdw_wave',        1          , 'wave_num'  ,   .true.    , .false., 'daily'   ,    ''      , ''       , '' 
    535545! 
    536546   cn_dir_cdg  = './'      !  root directory for the location of drag coefficient files 
    537    ln_cdgw = .false.       !  Neutral drag coefficient read from wave model 
    538    ln_sdw  = .false.       !  Computation of 3D stokes drift                
     547   ln_cdgw     = .false.   !  Neutral drag coefficient read from wave model 
     548   ln_sdw      = .false.   !  Computation of 3D stokes drift                
    539549/ 
    540550!----------------------------------------------------------------------- 
     
    566576      rn_speed_limit           = 0.                   ! CFL speed limit for a berg 
    567577 
    568 !            ! file name ! frequency (hours) !   variable   ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    569 !            !           !  (if <0  months)  !     name     !   (logical)  !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
    570       sn_icb =  'calving',       -1          , 'calvingmask',  .true.      , .true.  , 'yearly'  , ''       , ''       , '' 
     578!            ! file name ! frequency (hours) !   variable   ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     579!            !           !  (if <0  months)  !     name     !  (logical)  !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
     580      sn_icb =  'calving',       -1          , 'calvingmask',   .true.    , .true.  , 'yearly'  ,    ''    ,    ''    ,    '' 
    571581 
    572582      cn_dir = './' 
     
    577587!!====================================================================== 
    578588!!   namlbc        lateral momentum boundary condition 
    579 !!   namobc        open boundaries parameters                           ("key_obc") 
    580589!!   namagrif      agrif nested grid ( read by child model only )       ("key_agrif") 
     590!!   nam_tide      Tidal forcing  
    581591!!   nambdy        Unstructured open boundaries                         ("key_bdy") 
    582 !!   namtide       Tidal forcing at open boundaries                     ("key_bdy_tides") 
     592!!   nambdy_dta    Unstructured open boundaries - external data         ("key_bdy") 
     593!!   nambdy_tide   tidal forcing at open boundaries                     ("key_bdy_tides") 
    583594!!====================================================================== 
    584595! 
     
    602613&nam_tide      !   tide parameters                                      ("key_tide") 
    603614!----------------------------------------------------------------------- 
    604    ln_tide_pot   = .true.   !  use tidal potential forcing 
    605    ln_tide_ramp  = .false.  ! 
    606    rdttideramp   =    0.    ! 
    607    clname(1)     = 'DUMMY'  !  name of constituent - all tidal components must be set in namelist_cfg 
     615   ln_tide_pot = .true.    !  use tidal potential forcing 
     616   ln_tide_ramp= .false.   ! 
     617   rdttideramp =    0.     ! 
     618   clname(1)   = 'DUMMY'   !  name of constituent - all tidal components must be set in namelist_cfg 
    608619/ 
    609620!----------------------------------------------------------------------- 
     
    644655&nambdy_dta    !  open boundaries - external data                       ("key_bdy") 
    645656!----------------------------------------------------------------------- 
    646 !              !  file name      ! frequency (hours) ! variable  ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    647 !              !                 !  (if <0  months)  !   name    !  (logical)   !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
    648    bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    649    bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    650    bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    651    bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    652    bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    653    bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    654    bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
     657!              !  file name      ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     658!              !                 !  (if <0  months)  !   name    !  (logical)  !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
     659   bn_ssh      = 'amm12_bdyT_u2d',         24        , 'sossheig',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     660   bn_u2d      = 'amm12_bdyU_u2d',         24        , 'vobtcrtx',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     661   bn_v2d      = 'amm12_bdyV_u2d',         24        , 'vobtcrty',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     662   bn_u3d      = 'amm12_bdyU_u3d',         24        , 'vozocrtx',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     663   bn_v3d      = 'amm12_bdyV_u3d',         24        , 'vomecrty',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     664   bn_tem      = 'amm12_bdyT_tra',         24        , 'votemper',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     665   bn_sal      = 'amm12_bdyT_tra',         24        , 'vosaline',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
    655666! for lim2 
    656 !   bn_frld  =   'amm12_bdyT_ice' ,         24        , 'ileadfra',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    657 !   bn_hicif =   'amm12_bdyT_ice' ,         24        , 'iicethic',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    658 !   bn_hsnif =   'amm12_bdyT_ice' ,         24        , 'isnowthi',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
     667!   bn_frld    = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     668!   bn_hicif   = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     669!   bn_hsnif   = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
    659670! for lim3 
    660 !   bn_a_i  =    'amm12_bdyT_ice' ,         24        , 'ileadfra',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    661 !   bn_ht_i =    'amm12_bdyT_ice' ,         24        , 'iicethic',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    662 !   bn_ht_s =    'amm12_bdyT_ice' ,         24        , 'isnowthi',     .true.   , .false. ,  'daily'  ,    ''    ,   ''     , '' 
    663  
    664    cn_dir      =    'bdydta/'  !  root directory for the location of the bulk files 
    665    ln_full_vel = .false.         
    666 / 
    667 !----------------------------------------------------------------------- 
    668 &nambdy_tide     ! tidal forcing at open boundaries 
     671!   bn_a_i     = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     672!   bn_ht_i    = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     673!   bn_ht_s    = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,    '' 
     674 
     675   cn_dir      = 'bdydta/' !  root directory for the location of the bulk files 
     676   ln_full_vel = .false.    
     677/ 
     678!----------------------------------------------------------------------- 
     679&nambdy_tide   ! tidal forcing at open boundaries 
    669680!----------------------------------------------------------------------- 
    670681   filtide          = 'bdydta/amm12_bdytide_'   !  file name root of tidal forcing files 
     
    672683   ln_bdytide_conj  = .false.                   !  
    673684/ 
     685 
    674686!!====================================================================== 
    675687!!                 ***  Bottom boundary condition  *** 
     
    687699   rn_bfri1    =    4.e-4  !  bottom drag coefficient (linear case) 
    688700   rn_bfri2    =    1.e-3  !  bottom drag coefficient (non linear case). Minimum coeft if ln_loglayer=T 
    689    rn_bfri2_max =   1.e-1  !  max. bottom drag coefficient (non linear case and ln_loglayer=T) 
     701   rn_bfri2_max=    1.e-1  !  max. bottom drag coefficient (non linear case and ln_loglayer=T) 
    690702   rn_bfeb2    =    2.5e-3 !  bottom turbulent kinetic energy background  (m2/s2) 
    691703   rn_bfrz0    =    3.e-3  !  bottom roughness [m] if ln_loglayer=T 
     
    694706   rn_tfri1    =    4.e-4  !  top drag coefficient (linear case) 
    695707   rn_tfri2    =    2.5e-3 !  top drag coefficient (non linear case). Minimum coeft if ln_loglayer=T 
    696    rn_tfri2_max =   1.e-1  !  max. top drag coefficient (non linear case and ln_loglayer=T) 
     708   rn_tfri2_max=    1.e-1  !  max. top drag coefficient (non linear case and ln_loglayer=T) 
    697709   rn_tfeb2    =    0.0    !  top turbulent kinetic energy background  (m2/s2) 
    698710   rn_tfrz0    =    3.e-3  !  top roughness [m] if ln_loglayer=T 
    699711   ln_tfr2d    = .false.   !  horizontal variation of the top friction coef (read a 2D mask file ) 
    700    rn_tfrien   =    50.    !  local multiplying factor of tfr (ln_tfr2d=T) 
     712   rn_tfrien   =   50.     !  local multiplying factor of tfr (ln_tfr2d=T) 
    701713 
    702714   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
     
    720732&nambbl        !   bottom boundary layer scheme                         ("key_trabbl") 
    721733!----------------------------------------------------------------------- 
    722    nn_bbl_ldf  =  1      !  diffusive bbl (=1)   or not (=0) 
    723    nn_bbl_adv  =  0      !  advective bbl (=1/2) or not (=0) 
    724    rn_ahtbbl   =  1000.  !  lateral mixing coefficient in the bbl  [m2/s] 
    725    rn_gambbl   =  10.    !  advective bbl coefficient                 [s] 
     734   nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0) 
     735   nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0) 
     736   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s] 
     737   rn_gambbl   =  10.      !  advective bbl coefficient                 [s] 
    726738/ 
    727739 
     
    744756   ln_seos     = .false.         !  = Use simplified equation of state (S-EOS) 
    745757                                 ! 
    746    !                     ! S-EOS coefficients : 
    747                                  !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
     758   !                     ! S-EOS coefficients (ln_seos=T): 
     759   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    748760   rn_a0       =  1.6550e-1      !  thermal expension coefficient (nn_eos= 1) 
    749761   rn_b0       =  7.6554e-1      !  saline  expension coefficient (nn_eos= 1) 
     
    757769&namtra_adv    !   advection scheme for tracer                          (default: NO advection) 
    758770!----------------------------------------------------------------------- 
    759    ln_traadv_cen =  .false. !  2nd order centered scheme 
    760       nn_cen_h   =  4               !  =2/4, horizontal 2nd order CEN / 4th order CEN 
    761       nn_cen_v   =  4               !  =2/4, vertical   2nd order CEN / 4th order COMPACT 
    762    ln_traadv_fct =  .false. !  FCT scheme 
    763       nn_fct_h   =  2               !  =2/4, horizontal 2nd / 4th order  
    764       nn_fct_v   =  2               !  =2/4, vertical   2nd / COMPACT 4th order  
    765       nn_fct_zts =  0               !  >=1,  2nd order FCT scheme with vertical sub-timestepping 
    766       !                             !        (number of sub-timestep = nn_fct_zts) 
    767    ln_traadv_mus =  .false. !  MUSCL scheme 
    768       ln_mus_ups =  .false.         !  use upstream scheme near river mouths 
    769    ln_traadv_ubs =  .false. !  UBS scheme 
    770       nn_ubs_v   =  2               !  =2  , vertical 2nd order FCT / COMPACT 4th order 
    771    ln_traadv_qck =  .false. !  QUICKEST scheme 
     771   ln_traadv_cen = .false. !  2nd order centered scheme 
     772      nn_cen_h   =  4            !  =2/4, horizontal 2nd order CEN / 4th order CEN 
     773      nn_cen_v   =  4            !  =2/4, vertical   2nd order CEN / 4th order COMPACT 
     774   ln_traadv_fct = .false. !  FCT scheme 
     775      nn_fct_h   =  2            !  =2/4, horizontal 2nd / 4th order  
     776      nn_fct_v   =  2            !  =2/4, vertical   2nd / COMPACT 4th order  
     777      nn_fct_zts =  0            !  >=1,  2nd order FCT scheme with vertical sub-timestepping 
     778      !                          !        (number of sub-timestep = nn_fct_zts) 
     779   ln_traadv_mus = .false. !  MUSCL scheme 
     780      ln_mus_ups = .false.       !  use upstream scheme near river mouths 
     781   ln_traadv_ubs = .false. !  UBS scheme 
     782      nn_ubs_v   =  2            !  =2  , vertical 2nd order FCT / COMPACT 4th order 
     783   ln_traadv_qck = .false. !  QUICKEST scheme 
    772784/ 
    773785!----------------------------------------------------------------------- 
    774786&namtra_adv_mle !   mixed layer eddy parametrisation (Fox-Kemper param) (default: NO) 
    775787!----------------------------------------------------------------------- 
    776    ln_mle    = .false.      ! (T) use the Mixed Layer Eddy (MLE) parameterisation 
    777    rn_ce     = 0.06        ! magnitude of the MLE (typical value: 0.06 to 0.08) 
    778    nn_mle    = 1           ! MLE type: =0 standard Fox-Kemper ; =1 new formulation 
    779    rn_lf     = 5.e+3       ! typical scale of mixed layer front (meters)                      (case rn_mle=0) 
    780    rn_time   = 172800.     ! time scale for mixing momentum across the mixed layer (seconds)  (case rn_mle=0) 
    781    rn_lat    = 20.         ! reference latitude (degrees) of MLE coef.                        (case rn_mle=1) 
    782    nn_mld_uv = 0           ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max) 
    783    nn_conv   = 0           ! =1 no MLE in case of convection ; =0 always MLE 
    784    rn_rho_c_mle  = 0.01    ! delta rho criterion used to calculate MLD for FK 
     788   ln_mle      = .false.   ! (T) use the Mixed Layer Eddy (MLE) parameterisation 
     789   rn_ce       = 0.06      ! magnitude of the MLE (typical value: 0.06 to 0.08) 
     790   nn_mle      = 1         ! MLE type: =0 standard Fox-Kemper ; =1 new formulation 
     791   rn_lf       = 5.e+3     ! typical scale of mixed layer front (meters)                      (case rn_mle=0) 
     792   rn_time     = 172800.   ! time scale for mixing momentum across the mixed layer (seconds)  (case rn_mle=0) 
     793   rn_lat      = 20.       ! reference latitude (degrees) of MLE coef.                        (case rn_mle=1) 
     794   nn_mld_uv   = 0         ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max) 
     795   nn_conv     = 0         ! =1 no MLE in case of convection ; =0 always MLE 
     796   rn_rho_c_mle= 0.01      ! delta rho criterion used to calculate MLD for FK 
    785797/ 
    786798!----------------------------------------------------------------------- 
     
    791803   ln_traldf_lap   =  .false.  !    laplacian operator 
    792804   ln_traldf_blp   =  .false.  !  bilaplacian operator 
     805   ! 
    793806   !                       !  Direction of action: 
    794807   ln_traldf_lev   =  .false.  !  iso-level 
     
    866879   ln_vvl_layer  = .false.          !  full layer vertical coordinate 
    867880   ln_vvl_ztilde_as_zstar = .false. !  ztilde vertical coordinate emulating zstar 
    868    ln_vvl_zstar_at_eqtor = .false. !  ztilde near the equator 
     881   ln_vvl_zstar_at_eqtor  = .false. !  ztilde near the equator 
    869882   rn_ahe3       = 0.0e0            !  thickness diffusion coefficient 
    870883   rn_rst_e3t    = 30.e0            !  ztilde to zstar restoration timescale [days] 
     
    874887/ 
    875888!----------------------------------------------------------------------- 
    876 &namdyn_vor    !   option of physics/algorithm                          (default: NO) 
     889&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO) 
    877890!----------------------------------------------------------------------- 
    878891   ln_dynvor_ene = .false. !  enstrophy conserving scheme 
     
    953966   nn_havtb    =    0      !  horizontal shape for avtb (=1) or not (=0) 
    954967   ln_zdfevd   = .true.    !  enhanced vertical diffusion (evd) (T) or not (F) 
    955    nn_evdm     =    0      ! evd apply on tracer (=0) or on tracer and momentum (=1) 
    956    rn_avevd    =  100.     !  evd mixing coefficient [m2/s] 
     968      nn_evdm     =    0        ! evd apply on tracer (=0) or on tracer and momentum (=1) 
     969      rn_avevd    =  100.       !  evd mixing coefficient [m2/s] 
    957970   ln_zdfnpc   = .false.   !  Non-Penetrative Convective algorithm (T) or not (F) 
    958    nn_npc      =    1            ! frequency of application of npc 
    959    nn_npcp     =  365            ! npc control print frequency 
     971      nn_npc      =    1        ! frequency of application of npc 
     972      nn_npcp     =  365        ! npc control print frequency 
    960973   ln_zdfexp   = .false.   !  time-stepping: split-explicit (T) or implicit (F) time stepping 
    961    nn_zdfexp   =    3            ! number of sub-timestep for ln_zdfexp=T 
     974      nn_zdfexp   =    3        ! number of sub-timestep for ln_zdfexp=T 
    962975/ 
    963976!----------------------------------------------------------------------- 
    964977&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" ) 
    965978!----------------------------------------------------------------------- 
    966    rn_avmri    = 100.e-4   !  maximum value of the vertical viscosity 
    967    rn_alp      =   5.      !  coefficient of the parameterization 
    968    nn_ric      =   2       !  coefficient of the parameterization 
    969    rn_ekmfc    =   0.7     !  Factor in the Ekman depth Equation 
    970    rn_mldmin   =   1.0     !  minimum allowable mixed-layer depth estimate (m) 
    971    rn_mldmax   =1000.0     !  maximum allowable mixed-layer depth estimate (m) 
    972    rn_wtmix    =  10.0     !  vertical eddy viscosity coeff [m2/s] in the mixed-layer 
    973    rn_wvmix    =  10.0     !  vertical eddy diffusion coeff [m2/s] in the mixed-layer 
    974    ln_mldw     = .true.    !  Flag to use or not the mixed layer depth param. 
     979   rn_avmri    =  100.e-4  !  maximum value of the vertical viscosity 
     980   rn_alp      =    5.     !  coefficient of the parameterization 
     981   nn_ric      =    2      !  coefficient of the parameterization 
     982   rn_ekmfc    =    0.7    !  Factor in the Ekman depth Equation 
     983   rn_mldmin   =    1.0    !  minimum allowable mixed-layer depth estimate (m) 
     984   rn_mldmax   = 1000.0    !  maximum allowable mixed-layer depth estimate (m) 
     985   rn_wtmix    =   10.0    !  vertical eddy viscosity coeff [m2/s] in the mixed-layer 
     986   rn_wvmix    =   10.0    !  vertical eddy diffusion coeff [m2/s] in the mixed-layer 
     987   ln_mldw     =  .true.   !  Flag to use or not the mixed layer depth param. 
    975988/ 
    976989!----------------------------------------------------------------------- 
     
    9921005   ln_lc       = .true.    !  Langmuir cell parameterisation (Axell 2002) 
    9931006   rn_lc       =   0.15    !  coef. associated to Langmuir cells 
    994    nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves 
     1007   nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to near intertial waves 
    9951008                           !        = 0 no penetration 
    9961009                           !        = 1 add a tke source below the ML 
    9971010                           !        = 2 add a tke source just at the base of the ML 
    998                            !        = 3 as = 1 applied on HF part of the stress    ("key_oasis3") 
     1011                           !        = 3 as = 1 applied on HF part of the stress           (ln_cpl=T) 
    9991012   rn_efr      =   0.05    !  fraction of surface tke value which penetrates below the ML (nn_etau=1 or 2) 
    10001013   nn_htau     =   1       !  type of exponential decrease of tke penetration below the ML 
     
    10031016/ 
    10041017!----------------------------------------------------------------------- 
    1005 &namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls") 
     1018&namzdf_gls    !   GLS vertical diffusion                               ("key_zdfgls") 
    10061019!----------------------------------------------------------------------- 
    10071020   rn_emin       = 1.e-7   !  minimum value of e   [m2/s2] 
     
    10361049   rn_tfe_itf  = 1.        !  ITF tidal dissipation efficiency 
    10371050/ 
     1051!----------------------------------------------------------------------- 
     1052&namzdf_tmx_new !   internal wave-driven mixing parameterization        ("key_zdftmx_new" & "key_zdfddm") 
     1053!----------------------------------------------------------------------- 
     1054   nn_zpyc     = 1         !  pycnocline-intensified dissipation scales as N (=1) or N^2 (=2) 
     1055   ln_mevar    = .true.    !  variable (T) or constant (F) mixing efficiency 
     1056   ln_tsdiff   = .true.    !  account for differential T/S mixing (T) or not (F) 
     1057/ 
     1058 
    10381059 
    10391060!!====================================================================== 
     
    10731094/ 
    10741095!----------------------------------------------------------------------- 
    1075 &namsto       ! Stochastic parametrization of EOS                       (default: NO) 
    1076 !----------------------------------------------------------------------- 
    1077    ln_sto_eos   = .false.  ! stochastic equation of state 
    1078    nn_sto_eos   = 1        ! number of independent random walks 
    1079    rn_eos_stdxy = 1.4      ! random walk horz. standard deviation (in grid points) 
    1080    rn_eos_stdz  = 0.7      ! random walk vert. standard deviation (in grid points) 
    1081    rn_eos_tcor  = 1440.    ! random walk time correlation (in timesteps) 
    1082    nn_eos_ord   = 1        ! order of autoregressive processes 
    1083    nn_eos_flt   = 0        ! passes of Laplacian filter 
    1084    rn_eos_lim   = 2.0      ! limitation factor (default = 3.0) 
    1085    ln_rststo    = .false.  ! start from mean parameter (F) or from restart file (T) 
    1086    ln_rstseed = .true.           ! read seed of RNG from restart file 
     1096&namsto        ! Stochastic parametrization of EOS                      (default: NO) 
     1097!----------------------------------------------------------------------- 
     1098   ln_sto_eos  = .false.   ! stochastic equation of state 
     1099   nn_sto_eos  = 1         ! number of independent random walks 
     1100   rn_eos_stdxy= 1.4       ! random walk horz. standard deviation (in grid points) 
     1101   rn_eos_stdz = 0.7       ! random walk vert. standard deviation (in grid points) 
     1102   rn_eos_tcor = 1440.     ! random walk time correlation (in timesteps) 
     1103   nn_eos_ord  = 1         ! order of autoregressive processes 
     1104   nn_eos_flt  = 0         ! passes of Laplacian filter 
     1105   rn_eos_lim  = 2.0       ! limitation factor (default = 3.0) 
     1106   ln_rststo   = .false.   ! start from mean parameter (F) or from restart file (T) 
     1107   ln_rstseed  = .true.    ! read seed of RNG from restart file 
    10871108   cn_storst_in  = "restart_sto" !  suffix of stochastic parameter restart file (input) 
    10881109   cn_storst_out = "restart_sto" !  suffix of stochastic parameter restart file (output) 
     
    10921113!!                  ***  Diagnostics namelists  *** 
    10931114!!====================================================================== 
    1094 !!   namtrd       dynamics and/or tracer trends 
    1095 !!   namptr       Poleward Transport Diagnostics 
    1096 !!   namhsb       Heat and salt budgets 
     1115!!   namtrd       dynamics and/or tracer trends                         (default F) 
     1116!!   namptr       Poleward Transport Diagnostics                        (default F) 
     1117!!   namhsb       Heat and salt budgets                                 (default F) 
     1118!!   namdiu       Cool skin and warm layer models                       (default F) 
    10971119!!   namflo       float parameters                                      ("key_float") 
    1098 !!   nam_diaharm  Harmonic analysis of tidal constituents               ('key_diaharm') 
    1099 !!   namdct       transports through some sections 
     1120!!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
     1121!!   namdct       transports through some sections                      ("key_diadct") 
     1122!!   nam_diatmb   Top Middle Bottom Output                              (default F) 
     1123!!   nam_dia25h   25h Mean Output                                       (default F) 
    11001124!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
    11011125!!====================================================================== 
    11021126! 
    11031127!----------------------------------------------------------------------- 
    1104 &namtrd        !   diagnostics on dynamics and/or tracer trends         (default F) 
    1105 !              !   and/or mixed-layer trends and/or barotropic vorticity 
     1128&namtrd        !   trend diagnostics                                    (default F) 
    11061129!----------------------------------------------------------------------- 
    11071130   ln_glo_trd  = .false.   ! (T) global domain averaged diag for T, T^2, KE, and PE 
     
    11231146!!gm 
    11241147!----------------------------------------------------------------------- 
    1125 &namptr       !   Poleward Transport Diagnostic                         (default F) 
    1126 !----------------------------------------------------------------------- 
    1127    ln_diaptr  = .false.    !  Poleward heat and salt transport (T) or not (F) 
    1128    ln_subbas  = .false.     !  Atlantic/Pacific/Indian basins computation (T) or not 
    1129 / 
    1130 !----------------------------------------------------------------------- 
    1131 &namhsb       !  Heat and salt budgets                                  (default F) 
    1132 !----------------------------------------------------------------------- 
    1133    ln_diahsb  = .false.    !  check the heat and salt budgets (T) or not (F) 
    1134 / 
    1135 !----------------------------------------------------------------------- 
    1136 &namflo       !   float parameters                                      ("key_float") 
    1137 !----------------------------------------------------------------------- 
    1138    jpnfl         = 1          !  total number of floats during the run 
    1139    jpnnewflo     = 0          !  number of floats for the restart 
    1140    ln_rstflo     = .false.    !  float restart (T) or not (F) 
    1141    nn_writefl    =      75    !  frequency of writing in float output file 
    1142    nn_stockfl    =    5475    !  frequency of creation of the float restart file 
    1143    ln_argo       = .false.    !  Argo type floats (stay at the surface each 10 days) 
    1144    ln_flork4     = .false.    !  trajectories computed with a 4th order Runge-Kutta (T) 
    1145                               !  or computed with Blanke' scheme (F) 
    1146    ln_ariane     = .true.     !  Input with Ariane tool convention(T) 
    1147    ln_flo_ascii  = .true.     !  Output with Ariane tool netcdf convention(F) or ascii file (T) 
    1148 / 
    1149 !----------------------------------------------------------------------- 
    1150 &nam_diaharm   !   Harmonic analysis of tidal constituents              ('key_diaharm') 
     1148&namptr        !   Poleward Transport Diagnostic                         (default F) 
     1149!----------------------------------------------------------------------- 
     1150   ln_diaptr   = .false.   !  Poleward heat and salt transport (T) or not (F) 
     1151   ln_subbas   = .false.   !  Atlantic/Pacific/Indian basins computation (T) or not 
     1152/ 
     1153!----------------------------------------------------------------------- 
     1154&namhsb        !  Heat and salt budgets                                  (default F) 
     1155!----------------------------------------------------------------------- 
     1156   ln_diahsb   = .false.   !  check the heat and salt budgets (T) or not (F) 
     1157/ 
     1158!----------------------------------------------------------------------- 
     1159&namdiu        !   Cool skin and warm layer models                       (default F) 
     1160!----------------------------------------------------------------------- 
     1161   ln_diurnal      = .false.   !  
     1162   ln_diurnal_only = .false.   ! 
     1163/ 
     1164!----------------------------------------------------------------------- 
     1165&namflo        !   float parameters                                      ("key_float") 
     1166!----------------------------------------------------------------------- 
     1167   jpnfl       = 1         !  total number of floats during the run 
     1168   jpnnewflo   = 0         !  number of floats for the restart 
     1169   ln_rstflo   = .false.   !  float restart (T) or not (F) 
     1170   nn_writefl  =      75   !  frequency of writing in float output file 
     1171   nn_stockfl  =    5475   !  frequency of creation of the float restart file 
     1172   ln_argo     = .false.   !  Argo type floats (stay at the surface each 10 days) 
     1173   ln_flork4   = .false.   !  trajectories computed with a 4th order Runge-Kutta (T) 
     1174   !                       !  or computed with Blanke' scheme (F) 
     1175   ln_ariane   = .true.    !  Input with Ariane tool convention(T) 
     1176   ln_flo_ascii= .true.    !  Output with Ariane tool netcdf convention(F) or ascii file (T) 
     1177/ 
     1178!----------------------------------------------------------------------- 
     1179&nam_diaharm   !   Harmonic analysis of tidal constituents               ("key_diaharm") 
    11511180!----------------------------------------------------------------------- 
    11521181    nit000_han = 1         ! First time step used for harmonic analysis 
     
    11571186/ 
    11581187!----------------------------------------------------------------------- 
    1159 &namdct        ! transports through some sections 
    1160 !----------------------------------------------------------------------- 
    1161     nn_dct      = 15       !  time step frequency for transports computing 
    1162     nn_dctwri   = 15       !  time step frequency for transports writing 
    1163     nn_secdebug = 112      !      0 : no section to debug 
    1164                            !     -1 : debug all section 
    1165                            !  0 < n : debug section number n 
    1166 / 
    1167 !----------------------------------------------------------------------- 
    1168 &namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4") 
     1188&namdct        ! transports through some sections                        ("key_diadct") 
     1189!----------------------------------------------------------------------- 
     1190    nn_dct     = 15        !  time step frequency for transports computing 
     1191    nn_dctwri  = 15        !  time step frequency for transports writing 
     1192    nn_secdebug= 112       !      0 : no section to debug 
     1193    !                      !     -1 : debug all section 
     1194    !                      !  0 < n : debug section number n 
     1195/ 
     1196!----------------------------------------------------------------------- 
     1197&nam_diatmb    !  Top Middle Bottom Output                               (default F) 
     1198!----------------------------------------------------------------------- 
     1199   ln_diatmb   = .false.   !  Choose Top Middle and Bottom output or not 
     1200/ 
     1201!----------------------------------------------------------------------- 
     1202&nam_dia25h    !  25h Mean Output                                        (default F) 
     1203!----------------------------------------------------------------------- 
     1204   ln_dia25h   = .false.   ! Choose 25h mean output or not 
     1205/ 
     1206!----------------------------------------------------------------------- 
     1207&namnc4        !   netcdf4 chunking and compression settings             ("key_netcdf4") 
    11691208!----------------------------------------------------------------------- 
    11701209   nn_nchunks_i=   4       !  number of chunks in i-dimension 
    11711210   nn_nchunks_j=   4       !  number of chunks in j-dimension 
    11721211   nn_nchunks_k=   31      !  number of chunks in k-dimension 
    1173                            !  setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which 
    1174                            !  is optimal for postprocessing which works exclusively with horizontal slabs 
     1212   !                       !  setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which 
     1213   !                       !  is optimal for postprocessing which works exclusively with horizontal slabs 
    11751214   ln_nc4zip   = .true.    !  (T) use netcdf4 chunking and compression 
    1176                            !  (F) ignore chunking information and produce netcdf3-compatible files 
     1215   !                       !  (F) ignore chunking information and produce netcdf3-compatible files 
    11771216/ 
    11781217 
     
    11851224! 
    11861225!----------------------------------------------------------------------- 
    1187 &namobs       !  observation usage switch 
    1188 !----------------------------------------------------------------------- 
    1189    ln_diaobs  = .false.             ! Logical switch for the observation operator 
    1190    ln_t3d     = .false.             ! Logical switch for T profile observations 
    1191    ln_s3d     = .false.             ! Logical switch for S profile observations 
    1192    ln_sla     = .false.             ! Logical switch for SLA observations 
    1193    ln_sst     = .false.             ! Logical switch for SST observations 
    1194    ln_sic     = .false.             ! Logical switch for Sea Ice observations 
    1195    ln_vel3d   = .false.             ! Logical switch for velocity observations 
    1196    ln_altbias = .false.             ! Logical switch for altimeter bias correction 
    1197    ln_nea     = .false.             ! Logical switch for rejection of observations near land 
    1198    ln_grid_global = .true.          ! Logical switch for global distribution of observations 
    1199    ln_grid_search_lookup = .false.  ! Logical switch for obs grid search w/lookup table 
    1200    ln_ignmis  = .true.              ! Logical switch for ignoring missing files 
    1201    ln_s_at_t  = .false.             ! Logical switch for computing model S at T obs if not there 
    1202    ln_sstnight = .false.            ! Logical switch for calculating night-time average for SST obs 
     1226&namobs        !  observation usage switch 
     1227!----------------------------------------------------------------------- 
     1228   ln_diaobs   = .false.             ! Logical switch for the observation operator 
     1229   ln_t3d      = .false.             ! Logical switch for T profile observations 
     1230   ln_s3d      = .false.             ! Logical switch for S profile observations 
     1231   ln_sla      = .false.             ! Logical switch for SLA observations 
     1232   ln_sst      = .false.             ! Logical switch for SST observations 
     1233   ln_sic      = .false.             ! Logical switch for Sea Ice observations 
     1234   ln_vel3d    = .false.             ! Logical switch for velocity observations 
     1235   ln_altbias  = .false.             ! Logical switch for altimeter bias correction 
     1236   ln_nea      = .false.             ! Logical switch for rejection of observations near land 
     1237   ln_grid_global = .true.           ! Logical switch for global distribution of observations 
     1238   ln_grid_search_lookup = .false.   ! Logical switch for obs grid search w/lookup table 
     1239   ln_ignmis   = .true.              ! Logical switch for ignoring missing files 
     1240   ln_s_at_t   = .false.             ! Logical switch for computing model S at T obs if not there 
     1241   ln_sstnight = .false.             ! Logical switch for calculating night-time average for SST obs 
    12031242! All of the *files* variables below are arrays. Use namelist_cfg to add more files 
    1204    cn_profbfiles = 'profiles_01.nc'    ! Profile feedback input observation file names 
    1205    cn_slafbfiles = 'sla_01.nc'         ! SLA feedback input observation file names 
    1206    cn_sstfbfiles = 'sst_01.nc'         ! SST feedback input observation file names 
    1207    cn_sicfbfiles = 'sic_01.nc'         ! SIC feedback input observation file names 
    1208    cn_velfbfiles = 'vel_01.nc'         ! Velocity feedback input observation file names 
    1209    cn_altbiasfile = 'altbias.nc'       ! Altimeter bias input file name 
    1210    cn_gridsearchfile = 'gridsearch.nc' ! Grid search file name 
    1211    rn_gridsearchres = 0.5              ! Grid search resolution 
    1212    rn_dobsini = 00010101.000000        ! Initial date in window YYYYMMDD.HHMMSS 
    1213    rn_dobsend = 00010102.000000        ! Final date in window YYYYMMDD.HHMMSS 
    1214    nn_1dint = 0                        ! Type of vertical interpolation method 
    1215    nn_2dint = 0                        ! Type of horizontal interpolation method 
    1216    nn_msshc = 0                        ! MSSH correction scheme 
    1217    rn_mdtcorr = 1.61                   ! MDT  correction 
    1218    rn_mdtcutoff = 65.0                 ! MDT cutoff for computed correction 
    1219    nn_profdavtypes = -1                ! Profile daily average types - array 
    1220    ln_sstbias = .false.  
    1221    cn_sstbias_files = 'sstbias.nc' 
    1222 / 
    1223 !----------------------------------------------------------------------- 
    1224 &nam_asminc   !   assimilation increments                               ('key_asminc') 
    1225 !----------------------------------------------------------------------- 
    1226     ln_bkgwri = .false.    !  Logical switch for writing out background state 
    1227     ln_trainc = .false.    !  Logical switch for applying tracer increments 
    1228     ln_dyninc = .false.    !  Logical switch for applying velocity increments 
    1229     ln_sshinc = .false.    !  Logical switch for applying SSH increments 
    1230     ln_asmdin = .false.    !  Logical switch for Direct Initialization (DI) 
    1231     ln_asmiau = .false.    !  Logical switch for Incremental Analysis Updating (IAU) 
    1232     nitbkg    = 0          !  Timestep of background in [0,nitend-nit000-1] 
    1233     nitdin    = 0          !  Timestep of background for DI in [0,nitend-nit000-1] 
    1234     nitiaustr = 1          !  Timestep of start of IAU interval in [0,nitend-nit000-1] 
    1235     nitiaufin = 15         !  Timestep of end of IAU interval in [0,nitend-nit000-1] 
    1236     niaufn    = 0          !  Type of IAU weighting function 
    1237     ln_salfix = .false.    !  Logical switch for ensuring that the sa > salfixmin 
    1238     salfixmin = -9999      !  Minimum salinity after applying the increments 
    1239     nn_divdmp = 0          !  Number of iterations of divergence damping operator 
    1240 / 
    1241 !----------------------------------------------------------------------- 
    1242 &namdiu !   Cool skin and warm layer models 
    1243 !----------------------------------------------------------------------- 
    1244    ln_diurnal      = .false.   !  
    1245    ln_diurnal_only = .false.   ! 
    1246 / 
    1247 !----------------------------------------------------------------------- 
    1248 &nam_diatmb  !  Top Middle Bottom Output 
    1249 !----------------------------------------------------------------------- 
    1250    ln_diatmb  = .false.    !  Choose Top Middle and Bottom output or not 
    1251 / 
    1252 !----------------------------------------------------------------------- 
    1253 &namwad  !   Wetting and drying 
    1254 !----------------------------------------------------------------------- 
    1255    ln_wd             = .false.  ! T/F activation of wetting and drying 
    1256    rn_wdmin1         =  0.1     ! Minimum wet depth on dried cells 
    1257    rn_wdmin2         =  0.01    ! Tolerance of min wet depth on dried cells 
    1258    rn_wdld           =  20.0    ! Land elevation below which wetting/drying is allowed 
    1259    nn_wdit           =  10      ! Max iterations for W/D limiter 
    1260 / 
    1261 !----------------------------------------------------------------------- 
    1262 &nam_dia25h  !  25h Mean Output 
    1263 !----------------------------------------------------------------------- 
    1264    ln_dia25h  = .false.    ! Choose 25h mean output or not 
    1265 / 
     1243   cn_profbfiles = 'profiles_01.nc'  ! Profile feedback input observation file names 
     1244   cn_slafbfiles = 'sla_01.nc'       ! SLA feedback input observation file names 
     1245   cn_sstfbfiles = 'sst_01.nc'       ! SST feedback input observation file names 
     1246   cn_sicfbfiles = 'sic_01.nc'       ! SIC feedback input observation file names 
     1247   cn_velfbfiles = 'vel_01.nc'       ! Velocity feedback input observation file names 
     1248   cn_altbiasfile = 'altbias.nc'     ! Altimeter bias input file name 
     1249   cn_gridsearchfile='gridsearch.nc' ! Grid search file name 
     1250   rn_gridsearchres = 0.5            ! Grid search resolution 
     1251   rn_dobsini  = 00010101.000000     ! Initial date in window YYYYMMDD.HHMMSS 
     1252   rn_dobsend  = 00010102.000000     ! Final date in window YYYYMMDD.HHMMSS 
     1253   nn_1dint    = 0                   ! Type of vertical interpolation method 
     1254   nn_2dint    = 0                   ! Type of horizontal interpolation method 
     1255   nn_msshc    = 0                   ! MSSH correction scheme 
     1256   rn_mdtcorr  = 1.61                ! MDT  correction 
     1257   rn_mdtcutoff = 65.0               ! MDT cutoff for computed correction 
     1258   nn_profdavtypes = -1              ! Profile daily average types - array 
     1259   ln_sstbias  = .false.             ! 
     1260   cn_sstbias_files = 'sstbias.nc'   ! 
     1261/ 
     1262!----------------------------------------------------------------------- 
     1263&nam_asminc    !   assimilation increments                              ('key_asminc') 
     1264!----------------------------------------------------------------------- 
     1265    ln_bkgwri  = .false.   !  Logical switch for writing out background state 
     1266    ln_trainc  = .false.   !  Logical switch for applying tracer increments 
     1267    ln_dyninc  = .false.   !  Logical switch for applying velocity increments 
     1268    ln_sshinc  = .false.   !  Logical switch for applying SSH increments 
     1269    ln_asmdin  = .false.   !  Logical switch for Direct Initialization (DI) 
     1270    ln_asmiau  = .false.   !  Logical switch for Incremental Analysis Updating (IAU) 
     1271    nitbkg     = 0         !  Timestep of background in [0,nitend-nit000-1] 
     1272    nitdin     = 0         !  Timestep of background for DI in [0,nitend-nit000-1] 
     1273    nitiaustr  = 1         !  Timestep of start of IAU interval in [0,nitend-nit000-1] 
     1274    nitiaufin  = 15        !  Timestep of end of IAU interval in [0,nitend-nit000-1] 
     1275    niaufn     = 0         !  Type of IAU weighting function 
     1276    ln_salfix  = .false.   !  Logical switch for ensuring that the sa > salfixmin 
     1277    salfixmin  = -9999     !  Minimum salinity after applying the increments 
     1278    nn_divdmp  = 0         !  Number of iterations of divergence damping operator 
     1279/ 
  • trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90

    r6140 r6497  
    174174                  &                             +  0.15 * zrau(ji,jj)          * zmskd2(ji,jj)  ) 
    175175               ! add to the eddy viscosity coef. previously computed 
     176# if defined key_zdftmx_new 
     177               ! key_zdftmx_new: New internal wave-driven param: use avs value computed by zdftmx 
     178               avs (ji,jj,jk) = avs(ji,jj,jk) + zavfs + zavds 
     179# else 
    176180               avs (ji,jj,jk) = avt(ji,jj,jk) + zavfs + zavds 
     181# endif 
    177182               avt (ji,jj,jk) = avt(ji,jj,jk) + zavft + zavdt 
    178183               avm (ji,jj,jk) = avm(ji,jj,jk) + MAX( zavft + zavdt, zavfs + zavds ) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90

    r6140 r6497  
    323323                  zwlc = zind * rn_lc * zus * SIN( rpi * gdepw_n(ji,jj,jk) / zhlc(ji,jj) ) 
    324324                  !                                           ! TKE Langmuir circulation source term 
    325                   en(ji,jj,jk) = en(ji,jj,jk) + rdt * (1._wp - fr_i(ji,jj) ) * ( zwlc * zwlc * zwlc ) / zhlc(ji,jj) * wmask(ji,jj,jk) * tmask(ji,jj,1) 
     325                  en(ji,jj,jk) = en(ji,jj,jk) + rdt * (1._wp - fr_i(ji,jj) ) * ( zwlc * zwlc * zwlc )   & 
     326                     &                              / zhlc(ji,jj) * wmask(ji,jj,jk) * tmask(ji,jj,1) 
    326327               END DO 
    327328            END DO 
     
    375376            DO ji = fs_2, fs_jpim1   ! vector opt. 
    376377               zcof   = zfact1 * tmask(ji,jj,jk) 
     378# if defined key_zdftmx_new 
     379               ! key_zdftmx_new: New internal wave-driven param: set a minimum value for Kz on TKE (ensure numerical stability) 
     380               zzd_up = zcof * MAX( avm(ji,jj,jk+1) + avm(ji,jj,jk), 2.e-5_wp )   &  ! upper diagonal 
     381                  &          / (  e3t_n(ji,jj,jk  ) * e3w_n(ji,jj,jk  )  ) 
     382               zzd_lw = zcof * MAX( avm(ji,jj,jk) + avm(ji,jj,jk-1), 2.e-5_wp )   &  ! lower diagonal 
     383                  &          / (  e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk  )  ) 
     384# else 
    377385               zzd_up = zcof * ( avm  (ji,jj,jk+1) + avm  (ji,jj,jk  ) )   &  ! upper diagonal 
    378386                  &          / ( e3t_n(ji,jj,jk  ) * e3w_n(ji,jj,jk  ) ) 
    379387               zzd_lw = zcof * ( avm  (ji,jj,jk  ) + avm  (ji,jj,jk-1) )   &  ! lower diagonal 
    380388                  &          / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk  ) ) 
     389# endif 
    381390               !                                   ! shear prod. at w-point weightened by mask 
    382391               zesh2  =  ( z3du(ji-1,jj,jk) + z3du(ji,jj,jk) ) / MAX( 1._wp , umask(ji-1,jj,jk) + umask(ji,jj,jk) )   & 
     
    732741      ! 
    733742      ri_cri   = 2._wp    / ( 2._wp + rn_ediss / rn_ediff )   ! resulting critical Richardson number 
     743# if defined key_zdftmx_new 
     744      ! key_zdftmx_new: New internal wave-driven param: specified value of rn_emin & rmxl_min are used 
     745      rn_emin  = 1.e-10_wp 
     746      rmxl_min = 1.e-03_wp 
     747      IF(lwp) THEN                  ! Control print 
     748         WRITE(numout,*) 
     749         WRITE(numout,*) 'zdf_tke_init :  New tidal mixing case: force rn_emin = 1.e-10 and rmxl_min = 1.e-3 ' 
     750         WRITE(numout,*) '~~~~~~~~~~~~' 
     751      ENDIF 
     752# else 
    734753      rmxl_min = 1.e-6_wp / ( rn_ediff * SQRT( rn_emin ) )    ! resulting minimum length to recover molecular viscosity 
     754# endif 
    735755      ! 
    736756      IF(lwp) THEN                    !* Control print 
  • trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90

    r6140 r6497  
    541541   END SUBROUTINE zdf_tmx_init 
    542542 
     543#elif defined key_zdftmx_new 
     544   !!---------------------------------------------------------------------- 
     545   !!   'key_zdftmx_new'               Internal wave-driven vertical mixing 
     546   !!---------------------------------------------------------------------- 
     547   !!   zdf_tmx       : global     momentum & tracer Kz with wave induced Kz 
     548   !!   zdf_tmx_init  : global     momentum & tracer Kz with wave induced Kz 
     549   !!---------------------------------------------------------------------- 
     550   USE oce            ! ocean dynamics and tracers variables 
     551   USE dom_oce        ! ocean space and time domain variables 
     552   USE zdf_oce        ! ocean vertical physics variables 
     553   USE zdfddm         ! ocean vertical physics: double diffusive mixing 
     554   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     555   USE eosbn2         ! ocean equation of state 
     556   USE phycst         ! physical constants 
     557   USE prtctl         ! Print control 
     558   USE in_out_manager ! I/O manager 
     559   USE iom            ! I/O Manager 
     560   USE lib_mpp        ! MPP library 
     561   USE wrk_nemo       ! work arrays 
     562   USE timing         ! Timing 
     563   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
     564 
     565   IMPLICIT NONE 
     566   PRIVATE 
     567 
     568   PUBLIC   zdf_tmx         ! called in step module  
     569   PUBLIC   zdf_tmx_init    ! called in nemogcm module  
     570   PUBLIC   zdf_tmx_alloc   ! called in nemogcm module 
     571 
     572   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftmx = .TRUE.    !: wave-driven mixing flag 
     573 
     574   !                       !!* Namelist  namzdf_tmx : internal wave-driven mixing * 
     575   INTEGER  ::  nn_zpyc     ! pycnocline-intensified mixing energy proportional to N (=1) or N^2 (=2) 
     576   LOGICAL  ::  ln_mevar    ! variable (=T) or constant (=F) mixing efficiency 
     577   LOGICAL  ::  ln_tsdiff   ! account for differential T/S wave-driven mixing (=T) or not (=F) 
     578 
     579   REAL(wp) ::  r1_6 = 1._wp / 6._wp 
     580 
     581   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ebot_tmx     ! power available from high-mode wave breaking (W/m2) 
     582   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   epyc_tmx     ! power available from low-mode, pycnocline-intensified wave breaking (W/m2) 
     583   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ecri_tmx     ! power available from low-mode, critical slope wave breaking (W/m2) 
     584   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hbot_tmx     ! WKB decay scale for high-mode energy dissipation (m) 
     585   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hcri_tmx     ! decay scale for low-mode critical slope dissipation (m) 
     586   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   emix_tmx     ! local energy density available for mixing (W/kg) 
     587   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   bflx_tmx     ! buoyancy flux Kz * N^2 (W/kg) 
     588   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   pcmap_tmx    ! vertically integrated buoyancy flux (W/m2) 
     589   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zav_ratio    ! S/T diffusivity ratio (only for ln_tsdiff=T) 
     590   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zav_wave     ! Internal wave-induced diffusivity 
     591 
     592   !! * Substitutions 
     593#  include "zdfddm_substitute.h90" 
     594#  include "vectopt_loop_substitute.h90" 
     595   !!---------------------------------------------------------------------- 
     596   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
     597   !! $Id$ 
     598   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     599   !!---------------------------------------------------------------------- 
     600CONTAINS 
     601 
     602   INTEGER FUNCTION zdf_tmx_alloc() 
     603      !!---------------------------------------------------------------------- 
     604      !!                ***  FUNCTION zdf_tmx_alloc  *** 
     605      !!---------------------------------------------------------------------- 
     606      ALLOCATE(     ebot_tmx(jpi,jpj),  epyc_tmx(jpi,jpj),  ecri_tmx(jpi,jpj)    ,   & 
     607      &             hbot_tmx(jpi,jpj),  hcri_tmx(jpi,jpj),  emix_tmx(jpi,jpj,jpk),   & 
     608      &         bflx_tmx(jpi,jpj,jpk), pcmap_tmx(jpi,jpj), zav_ratio(jpi,jpj,jpk),   &  
     609      &         zav_wave(jpi,jpj,jpk), STAT=zdf_tmx_alloc     ) 
     610      ! 
     611      IF( lk_mpp             )   CALL mpp_sum ( zdf_tmx_alloc ) 
     612      IF( zdf_tmx_alloc /= 0 )   CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays') 
     613   END FUNCTION zdf_tmx_alloc 
     614 
     615 
     616   SUBROUTINE zdf_tmx( kt ) 
     617      !!---------------------------------------------------------------------- 
     618      !!                  ***  ROUTINE zdf_tmx  *** 
     619      !!                    
     620      !! ** Purpose :   add to the vertical mixing coefficients the effect of 
     621      !!              breaking internal waves. 
     622      !! 
     623      !! ** Method  : - internal wave-driven vertical mixing is given by: 
     624      !!                  Kz_wave = min(  100 cm2/s, f(  Reb = emix_tmx /( Nu * N^2 )  ) 
     625      !!              where emix_tmx is the 3D space distribution of the wave-breaking  
     626      !!              energy and Nu the molecular kinematic viscosity. 
     627      !!              The function f(Reb) is linear (constant mixing efficiency) 
     628      !!              if the namelist parameter ln_mevar = F and nonlinear if ln_mevar = T. 
     629      !! 
     630      !!              - Compute emix_tmx, the 3D power density that allows to compute 
     631      !!              Reb and therefrom the wave-induced vertical diffusivity. 
     632      !!              This is divided into three components: 
     633      !!                 1. Bottom-intensified low-mode dissipation at critical slopes 
     634      !!                     emix_tmx(z) = ( ecri_tmx / rau0 ) * EXP( -(H-z)/hcri_tmx ) 
     635      !!                                   / ( 1. - EXP( - H/hcri_tmx ) ) * hcri_tmx 
     636      !!              where hcri_tmx is the characteristic length scale of the bottom  
     637      !!              intensification, ecri_tmx a map of available power, and H the ocean depth. 
     638      !!                 2. Pycnocline-intensified low-mode dissipation 
     639      !!                     emix_tmx(z) = ( epyc_tmx / rau0 ) * ( sqrt(rn2(z))^nn_zpyc ) 
     640      !!                                   / SUM( sqrt(rn2(z))^nn_zpyc * e3w(z) ) 
     641      !!              where epyc_tmx is a map of available power, and nn_zpyc 
     642      !!              is the chosen stratification-dependence of the internal wave 
     643      !!              energy dissipation. 
     644      !!                 3. WKB-height dependent high mode dissipation 
     645      !!                     emix_tmx(z) = ( ebot_tmx / rau0 ) * rn2(z) * EXP(-z_wkb(z)/hbot_tmx) 
     646      !!                                   / SUM( rn2(z) * EXP(-z_wkb(z)/hbot_tmx) * e3w(z) ) 
     647      !!              where hbot_tmx is the characteristic length scale of the WKB bottom  
     648      !!              intensification, ebot_tmx is a map of available power, and z_wkb is the 
     649      !!              WKB-stretched height above bottom defined as 
     650      !!                    z_wkb(z) = H * SUM( sqrt(rn2(z'>=z)) * e3w(z'>=z) ) 
     651      !!                                 / SUM( sqrt(rn2(z'))    * e3w(z')    ) 
     652      !! 
     653      !!              - update the model vertical eddy viscosity and diffusivity:  
     654      !!                     avt  = avt  +    av_wave 
     655      !!                     avm  = avm  +    av_wave 
     656      !!                     avmu = avmu + mi(av_wave) 
     657      !!                     avmv = avmv + mj(av_wave) 
     658      !! 
     659      !!              - if namelist parameter ln_tsdiff = T, account for differential mixing: 
     660      !!                     avs  = avt  +    av_wave * diffusivity_ratio(Reb) 
     661      !! 
     662      !! ** Action  : - Define emix_tmx used to compute internal wave-induced mixing 
     663      !!              - avt, avs, avm, avmu, avmv increased by internal wave-driven mixing     
     664      !! 
     665      !! References :  de Lavergne et al. 2015, JPO; 2016, in prep. 
     666      !!---------------------------------------------------------------------- 
     667      INTEGER, INTENT(in) ::   kt   ! ocean time-step  
     668      ! 
     669      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     670      REAL(wp) ::   ztpc         ! scalar workspace 
     671      REAL(wp), DIMENSION(:,:)  , POINTER ::  zfact     ! Used for vertical structure 
     672      REAL(wp), DIMENSION(:,:)  , POINTER ::  zhdep     ! Ocean depth 
     673      REAL(wp), DIMENSION(:,:,:), POINTER ::  zwkb      ! WKB-stretched height above bottom 
     674      REAL(wp), DIMENSION(:,:,:), POINTER ::  zweight   ! Weight for high mode vertical distribution 
     675      REAL(wp), DIMENSION(:,:,:), POINTER ::  znu_t     ! Molecular kinematic viscosity (T grid) 
     676      REAL(wp), DIMENSION(:,:,:), POINTER ::  znu_w     ! Molecular kinematic viscosity (W grid) 
     677      REAL(wp), DIMENSION(:,:,:), POINTER ::  zReb      ! Turbulence intensity parameter 
     678      !!---------------------------------------------------------------------- 
     679      ! 
     680      IF( nn_timing == 1 )   CALL timing_start('zdf_tmx') 
     681      ! 
     682      CALL wrk_alloc( jpi,jpj,       zfact, zhdep ) 
     683      CALL wrk_alloc( jpi,jpj,jpk,   zwkb, zweight, znu_t, znu_w, zReb ) 
     684 
     685      !                          ! ----------------------------- ! 
     686      !                          !  Internal wave-driven mixing  !  (compute zav_wave) 
     687      !                          ! ----------------------------- ! 
     688      !                              
     689      !                        !* Critical slope mixing: distribute energy over the time-varying ocean depth, 
     690      !                                                 using an exponential decay from the seafloor. 
     691      DO jj = 1, jpj                ! part independent of the level 
     692         DO ji = 1, jpi 
     693            zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1)       ! depth of the ocean 
     694            zfact(ji,jj) = rau0 * (  1._wp - EXP( -zhdep(ji,jj) / hcri_tmx(ji,jj) )  ) 
     695            IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = ecri_tmx(ji,jj) / zfact(ji,jj) 
     696         END DO 
     697      END DO 
     698 
     699      DO jk = 2, jpkm1              ! complete with the level-dependent part 
     700         emix_tmx(:,:,jk) = zfact(:,:) * (  EXP( ( gde3w_n(:,:,jk  ) - zhdep(:,:) ) / hcri_tmx(:,:) )                      & 
     701            &                             - EXP( ( gde3w_n(:,:,jk-1) - zhdep(:,:) ) / hcri_tmx(:,:) )  ) * wmask(:,:,jk)   & 
     702            &                          / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) 
     703      END DO 
     704 
     705      !                        !* Pycnocline-intensified mixing: distribute energy over the time-varying  
     706      !                        !* ocean depth as proportional to sqrt(rn2)^nn_zpyc 
     707 
     708      SELECT CASE ( nn_zpyc ) 
     709 
     710      CASE ( 1 )               ! Dissipation scales as N (recommended) 
     711 
     712         zfact(:,:) = 0._wp 
     713         DO jk = 2, jpkm1              ! part independent of the level 
     714            zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
     715         END DO 
     716 
     717         DO jj = 1, jpj 
     718            DO ji = 1, jpi 
     719               IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) 
     720            END DO 
     721         END DO 
     722 
     723         DO jk = 2, jpkm1              ! complete with the level-dependent part 
     724            emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zfact(:,:) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
     725         END DO 
     726 
     727      CASE ( 2 )               ! Dissipation scales as N^2 
     728 
     729         zfact(:,:) = 0._wp 
     730         DO jk = 2, jpkm1              ! part independent of the level 
     731            zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
     732         END DO 
     733 
     734         DO jj= 1, jpj 
     735            DO ji = 1, jpi 
     736               IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) 
     737            END DO 
     738         END DO 
     739 
     740         DO jk = 2, jpkm1              ! complete with the level-dependent part 
     741            emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zfact(:,:) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
     742         END DO 
     743 
     744      END SELECT 
     745 
     746      !                        !* WKB-height dependent mixing: distribute energy over the time-varying  
     747      !                        !* ocean depth as proportional to rn2 * exp(-z_wkb/rn_hbot) 
     748       
     749      zwkb(:,:,:) = 0._wp 
     750      zfact(:,:) = 0._wp 
     751      DO jk = 2, jpkm1 
     752         zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
     753         zwkb(:,:,jk) = zfact(:,:) 
     754      END DO 
     755 
     756      DO jk = 2, jpkm1 
     757         DO jj = 1, jpj 
     758            DO ji = 1, jpi 
     759               IF( zfact(ji,jj) /= 0 )   zwkb(ji,jj,jk) = zhdep(ji,jj) * ( zfact(ji,jj) - zwkb(ji,jj,jk) )   & 
     760                                            &           * tmask(ji,jj,jk) / zfact(ji,jj) 
     761            END DO 
     762         END DO 
     763      END DO 
     764      zwkb(:,:,1) = zhdep(:,:) * tmask(:,:,1) 
     765 
     766      zweight(:,:,:) = 0._wp 
     767      DO jk = 2, jpkm1 
     768         zweight(:,:,jk) = MAX( 0._wp, rn2(:,:,jk) ) * hbot_tmx(:,:) * wmask(:,:,jk)                    & 
     769            &   * (  EXP( -zwkb(:,:,jk) / hbot_tmx(:,:) ) - EXP( -zwkb(:,:,jk-1) / hbot_tmx(:,:) )  ) 
     770      END DO 
     771 
     772      zfact(:,:) = 0._wp 
     773      DO jk = 2, jpkm1              ! part independent of the level 
     774         zfact(:,:) = zfact(:,:) + zweight(:,:,jk) 
     775      END DO 
     776 
     777      DO jj = 1, jpj 
     778         DO ji = 1, jpi 
     779            IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = ebot_tmx(ji,jj) / ( rau0 * zfact(ji,jj) ) 
     780         END DO 
     781      END DO 
     782 
     783      DO jk = 2, jpkm1              ! complete with the level-dependent part 
     784         emix_tmx(:,:,jk) = emix_tmx(:,:,jk) + zweight(:,:,jk) * zfact(:,:) * wmask(:,:,jk)   & 
     785            &                                / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) 
     786      END DO 
     787 
     788 
     789      ! Calculate molecular kinematic viscosity 
     790      znu_t(:,:,:) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * tsn(:,:,:,jp_tem) + 0.00694_wp * tsn(:,:,:,jp_tem) * tsn(:,:,:,jp_tem)  & 
     791         &                                  + 0.02305_wp * tsn(:,:,:,jp_sal)  ) * tmask(:,:,:) * r1_rau0 
     792      DO jk = 2, jpkm1 
     793         znu_w(:,:,jk) = 0.5_wp * ( znu_t(:,:,jk-1) + znu_t(:,:,jk) ) * wmask(:,:,jk) 
     794      END DO 
     795 
     796      ! Calculate turbulence intensity parameter Reb 
     797      DO jk = 2, jpkm1 
     798         zReb(:,:,jk) = emix_tmx(:,:,jk) / MAX( 1.e-20_wp, znu_w(:,:,jk) * rn2(:,:,jk) ) 
     799      END DO 
     800 
     801      ! Define internal wave-induced diffusivity 
     802      DO jk = 2, jpkm1 
     803         zav_wave(:,:,jk) = znu_w(:,:,jk) * zReb(:,:,jk) * r1_6   ! This corresponds to a constant mixing efficiency of 1/6 
     804      END DO 
     805 
     806      IF( ln_mevar ) THEN              ! Variable mixing efficiency case : modify zav_wave in the 
     807         DO jk = 2, jpkm1              ! energetic (Reb > 480) and buoyancy-controlled (Reb <10.224 ) regimes 
     808            DO jj = 1, jpj 
     809               DO ji = 1, jpi 
     810                  IF( zReb(ji,jj,jk) > 480.00_wp ) THEN 
     811                     zav_wave(ji,jj,jk) = 3.6515_wp * znu_w(ji,jj,jk) * SQRT( zReb(ji,jj,jk) ) 
     812                  ELSEIF( zReb(ji,jj,jk) < 10.224_wp ) THEN 
     813                     zav_wave(ji,jj,jk) = 0.052125_wp * znu_w(ji,jj,jk) * zReb(ji,jj,jk) * SQRT( zReb(ji,jj,jk) ) 
     814                  ENDIF 
     815               END DO 
     816            END DO 
     817         END DO 
     818      ENDIF 
     819 
     820      DO jk = 2, jpkm1                 ! Bound diffusivity by molecular value and 100 cm2/s 
     821         zav_wave(:,:,jk) = MIN(  MAX( 1.4e-7_wp, zav_wave(:,:,jk) ), 1.e-2_wp  ) * wmask(:,:,jk) 
     822      END DO 
     823 
     824      IF( kt == nit000 ) THEN        !* Control print at first time-step: diagnose the energy consumed by zav_wave 
     825         ztpc = 0._wp 
     826         DO jk = 2, jpkm1 
     827            DO jj = 1, jpj 
     828               DO ji = 1, jpi 
     829                  ztpc = ztpc + e3w_n(ji,jj,jk) * e1e2t(ji,jj)   & 
     830                     &         * MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) 
     831               END DO 
     832            END DO 
     833         END DO 
     834         IF( lk_mpp )   CALL mpp_sum( ztpc ) 
     835         ztpc = rau0 * ztpc ! Global integral of rauo * Kz * N^2 = power contributing to mixing  
     836  
     837         IF(lwp) THEN 
     838            WRITE(numout,*) 
     839            WRITE(numout,*) 'zdf_tmx : Internal wave-driven mixing (tmx)' 
     840            WRITE(numout,*) '~~~~~~~ ' 
     841            WRITE(numout,*) 
     842            WRITE(numout,*) '      Total power consumption by av_wave: ztpc =  ', ztpc * 1.e-12_wp, 'TW' 
     843         ENDIF 
     844      ENDIF 
     845 
     846      !                          ! ----------------------- ! 
     847      !                          !   Update  mixing coefs  !                           
     848      !                          ! ----------------------- ! 
     849      !       
     850      IF( ln_tsdiff ) THEN          !* Option for differential mixing of salinity and temperature 
     851         DO jk = 2, jpkm1              ! Calculate S/T diffusivity ratio as a function of Reb 
     852            DO jj = 1, jpj 
     853               DO ji = 1, jpi 
     854                  zav_ratio(ji,jj,jk) = ( 0.505_wp + 0.495_wp *                                                                  & 
     855                      &   TANH(    0.92_wp * (   LOG10(  MAX( 1.e-20_wp, zReb(ji,jj,jk) * 5._wp * r1_6 )  ) - 0.60_wp   )    )   & 
     856                      &                 ) * wmask(ji,jj,jk) 
     857               END DO 
     858            END DO 
     859         END DO 
     860         CALL iom_put( "av_ratio", zav_ratio ) 
     861         DO jk = 2, jpkm1           !* update momentum & tracer diffusivity with wave-driven mixing 
     862            fsavs(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk) 
     863            avt  (:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) 
     864            avm  (:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk) 
     865         END DO 
     866         ! 
     867      ELSE                          !* update momentum & tracer diffusivity with wave-driven mixing 
     868         DO jk = 2, jpkm1 
     869            fsavs(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) 
     870            avt  (:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) 
     871            avm  (:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk) 
     872         END DO 
     873      ENDIF 
     874 
     875      DO jk = 2, jpkm1              !* update momentum diffusivity at wu and wv points 
     876         DO jj = 2, jpjm1 
     877            DO ji = fs_2, fs_jpim1  ! vector opt. 
     878               avmu(ji,jj,jk) = avmu(ji,jj,jk) + 0.5_wp * ( zav_wave(ji,jj,jk) + zav_wave(ji+1,jj  ,jk) ) * wumask(ji,jj,jk) 
     879               avmv(ji,jj,jk) = avmv(ji,jj,jk) + 0.5_wp * ( zav_wave(ji,jj,jk) + zav_wave(ji  ,jj+1,jk) ) * wvmask(ji,jj,jk) 
     880            END DO 
     881         END DO 
     882      END DO 
     883      CALL lbc_lnk( avmu, 'U', 1. )   ;   CALL lbc_lnk( avmv, 'V', 1. )      ! lateral boundary condition 
     884 
     885      !                             !* output internal wave-driven mixing coefficient 
     886      CALL iom_put( "av_wave", zav_wave ) 
     887                                    !* output useful diagnostics: N^2, Kz * N^2 (bflx_tmx),  
     888                                    !  vertical integral of rau0 * Kz * N^2 (pcmap_tmx), energy density (emix_tmx) 
     889      IF( iom_use("bflx_tmx") .OR. iom_use("pcmap_tmx") ) THEN 
     890         bflx_tmx(:,:,:) = MAX( 0._wp, rn2(:,:,:) ) * zav_wave(:,:,:) 
     891         pcmap_tmx(:,:) = 0._wp 
     892         DO jk = 2, jpkm1 
     893            pcmap_tmx(:,:) = pcmap_tmx(:,:) + e3w_n(:,:,jk) * bflx_tmx(:,:,jk) * wmask(:,:,jk) 
     894         END DO 
     895         pcmap_tmx(:,:) = rau0 * pcmap_tmx(:,:) 
     896         CALL iom_put( "bflx_tmx", bflx_tmx ) 
     897         CALL iom_put( "pcmap_tmx", pcmap_tmx ) 
     898      ENDIF 
     899      CALL iom_put( "bn2", rn2 ) 
     900      CALL iom_put( "emix_tmx", emix_tmx ) 
     901       
     902      CALL wrk_dealloc( jpi,jpj,       zfact, zhdep ) 
     903      CALL wrk_dealloc( jpi,jpj,jpk,   zwkb, zweight, znu_t, znu_w, zReb ) 
     904 
     905      IF(ln_ctl)   CALL prt_ctl(tab3d_1=zav_wave , clinfo1=' tmx - av_wave: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk) 
     906      ! 
     907      IF( nn_timing == 1 )   CALL timing_stop('zdf_tmx') 
     908      ! 
     909   END SUBROUTINE zdf_tmx 
     910 
     911 
     912   SUBROUTINE zdf_tmx_init 
     913      !!---------------------------------------------------------------------- 
     914      !!                  ***  ROUTINE zdf_tmx_init  *** 
     915      !!                      
     916      !! ** Purpose :   Initialization of the wave-driven vertical mixing, reading 
     917      !!              of input power maps and decay length scales in netcdf files. 
     918      !! 
     919      !! ** Method  : - Read the namzdf_tmx namelist and check the parameters 
     920      !! 
     921      !!              - Read the input data in NetCDF files : 
     922      !!              power available from high-mode wave breaking (mixing_power_bot.nc) 
     923      !!              power available from pycnocline-intensified wave-breaking (mixing_power_pyc.nc) 
     924      !!              power available from critical slope wave-breaking (mixing_power_cri.nc) 
     925      !!              WKB decay scale for high-mode wave-breaking (decay_scale_bot.nc) 
     926      !!              decay scale for critical slope wave-breaking (decay_scale_cri.nc) 
     927      !! 
     928      !! ** input   : - Namlist namzdf_tmx 
     929      !!              - NetCDF files : mixing_power_bot.nc, mixing_power_pyc.nc, mixing_power_cri.nc, 
     930      !!              decay_scale_bot.nc decay_scale_cri.nc 
     931      !! 
     932      !! ** Action  : - Increase by 1 the nstop flag is setting problem encounter 
     933      !!              - Define ebot_tmx, epyc_tmx, ecri_tmx, hbot_tmx, hcri_tmx 
     934      !! 
     935      !! References : de Lavergne et al. 2015, JPO; 2016, in prep. 
     936      !!          
     937      !!---------------------------------------------------------------------- 
     938      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     939      INTEGER  ::   inum         ! local integer 
     940      INTEGER  ::   ios 
     941      REAL(wp) ::   zbot, zpyc, zcri   ! local scalars 
     942      !! 
     943      NAMELIST/namzdf_tmx_new/ nn_zpyc, ln_mevar, ln_tsdiff 
     944      !!---------------------------------------------------------------------- 
     945      ! 
     946      IF( nn_timing == 1 )  CALL timing_start('zdf_tmx_init') 
     947      ! 
     948      REWIND( numnam_ref )              ! Namelist namzdf_tmx in reference namelist : Wave-driven mixing 
     949      READ  ( numnam_ref, namzdf_tmx_new, IOSTAT = ios, ERR = 901) 
     950901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp ) 
     951      ! 
     952      REWIND( numnam_cfg )              ! Namelist namzdf_tmx in configuration namelist : Wave-driven mixing 
     953      READ  ( numnam_cfg, namzdf_tmx_new, IOSTAT = ios, ERR = 902 ) 
     954902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp ) 
     955      IF(lwm) WRITE ( numond, namzdf_tmx_new ) 
     956      ! 
     957      IF(lwp) THEN                  ! Control print 
     958         WRITE(numout,*) 
     959         WRITE(numout,*) 'zdf_tmx_init : internal wave-driven mixing' 
     960         WRITE(numout,*) '~~~~~~~~~~~~' 
     961         WRITE(numout,*) '   Namelist namzdf_tmx_new : set wave-driven mixing parameters' 
     962         WRITE(numout,*) '      Pycnocline-intensified diss. scales as N (=1) or N^2 (=2) = ', nn_zpyc 
     963         WRITE(numout,*) '      Variable (T) or constant (F) mixing efficiency            = ', ln_mevar 
     964         WRITE(numout,*) '      Differential internal wave-driven mixing (T) or not (F)   = ', ln_tsdiff 
     965      ENDIF 
     966       
     967      ! The new wave-driven mixing parameterization elevates avt and avm in the interior, and 
     968      ! ensures that avt remains larger than its molecular value (=1.4e-7). Therefore, avtb should  
     969      ! be set here to a very small value, and avmb to its (uniform) molecular value (=1.4e-6). 
     970      avmb(:) = 1.4e-6_wp        ! viscous molecular value 
     971      avtb(:) = 1.e-10_wp        ! very small diffusive minimum (background avt is specified in zdf_tmx)     
     972      avtb_2d(:,:) = 1.e0_wp     ! uniform  
     973      IF(lwp) THEN                  ! Control print 
     974         WRITE(numout,*) 
     975         WRITE(numout,*) '   Force the background value applied to avm & avt in TKE to be everywhere ',   & 
     976            &               'the viscous molecular value & a very small diffusive value, resp.' 
     977      ENDIF 
     978       
     979      IF( .NOT.lk_zdfddm )   CALL ctl_stop( 'STOP', 'zdf_tmx_init_new : key_zdftmx_new requires key_zdfddm' ) 
     980       
     981      !                             ! allocate tmx arrays 
     982      IF( zdf_tmx_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' ) 
     983      ! 
     984      !                             ! read necessary fields 
     985      CALL iom_open('mixing_power_bot',inum)       ! energy flux for high-mode wave breaking [W/m2] 
     986      CALL iom_get  (inum, jpdom_data, 'field', ebot_tmx, 1 )  
     987      CALL iom_close(inum) 
     988      ! 
     989      CALL iom_open('mixing_power_pyc',inum)       ! energy flux for pynocline-intensified wave breaking [W/m2] 
     990      CALL iom_get  (inum, jpdom_data, 'field', epyc_tmx, 1 ) 
     991      CALL iom_close(inum) 
     992      ! 
     993      CALL iom_open('mixing_power_cri',inum)       ! energy flux for critical slope wave breaking [W/m2] 
     994      CALL iom_get  (inum, jpdom_data, 'field', ecri_tmx, 1 ) 
     995      CALL iom_close(inum) 
     996      ! 
     997      CALL iom_open('decay_scale_bot',inum)        ! spatially variable decay scale for high-mode wave breaking [m] 
     998      CALL iom_get  (inum, jpdom_data, 'field', hbot_tmx, 1 ) 
     999      CALL iom_close(inum) 
     1000      ! 
     1001      CALL iom_open('decay_scale_cri',inum)        ! spatially variable decay scale for critical slope wave breaking [m] 
     1002      CALL iom_get  (inum, jpdom_data, 'field', hcri_tmx, 1 ) 
     1003      CALL iom_close(inum) 
     1004 
     1005      ebot_tmx(:,:) = ebot_tmx(:,:) * ssmask(:,:) 
     1006      epyc_tmx(:,:) = epyc_tmx(:,:) * ssmask(:,:) 
     1007      ecri_tmx(:,:) = ecri_tmx(:,:) * ssmask(:,:) 
     1008 
     1009      ! Set once for all to zero the first and last vertical levels of appropriate variables 
     1010      emix_tmx (:,:, 1 ) = 0._wp 
     1011      emix_tmx (:,:,jpk) = 0._wp 
     1012      zav_ratio(:,:, 1 ) = 0._wp 
     1013      zav_ratio(:,:,jpk) = 0._wp 
     1014      zav_wave (:,:, 1 ) = 0._wp 
     1015      zav_wave (:,:,jpk) = 0._wp 
     1016 
     1017      zbot = glob_sum( e1e2t(:,:) * ebot_tmx(:,:) ) 
     1018      zpyc = glob_sum( e1e2t(:,:) * epyc_tmx(:,:) ) 
     1019      zcri = glob_sum( e1e2t(:,:) * ecri_tmx(:,:) ) 
     1020      IF(lwp) THEN 
     1021         WRITE(numout,*) '      High-mode wave-breaking energy:             ', zbot * 1.e-12_wp, 'TW' 
     1022         WRITE(numout,*) '      Pycnocline-intensifed wave-breaking energy: ', zpyc * 1.e-12_wp, 'TW' 
     1023         WRITE(numout,*) '      Critical slope wave-breaking energy:        ', zcri * 1.e-12_wp, 'TW' 
     1024      ENDIF 
     1025      ! 
     1026      IF( nn_timing == 1 )  CALL timing_stop('zdf_tmx_init') 
     1027      ! 
     1028   END SUBROUTINE zdf_tmx_init 
     1029 
    5431030#else 
    5441031   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.