2.10.2. Nonlinear freesurface¶
Options have been added to the model that concern the free surface formulation.
2.10.2.1. Pressure/geopotential and free surface¶
For the atmosphere, since \(\phi = \phi_{topo}  \int^p_{p_s} \alpha dp\), subtracting the reference state defined in section Section 1.4.1.2 :
we get:
For the ocean, the reference state is simpler since \(\rho_c\) does not dependent on \(z\) (\(b_o=g\)) and the surface reference position is uniformly \(z=0\) (\(R_o=0\)), and the same subtraction leads to a similar relation. For both fluids, using the isomorphic notations, we can write:
and rewrite as:
or:
In section Section 1.3.6, following eq. (2.70), the pressure/geopotential \(\phi'\) has been separated into surface (\(\phi_s\)), and hydrostatic anomaly (\(\phi'_{hyd}\)). In this section, the split between \(\phi_s\) and \(\phi'_{hyd}\) is made according to equation (2.71). This slightly different definition reflects the actual implementation in the code and is valid for both linear and nonlinear freesurface formulation, in both rcoordinate and r*coordinate.
Because the linear freesurface approximation ignores the tracer content of the fluid parcel between \(R_o\) and \(r_{surf}=R_o+\eta\), for consistency reasons, this part is also neglected in \(\phi'_{hyd}\) :
Note that in this case, the two definitions of \(\phi_s\) and
\(\phi'_{hyd}\) from equations (2.70) and
(2.71) converge toward the same (approximated) expressions:
\(\phi_s = \int^{r_{surf}}_{R_o} b_o dr\) and
\(\phi'_{hyd}=\int^{R_o}_r b' dr\).
On the contrary, the unapproximated formulation
(see Section 2.10.2.2) retains the full expression:
\(\phi'_{hyd} = \int^{r_{surf}}_r (b  b_o) dr\) . This is
obtained by selecting nonlinFreeSurf =4 in parameter file data
.
Regarding the surface potential:
\(b_s \simeq b_o(R_o)\) is an excellent approximation (better than the usual numerical truncation, since generally \(\eta\) is smaller than the vertical grid increment).
For the ocean, \(\phi_s = g \eta\) and \(b_s = g\) is uniform.
For the atmosphere, however, because of topographic effects, the
reference surface pressure \(R_o=p_o\) has large spatial variations
that are responsible for significant \(b_s\) variations (from 0.8 to
1.2 \([m^3/kg]\)). For this reason, when uniformLin_PhiSurf
=.FALSE. (parameter file data
, namelist PARAM01
) a nonuniform
linear coefficient \(b_s\) is used and computed (INI_LINEAR_PHISURF)
according to the reference surface pressure \(p_o\):
\(b_s = b_o(R_o) = c_p \kappa (p_o / P^o_{SL})^{(\kappa  1)} \theta_{ref}(p_o)\),
with \(P^o_{SL}\) the mean sealevel pressure.
2.10.2.2. Free surface effect on column total thickness (Nonlinear freesurface)¶
The total thickness of the fluid column is \(r_{surf}  R_{fixed} = \eta + R_o  R_{fixed}\). In most applications, the free surface displacements are small compared to the total thickness \(\eta \ll H_o = R_o  R_{fixed}\). In the previous sections and in older version of the model, the linearized freesurface approximation was made, assuming \(r_{surf}  R_{fixed} \simeq H_o\) when computing horizontal transports, either in the continuity equation or in tracer and momentum advection terms. This approximation is dropped when using the nonlinear freesurface formulation and the total thickness, including the time varying part \(\eta\), is considered when computing horizontal transports. Implications for the barotropic part are presented hereafter. In section Section 2.10.2.3 consequences for tracer conservation is briefly discussed (more details can be found in Campin et al. (2004) [CAHM04]) ; the general timestepping is presented in section Section 2.10.2.4 with some limitations regarding the vertical resolution in section Section 2.10.2.5.
In the nonlinear formulation, the continuous form of the model equations remains unchanged, except for the 2D continuity equation (2.11) which is now integrated from \(R_{fixed}(x,y)\) up to \(r_{surf}=R_o+\eta\) :
Since \(\eta\) has a direct effect on the horizontal velocity (through \(\nabla_h \Phi_{surf}\)), this adds a nonlinear term to the free surface equation. Several options for the time discretization of this nonlinear part can be considered, as detailed below.
If the column thickness is evaluated at time step \(n\), and with implicit treatment of the surface potential gradient, equations (2.65) and (2.66) become:
where
This method requires us to update the solver matrix at each time step.
Alternatively, the nonlinear contribution can be evaluated fully explicitly:
This formulation allows one to keep the initial solver matrix unchanged though throughout the integration, since the nonlinear free surface only affects the RHS.
Finally, another option is a “linearized” formulation where the total column thickness appears only in the integral term of the RHS (2.66) but not directly in the equation (2.65).
Those different options (see Table 2.1) have been tested and show little differences. However, we recommend the use of the most precise method (nonlinFreeSurf =4) since the computation cost involved in the solver matrix update is negligible.
Parameter 
Value 
Description 

1 
linear freesurface, restart from a pickup file produced with #undef EXACT_CONSERV code 

0 
linear freesurface (= default) 

4 
full nonlinear freesurface 

3 
same as 4 but neglecting \(\int_{R_o}^{R_o+\eta} b' dr\) in \(\Phi'_{hyd}\) 

2 
same as 3 but do not update cg2d solver matrix 

1 
same as 2 but treat momentum as in linear freesurface 

0 
do not use \(r^*\) vertical coordinate (= default) 

2 
use \(r^*\) vertical coordinate 

1 
same as 2 but without the contribution of the slope of the coordinate in \(\nabla \Phi\) 
2.10.2.3. Tracer conservation with nonlinear freesurface¶
To ensure global tracer conservation (i.e., the total amount) as well as local conservation, the change in the surface level thickness must be consistent with the way the continuity equation is integrated, both in the barotropic part (to find \(\eta\)) and baroclinic part (to find \(w = \dot{r}\)).
To illustrate this, consider the shallow water model, with a source of fresh water (\(\mathcal{P}\)):
where \(h\) is the total thickness of the water column. To conserve the tracer \(\theta\) we have to discretize:
Using the implicit (nonlinear) free surface described above (Section 2.4) we have:
The discretized form of the tracer equation must adopt the same “form” in the computation of tracer fluxes, that is, the same value of \(h\), as used in the continuity equation:
The use of a 3 timelevels timestepping scheme such as the AdamsBashforth make the conservation sightly tricky. The current implementation with the AdamsBashforth timestepping provides an exact local conservation and prevents any drift in the global tracer content (Campin et al. (2004) [CAHM04]). Compared to the linear freesurface method, an additional step is required: the variation of the water column thickness (from \(h^n\) to \(h^{n+1}\)) is not incorporated directly into the tracer equation. Instead, the model uses the \(G_\theta\) terms (first step) as in the linear free surface formulation (with the “surface correction” turned “on”, see tracer section):
Then, in a second step, the thickness variation (expansion/reduction) is taken into account:
Note that with a simple forward time step (no AdamsBashforth), these two formulations are equivalent, since \((h^{n+1}  h^{n})/ \Delta t = \mathcal{P}  \nabla \cdot (h^n \, \vec{\bf v}^{n+1} ) = P + \dot{r}_{surf}^{n+1}\)
2.10.2.4. Time stepping implementation of the nonlinear freesurface¶
The grid cell thickness was hold constant with the linear freesurface; with the nonlinear freesurface, it is now varying in time, at least at the surface level. This implies some modifications of the general algorithm described earlier in sections Section 2.7 and Section 2.8.
A simplified version of the staggered in time, nonlinear freesurface algorithm is detailed hereafter, and can be compared to the equivalent linear freesurface case (eq. (2.37) to (2.47)) and can also be easily transposed to the synchronous timestepping case. Among the simplifications, salinity equation, implicit operator and detailed elliptic equation are omitted. Surface forcing is explicitly written as fluxes of temperature, fresh water and momentum, \(\mathcal{Q}^{n+1/2}, \mathcal{P}^{n+1/2}, \mathcal{F}_{\bf v}^n\) respectively. \(h^n\) and \(dh^n\) are the column and grid box thickness in rcoordinate.
(2.72)¶\[\phi^{n}_{hyd} = \int b(\theta^{n},S^{n},r) dr\](2.73)¶\[\vec{\bf G}_{\vec{\bf v}}^{n1/2}\hspace{2mm} = \vec{\bf G}_{\vec{\bf v}} (dh^{n1},\vec{\bf v}^{n1/2}) \hspace{+2mm};\hspace{+2mm} \vec{\bf G}_{\vec{\bf v}}^{(n)} = \frac{3}{2} \vec{\bf G}_{\vec{\bf v}}^{n1/2}  \frac{1}{2} \vec{\bf G}_{\vec{\bf v}}^{n3/2}\](2.74)¶\[\vec{\bf v}^{*} = \vec{\bf v}^{n1/2} + \Delta t \frac{dh^{n1}}{dh^{n}} \left( \vec{\bf G}_{\vec{\bf v}}^{(n)} + F_{\vec{\bf v}}^{n}/dh^{n1} \right)  \Delta t \nabla \phi_{hyd}^{n}\]\[\longrightarrow update \phantom{x} model \phantom{x} geometry : {\bf hFac}(dh^n)\](2.75)¶\[\begin{split}\begin{aligned} \eta^{n+1/2} \hspace{1mm} & = \eta^{n1/2} + \Delta t P^{n+1/2}  \Delta t \nabla \cdot \int \vec{\bf v}^{n+1/2} dh^{n} \\ & = \eta^{n1/2} + \Delta t P^{n+1/2}  \Delta t \nabla \cdot \int \!\!\! \left( \vec{\bf v}^*  g \Delta t \nabla \eta^{n+1/2} \right) dh^{n}\end{aligned}\end{split}\](2.76)¶\[\vec{\bf v}^{n+1/2}\hspace{2mm} = \vec{\bf v}^{*}  g \Delta t \nabla \eta^{n+1/2}\](2.77)¶\[h^{n+1} = h^{n} + \Delta t P^{n+1/2}  \Delta t \nabla \cdot \int \vec{\bf v}^{n+1/2} dh^{n}\](2.78)¶\[G_{\theta}^{n} = G_{\theta} ( dh^{n}, u^{n+1/2}, \theta^{n} ) \hspace{+2mm};\hspace{+2mm} G_{\theta}^{(n+1/2)} = \frac{3}{2} G_{\theta}^{n}  \frac{1}{2} G_{\theta}^{n1}\](2.79)¶\[\theta^{n+1} =\theta^{n} + \Delta t \frac{dh^n}{dh^{n+1}} \left( G_{\theta}^{(n+1/2)} +( P^{n+1/2} (\theta_{\mathrm{rain}}\theta^n) + \mathcal{Q}^{n+1/2})/dh^n \right) \nonumber\]
Two steps have been added to linear freesurface algorithm (eq.
(2.37) to (2.47)): Firstly, the model
“geometry” (here the hFacC,W,S) is updated just before entering
SOLVE_FOR_PRESSURE,
using the current \(dh^{n}\) field.
Secondly, the vertically integrated continuity equation
(2.77) has been added (exactConserv =.TRUE., in
parameter file data
, namelist PARM01
) just before computing the
vertical velocity, in subroutine INTEGR_CONTINUITY. Although this
equation might appear redundant with (2.75), the
integrated column thickness \(h^{n+1}\) will be different from
\(\eta^{n+1/2} + H\) in the following cases:
when CrankNicolson timestepping is used (see Section 2.10.1).
when filters are applied to the flow field, after (2.76), and alter the divergence of the flow.
when the solver does not iterate until convergence; for example, because a too large residual target was set (cg2dTargetResidual, parameter file
data
, namelistPARM02
).
In this staggered timestepping algorithm, the momentum tendencies are computed using \(dh^{n1}\) geometry factors (2.73) and then rescaled in subroutine TIMESTEP, (2.74), similarly to tracer tendencies (see Section 2.10.2.3). The tracers are stepped forward later, using the recently updated flow field \({\bf v}^{n+1/2}\) and the corresponding model geometry \(dh^{n}\) to compute the tendencies (2.78); then the tendencies are rescaled by \(dh^n/dh^{n+1}\) to derive the new tracers values \((\theta,S)^{n+1}\) ((2.79), in subroutines CALC_GT, CALC_GS).
Note that the freshwater input is added in a consistent way in the continuity equation and in the tracer equation, taking into account the freshwater temperature \(\theta_{\mathrm{rain}}\).
Regarding the restart procedure, two 2D fields \(h^{n1}\) and \((h^nh^{n1})/\Delta t\) in addition to the standard state variables and tendencies (\(\eta^{n1/2}\), \({\bf v}^{n1/2}\), \(\theta^n\), \(S^n\), \({\bf G}_{\bf v}^{n3/2}\), \(G_{\theta,S}^{n1}\)) are stored in a “pickup” file. The model restarts reading this pickup file, then updates the model geometry according to \(h^{n1}\), and compute \(h^n\) and the vertical velocity before starting the main calling sequence (eq. (2.72) to (2.79), FORWARD_STEP).
2.10.2.5. Nonlinear freesurface and vertical resolution¶
When the amplitude of the freesurface variations becomes as large as
the vertical resolution near the surface, the surface layer thickness
can decrease to nearly zero or can even vanish completely. This later
possibility has not been implemented, and a minimum relative thickness
is imposed (hFacInf, parameter file data
, namelist PARM01
) to
prevent numerical instabilities caused by very thin surface level.
A better alternative to the vanishing level problem relies on a different vertical coordinate \(r^*\) : The time variation of the total column thickness becomes part of the \(r^*\) coordinate motion, as in a \(\sigma_{z},\sigma_{p}\) model, but the fixed part related to topography is treated as in a height or pressure coordinate model. A complete description is given in Adcroft and Campin (2004) [AC04].
The timestepping implementation of the \(r^*\) coordinate is identical to the nonlinear freesurface in \(r\) coordinate, and differences appear only in the spacial discretization.