# Changeset 11407

Ignore:
Timestamp:
2019-08-06T15:36:27+02:00 (15 months ago)
Message:

Final documentation tweaks to the adaptive-implicit vertical advection section of chap_ZDF.tex and associated code changes. The code changes are mostly cosmetic or to align with the documentation but this does include a modified version of traadv_fct.F90 (thanks to Jerome) which correctly accounts for any implicit component of the vertical velocity when computing anti-diffusive fluxes for flux correction. The changes have null effect when ln_zad_Aimp is .false. and have been SETTE tested with ORCA2_ICE_PISCES with ln_zad_Aimp = .true.

Location:
NEMO/trunk
Files:
4 edited

Unmodified
Removed
• ## NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex

 r11388 \label{eq:Eqn_zad_Aimp_partition} Cu_{min} &= 0.15 \nonumber \\ Cu_{max} &= 0.27 \nonumber \\ Cu_{max} &= 0.3 \nonumber \\ Cu_{cut} &= 2Cu_{max} - Cu_{min} \nonumber \\ Fcu    &= 4Cu_{max}*(Cu_{max}-Cu_{min}) \nonumber \\ Cf &= C\kern-0.14em f &= \begin{cases} 0.0                                                        &\text{if $Cu \leq Cu_{min}$} \\ \end{align} \noindent With these settings the coefficient ($Cf$) is shown in \autoref{fig:zad_Aimp_coeff} \begin{figure}[!t] \begin{center} \caption{ \protect\label{fig:zad_Aimp_coeff} The value of the partitioning coefficient ($Cf$) used to partition vertical velocities into parts to The value of the partitioning coefficient ($C\kern-0.14em f$) used to partition vertical velocities into parts to be treated implicitly and explicitly for a range of typical Courant numbers (\forcode{ln_zad_Aimp=.true.}) } \begin{align} \label{eq:Eqn_zad_Aimp_partition2} w_{i_{ijk}} &= Cf_{ijk} w_{n_{ijk}}     \nonumber \\ w_{n_{ijk}} &= (1-Cf_{ijk}) w_{n_{ijk}} w_{i_{ijk}} &= C\kern-0.14em f_{ijk} w_{n_{ijk}}     \nonumber \\ w_{n_{ijk}} &= (1-C\kern-0.14em f_{ijk}) w_{n_{ijk}} \end{align} \noindent Note that the coefficient is such that the treatment is never fully implicit; the three cases from \autoref{eq:Eqn_zad_Aimp_partition} can be considered as: fully-explicit; mixed explicit/implicit and mostly-implicit.  The $w_i$ component is added to the implicit solvers for the vertical mixing in \mdl{dynzdf} and \mdl{trazdf} in a similar way to \citep{shchepetkin_OM15}.  This is sufficient for the flux-limited advection scheme (\forcode{ln_traadv_mus}) but further intervention is required when using the flux-corrected scheme (\forcode{ln_traadv_fct}). For these schemes the implicit upstream fluxes must be added to both the monotonic guess and to the higher order solution when calculating the antidiffusive fluxes. The implicit vertical fluxes are then removed since they are added by the implicit solver later on. fully-explicit; mixed explicit/implicit and mostly-implicit.  With the settings shown the coefficient ($C\kern-0.14em f$) varies as shown in \autoref{fig:zad_Aimp_coeff}. Note with these values the $Cu_{cut}$ boundary between the mixed implicit-explicit treatment and 'mostly implicit' is 0.45 which is just below the stability limited given in \autoref{tab:zad_Aimp_CFLcrit}  for a 3rd order scheme. The $w_i$ component is added to the implicit solvers for the vertical mixing in \mdl{dynzdf} and \mdl{trazdf} in a similar way to \citep{shchepetkin_OM15}.  This is sufficient for the flux-limited advection scheme (\forcode{ln_traadv_mus}) but further intervention is required when using the flux-corrected scheme (\forcode{ln_traadv_fct}). For these schemes the implicit upstream fluxes must be added to both the monotonic guess and to the higher order solution when calculating the antidiffusive fluxes. The implicit vertical fluxes are then removed since they are added by the implicit solver later on. The adaptive-implicit vertical advection option is new to NEMO at v4.0 and has yet to be used in a wide range of simulations. The following test simulation, however, does illustrate the potential benefits and will hopefully encourage further testing and feedback from users: \begin{figure}[!t] \begin{center} \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_frames} \caption{ \protect\label{fig:zad_Aimp_overflow_frames} A time-series of temperature vertical cross-sections for the OVERFLOW test case. These results are for the default settings with \forcode{nn_rdt=10.0} and without adaptive implicit vertical advection (\forcode{ln_zad_Aimp=.false.}). } \end{center} \end{figure} \subsection{Adaptive-implicit vertical advection in the OVERFLOW test-case} ln_zdfnpc     = .true. ln_traadv_fct = .true. nn_fct_h   =  4 nn_fct_v   =  4 nn_fct_h   =  2 nn_fct_v   =  2 \end{verbatim} candidate, therefore, for use of the adaptive-implicit vertical advection scheme. The results with \forcode{ln_zad_Aimp=.true.} and a variety of model timesteps are shown in \autoref{fig:zad_Aimp_overflow_all_rdt} (together with the equivalent frames from the base run).  In this simple example the use of the adaptive-implicit vertcal advection scheme has enabled a 12x increase in the model timestep without significantly altering the solution (although at this extreme the plume is more diffuse and has not travelled so far). Notably, the solution with and without the scheme is slightly different even with \forcode{nn_rdt = 10.}; suggesting that the base run was close enough to instability to trigger the scheme despite completing successfully.  To assist in diagnosing how active the scheme is, in both location and time, the 3D implicit and explicit components of the vertical velocity are available via XIOS as \texttt{wimp} and \texttt{wexp} respectively. Likewise, the partitioning coefficient ($Cf$) is also available as \texttt{wi\_cff}. \begin{figure}[!t] \begin{center} \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_frames} \caption{ \protect\label{fig:zad_Aimp_overflow_frames} A time-series of temperature vertical cross-sections for the OVERFLOW test case. These results are for the default settings with \forcode{nn_rdt=10.0} and without adaptive implicit vertical advection (\forcode{ln_zad_Aimp=.false.}). } \end{center} \end{figure} The results with \forcode{ln_zad_Aimp=.true.} and a variety of model timesteps are shown in \autoref{fig:zad_Aimp_overflow_all_rdt} (together with the equivalent frames from the base run).  In this simple example the use of the adaptive-implicit vertcal advection scheme has enabled a 12x increase in the model timestep without significantly altering the solution (although at this extreme the plume is more diffuse and has not travelled so far).  Notably, the solution with and without the scheme is slightly different even with \forcode{nn_rdt = 10.}; suggesting that the base run was close enough to instability to trigger the scheme despite completing successfully. To assist in diagnosing how active the scheme is, in both location and time, the 3D implicit and explicit components of the vertical velocity are available via XIOS as \texttt{wimp} and \texttt{wexp} respectively.  Likewise, the partitioning coefficient ($C\kern-0.14em f$) is also available as \texttt{wi\_cff}. For a quick oversight of the schemes activity the global maximum values of the absolute implicit component of the vertical velocity and the partitioning coefficient are written to the netCDF version of the run statistics file (\texttt{run.stat.nc}) if this is active (see \autoref{sec:MISC_opt} for activation details). \autoref{fig:zad_Aimp_maxCf} shows examples of the maximum partitioning coefficient for the various overflow tests.  Note that the adaptive-implicit vertical advection scheme is active even in the base run with \forcode{nn_rdt=10.0s} adding to the evidence that the test case is close to stability limits even with this value. At the larger timesteps, the vertical velocity is treated mostly implicitly at some location throughout the run. The oscillatory nature of this measure appears to be linked to the progress of the plume front as each cusp is associated with the location of the maximum shifting to the adjacent cell. This is illustrated in \autoref{fig:zad_Aimp_maxCf_loc} where the i- and k- locations of the maximum have been overlaid for the base run case. \medskip \noindent Only limited tests have been performed in more realistic configurations. In the ORCA2\_ICE\_PISCES reference configuration the scheme does activate and passes restartability and reproducibility tests but it is unable to improve the model's stability enough to allow an increase in the model time-step. A view of the time-series of maximum partitioning coefficient (not shown here)  suggests that the default time-step of 5400s is already pushing at stability limits, especially in the initial start-up phase. The time-series does not, however, exhibit any of the 'cuspiness' found with the overflow tests. \medskip \noindent A short test with an eORCA1 configuration promises more since a test using a time-step of 3600s remains stable with \forcode{ln_zad_Aimp=.true.} whereas the time-step is limited to 2700s without. \begin{figure}[!t] \end{figure} \begin{figure}[!t] \begin{center} \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf} \caption{ \protect\label{fig:zad_Aimp_maxCf} The maximum partitioning coefficient during a series of test runs with increasing model timestep length. At the larger timesteps, the vertical velocity is treated mostly implicitly at some location throughout the run. } \end{center} \end{figure} \begin{figure}[!t] \begin{center} \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf_loc} \caption{ \protect\label{fig:zad_Aimp_maxCf_loc} The maximum partitioning coefficient for the  \forcode{nn_rdt=10.0s} case overlaid with  information on the gridcell i- and k- locations of the maximum value. } \end{center} \end{figure} % ================================================================
• ## NEMO/trunk/src/OCE/DYN/sshwzv.F90

 r11293 REAL(wp)             ::   zCu, zcff, z1_e3t                     ! local scalars REAL(wp) , PARAMETER ::   Cu_min = 0.15_wp                      ! local parameters REAL(wp) , PARAMETER ::   Cu_max = 0.27                         ! local parameters REAL(wp) , PARAMETER ::   Cu_max = 0.30_wp                      ! local parameters REAL(wp) , PARAMETER ::   Cu_cut = 2._wp*Cu_max - Cu_min        ! local parameters REAL(wp) , PARAMETER ::   Fcu    = 4._wp*Cu_max*(Cu_max-Cu_min) ! local parameters wn(ji,jj,jk) = ( 1._wp - zcff ) * wn(ji,jj,jk) ! Cu_adv(ji,jj,jk) = zcff               ! Reuse array to output coefficient Cu_adv(ji,jj,jk) = zcff               ! Reuse array to output coefficient below and in stp_ctl END DO END DO ELSE ! Fully explicit everywhere Cu_adv(:,:,:) = 0._wp                          ! Reuse array to output coefficient Cu_adv(:,:,:) = 0._wp                          ! Reuse array to output coefficient below and in stp_ctl wi    (:,:,:) = 0._wp ENDIF