<<

Ocean Modelling 38 (2011) 41–70

Contents lists available at ScienceDirect

Ocean Modelling

journal homepage: www.elsevier.com/locate/ocemod

Accurate Boussinesq oceanic modeling with a practical, ‘‘Stiffened’’ Equation of State ⇑ Alexander F. Shchepetkin , James C. McWilliams

Institute of Geophysics and Planetary Physics, University of California, 405 Hilgard Avenue, Los Angeles, CA 90095-1567, United States article info abstract

Article history: The Equation of State of seawater (EOS) relates in situ density to temperature, salinity and . Most Received 9 August 2008 of the effort in the EOS-related literature is to ensure an accurate fit of density measurements under the Received in revised form 25 December 2010 conditions of different temperature, salinity, and pressure. In situ density is not of interest by itself in oce- Accepted 31 January 2011 anic models, but rather plays the role of an intermediate variable linking temperature and salinity fields Available online 13 February 2011 with the pressure-gradient force in the equations, as well as providing various stability func- tions needed for parameterization of mixing processes. This shifts the role of EOS away from representa- Keywords: tion of in situ density toward accurate translation of temperature and salinity gradients into adiabatic Seawater Equation of State derivatives of density. Seawater compressibility Barotropic–baroclinic mode splitting In this study we propose and assess the accuracy of a simplified, computationally-efficient algorithm Boussinesq and non-Boussinesq modeling for EOS suitable for a free-surface, Boussinesq-approximation model. This EOS is optimized to address Numerical stability all the needs of the model: notably, computation of pressure gradient – it is compatible with the monot- onized interpolation of density needed for the pressure gradient scheme in sigma-coordinates of Shche- petkin and McWilliams (2003), while more accurately representing the pressure dependency of the thermal expansion and saline contraction coefficients as well as the stability of stratification; it facilitates mixing parameterizations for both vertical and lateral (along neutral surfaces) mixing; and it leads to a simpler, more robust, numerically stable barotropic–baroclinic mode splitting without the need of exces- sive temporal filtering of fast mode. In doing so we also explore the implications of EOS compressibility for mode splitting in non-Boussinesq free-surface models with the intent to design a comparatively accu- rate algorithm applicable there. Ó 2011 Elsevier Ltd. All rights reserved.

1. Role of EOS in oceanic modeling the local column thickness), both of which participate in baro- tropic–baroclinic mode-splitting algorithm of Shchepetkin and The Equation of State (EOS) relates the in situ density of seawa- McWilliams (2005,); ter with its temperature (or potential temperature), salinity, and Stability of stratification as well as external thermodynamic pressure (H, S, P, respectively), forcing (surface flux) needed for mixing and plane- tary boundary layer parameterizations; q ¼ q ðH; S; PÞ: ð1:1Þ EOS Slope of neutral surfaces needed for horizontal (along-isopyc- In a Boussinesq-approximation oceanic modeling code, in situ den- nal) mixing (Griffies et al., 1998). sity does not appear by itself (since it is replaced by a constant ref- erence density). Instead EOS and EOS-related quantities are needed The purpose of this study is to review the present oceanic mod- for the following computations: eling practices for using EOS in these roles, focusing on the effects associated with seawater compressibility, and it assesses the con- Pressure-gradient force (PGF); sequences of the Boussinesq approximation in the context of a Vertically averaged density q and the effective dynamic density realistic EOS. The present study extends the analysis of conse-

for the barotropic mode q⁄ (vertically integrated pressure nor- quences of Boussinesq approximation from Shchepetkin and malized by gD2/2 where g is of gravity and D is McWilliams (2008). This paper is organized as follows: Section 2 makes a overview of the Boussinesq approximation, analyzes the errors associated with using realistic seawater EOS, and introduces stiffening of EOS as a method to reduce these errors. Section 3 examines the ⇑ Corresponding author. E-mail addresses: [email protected] (A.F. Shchepetkin), [email protected] consequences of finite compressibility of seawater for the four (J.C. McWilliams). algorithmic roles outlined above, to establish requirements for

1463-5003/$ - see front matter Ó 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.ocemod.2011.01.010 42 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 the most suitable functional form of EOS. Special attention is given Boussinesq approximation which can be subdivided into two to barotropic–baroclinic mode-splitting since this subject is rarely categories: discussed in the literature. Section 4 introduces a practical form of EOS and makes estimates of its accuracy. Section 5 explores the (i) errors relative to not using the Boussinesq approximation consequences of eliminating the Boussinesq approximation with including not only quantitative, but conceptual as well, i.e., the emphasis on accuracy of barotropic–baroclinic mode-splitting excluded physical processes and/or missing/altered conser- algorithm in the context of finite compressibility of seawater. Sec- vation laws; and tion 6 is the conclusion. (ii) conflicts and internal inconsistencies caused the use of a realistic seawater EOS with full compressibility effects within a Boussinesq oceanic model. 2. Boussinesq approximation and EOS stiffening Errors of type (i) are widely discussed in the literature The Boussinesq approximation (e.g., Spiegel and Veronis, 1960; (McDougall and Garrett, 1992; Dukowicz, 1997; Lu, 2001; Zeytounian, 2003, among others) replaces in situ density q with a Greatbatch et al., 2001; Huang and Jin, 2002; McDougall et al., constant reference value q0 in all places where it plays the role 2002; Greatbatch and McDougall, 2003; Losch et al., 2004; Griffies, of a measure of inertia, i.e., everywhere except where multiplied 2004; Young, 2010; Tailleux, 2009; Tailleux, 2010). by the acceleration of gravity g. The field becomes non- An example of an internal inconsistency of type (ii) can be illus- divergent (incompressible) because the continuity equation trated by considering a barotropic compressible fluid layer whose changes its meaning from mass to volume conservation. This re- density is a function of P alone (i.e., because H, S are spatially uni- verses the role of EOS from computing specific volume in a form) and in hydrostatic balance, mass-conserving model to density q in a volume-conserving one. q ¼ q ðPÞ and @ P ¼gq: ð2:1Þ The conservation laws (momentum, energy, tracer content, etc.) EOS z are changed from mass-to volume-integrated; the thermodynam- Integration of (2.1) yields mutually consistent vertical profiles for P ics is reduced to Lagrangian conservation (advection and diffusion) and q, of H and S, while heating/cooling of fluid by adiabatic compres- ( P ¼Pðf zÞ; P0ðf zÞ¼gRðf zÞ; sion/expansion is neglected (except in the definition of potential such that temperature itself) and mechanical energy dissipated by viscosity q ¼Rðf zÞqEOSðPðf zÞÞ; Pð0Þ¼Pjz¼f ¼ 0; is considered ‘‘lost’’ rather than converted into heat (Mihaljan, ð2:2Þ 1962). If EOS is a linear function of H and S, mass is conserved where and are universal functions of a single argument, i.e., (along with volume) as a consequence of, and to the same degree P R their structure depends only one the properties of (P)in(2.1) as, the conservation of H and S; external heating/cooling produces qEOS but not directly on the local dynamical conditions, such as pertur- a decrease/increase in mass, while keeping volume constant; and bation of the free-surface f. 0 denotes derivative of with respect nonlinear EOS causes a Boussinesq model to conserve only volume, P P to its argument (note that the sign is correct as stated above: both p but no longer mass, even in the absence of external forcing. and increase with increase of f z, meaning increase downward). The Boussinesq approximation brings simplifications by elimi- q The condition 0 0 is the free-surface pressure boundary condi- nating mass-weighting in a finite-volume code and limiting the Pð Þ¼ tion (for simplicity the atmospheric pressure is presumed to be con- role of EOS to the four purposes stated in Section 1. Except in the stant and subtracted out). part of pressure-gradient term associated with perturbation of free A gradient of f induces a pressure gradient, surface in a free-surface model, q itself can be replaced with its 0 0 perturbation, q = q q0, because it appears only inside spatial rxP ¼Pðf zÞrxf; ð2:3Þ derivatives (ultimately linked to the gradients of H and S) and only 0 and creates acceleration in the context of buoyancy commonly defined as gq /q0, i.e., nor- 0 malized by q0, whereas the equations can always rewritten in such 1 P ðf zÞ rxP ¼ rxf grxf; ð2:4Þ a way that q0 itself appears only in the context of this normaliza- q Rðf zÞ tion and nowhere else. The Boussinesq approximation facilitates the barotropic–baroclinic mode-splitting in a pair of vertically- independently of vertical coordinate z regardless of the specific integrated free-surface and momentum equations, effectively functional form qEOS(P)in(2.1) and of the magnitude of the density uncoupling EOS from the barotropic mode. The incompressibility variation within the column. Eq. (2.4) is derived without the use of assumption eliminates acoustic waves regardless of whether the Boussinesq approximation. Its Boussinesq analog is hydrostatic approximation is made. 1 Rðf zÞ r P ¼g r f: ð2:5Þ However, physically important effects associated with seawater q x q x – cabbeling and thermobaricity – fundamentally require pressure- 0 0 dependency in EOS and lead to the common practice of using the The presence of the multiplier R=q0, which increases with depth, is full non-approximated EOS, thus retaining its full compressibility clearly an artifact of the Boussinesq approximation. It results in an even in an otherwise dynamically incompressible Boussinesq mod- unphysical vertical shear in the acceleration, hence a spurious el. This obscures the concept of buoyancy because it can no longer downward intensification of a geostrophically-balanced baroclinic be equated to the density (or potential density) anomaly, and can current generated by a rxf. Both these spurious effects are caused no longer be viewed as a Lagrangianly-conserved properly of the by the standard algorithmic chain in a Boussinesq model, fluid, even thought H and S are. A related, frequently used approx- imation is the replacement of the full in situ pressure P in EOS (1.1) 1 H; S ! q ¼ qEOSðH; S; P ¼ q0gðf zÞÞ ! rxP: ð2:6Þ with its bulk hydrostatic reference value, P ? q0gz, when com- q0 puting q from the model prognostic variables, H and S, hence neglecting pressure variation due to baroclinic effects and essen- To estimate the significance of this error, consider for simplicity a tially decoupling EOS pressure from the dynamic. linear analog of (2.1), Under most offshore oceanic conditions varies by ± 3% rel- q 2 ative to its reference value; this leads to errors associated with the qEOSðPÞ¼q1 þ P=c ; ð2:7Þ A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 43

where q1 is the density at P = 0 and c is of sound. Then the For the situation where the fluid is stratified (i.e., (2.1) is no counterpart of (2.2) becomes longer true) but the structure of temperature and salinity fields 2 2 q g are such that the resultant isosurfaces of in situ density are parallel Pðf zÞ¼q c2½egðfzÞ=c 1q gðf zÞþ 1 ðf zÞ2 þ; 1 1 2c2 to the free surface, one can verify that (2.4) still holds and the 2 acceleration generated by a perturbation in f does not depend on 2 q g q g Rðf zÞ¼q egðfzÞ=c q þ 1 ðf zÞþ 1 ðf zÞ2 þ; 1 1 c2 2c4 the vertical coordinate as long as the Boussinesq approximation is not used. Once again, the Boussinesq approximation destroys ð2:8Þ the true vertical uniformity. The baroclinic PGF – i.e., associated hence with a physically correct vertical shear – appears only when den- R q q q g sity isosurfaces become non-parallel to the free surface. 1 þ 1 0 þ 1 ðf zÞþ ð2:9Þ 2 Dukowicz (2001) made a proposal to reduce Boussinesq errors q0 q0 q0 c 2 by realizing that the largest q variation is caused by the changes Here = g(f z)/c plays the role of a small parameter justifying the 1 in P rather than in H and S. EOS (1.1) may be rewritten as replacement of q with q0. Assuming c 1500 m/s and a total depth of 5500 m, we estimate 0.025, which is a typical level for Bous- q ¼ rðPÞqEOSðH; S; PÞ; ð2:12Þ sinesq-approximation errors. This also indicates a strong domi- where the multiplier r(P) is chosen as a universal function that does nance of the leading-order linear term in Taylor-series expansions not depend on local H and S. q ðH; S; PÞ is known as thermobaric over the remaining terms. A comparison of (2.5) with (2.4) suggests EOS or ‘‘stiffened’’ density. It only weakly depends on P, thus has much that the best choice of Boussinesq reference density is R smaller variation than the original in situ density. Using (2.12) one q ¼ q ¼ 1 f Rðf zÞdz, D = h + f to have the vertical integral of 0 D h can renormalize pressure, (2.5) match its non-Boussinesq counterpart (2.4). In the case of EOS (2.7) this leads to dP 1 ¼ ; P jP¼0 ¼ 0; ð2:13Þ 2 dP rðPÞ c 2 1 gD q ¼ q egD=c 1 q 1 þ þ ; ð2:10Þ 1 gD 1 2 c2 hence the hydrostatic balance and PGF become which makes (2.9) into ðR=q Þ¼1 þ gðf z D=2Þ=c2, effectively @P 1 1 0 ¼qg and r P ¼ r P: ð2:14Þ minimizing its deviation from unity. However, this cannot be done @z q x q x universally, since q changes horizontally mainly due to topography, These retain the same functional form as in the original non-Bous- nor does it eliminate the spurious vertical shear. sinesq equations. Because r(P) is a monotone function, (2.13) is The presence of shear in (2.5) depends on whether or not the invertible, P = P(P), making it possible to rewrite EOS as EOS pressure is computed as in situ pressure, which takes place in (2.2), or is approximated by its bulk hydrostatic value propor- q ¼ qEOSðÞH; S; PðP Þ =rðPðP ÞÞ ¼ qEOSðÞH; S; P : ð2:15Þ tional to depth, and furthermore, whether the depth is calculated The entire set of equations is then expressed in terms of dotted vari- from the dynamic or rest-state free surface, Pbulk = q0g(f z)or ables, q and P. q0gz, 8 8 A Boussinesq-like approximation is subsequently applied to the < g f z =c2; < gz=c2; renormalized system (2.13)–(2.15) by replacing wherever qEOS ¼ q1 þ q0ð Þ qEOS ¼ q1 q0 q ! q0 vs: : 1 q1 gðfzÞ : 1 q1 gf the replacement q ? q0 occurs in the standard Boussinesq approx- rxP ¼g þ 2 rxf; rxP ¼g 2 rxf: q0 q0 c q0 q0 c imation (e.g., ð1=q ÞrxP !ð1=q0ÞrxP ). In addition, one can ½vertical shear is present½no shear replace EOS pressure P in (2.15) with its bulk value, q0gz. qEOS ð2:11Þ is much less sensitive to this replacement than qEOS in (1.1), whether the integration of EOS pressure starts from a perturbed This sensitivity was noted by Dewar et al. (1998) (their Case A), who or unperturbed free surface (cf., (2.11)) since @qEOS=@P jH;S estimate that the magnitude of the difference in near-bottom geo- @qEOS=@PjH;S and P tends to be closer to a linear function of depth strophic currents may reach 5 cm/s for Gulf Stream conditions, than P. The multiplier r(P) does not appear in the momentum equa- resulting in an overall difference of about 3 out of 50 Sv for verti- tions written in advective form, but it does appears in the non- cally integrated transport. They recommend using full dynamic Boussinesq continuity equation along with q. This leads to the in situ pressure in EOS, which requires simultaneous vertical inte- two options, either. gration to compute PEOS and q. Paradoxically, they do so using Bous- sinesq approximation, interpreting the difference as the recovered (i) to replace r(P) ? 1 along with q ! q0 resulting in a vol- physical effect, rather than a spurious one to be eliminated. Com- ume-conserving system of Boussinesq-type. In this case parison of (2.2)–(2.4) with (2.11) suggests that using the rest-state EOS stiffening can be viewed just as a measure to remove (f = 0) bulk pressure in EOS is more suitable for a Boussinesq model, internal contradiction of using a compressible EOS in a while a non-Boussinesq model is better using in situ pressure. (One model that already makes the incompressibility assumption; can also verify that the opposite combination – bulk rest-state EOS or pressure in a non-Boussinesq model – yields a reversal of the spu- (ii) keep r(P), while simplifying it by rðPÞ!rPðP ¼q0gzÞ ¼ rious shear: it tends to make otherwise barotropic flows decrease rðzÞ, but still replacing q ! q0 in continuity and, in fact, with depth.) Another aspect pointed out by Dewar et al. (1998) is everywhere as it would be in the Boussinesq case. that in most oceanic situations the baroclinicity naturally tends to cancel the free-surface PGF resulting in weak flows in the abyss. The latter leads to a model intermediate in its physical approx- Therefore, it is advantageous to retain baroclinic effects in EOS pres- imations between Boussinesq and non-Boussinesq, while main- sure rather than use PEOS = q0g(f z), (e.g., left side of (2.11)) that taining the simplicity of a Boussinesq code. One should note that does not provide such compensation. Using q0g(f z) is a common practice in terrain-following-coordinate free-surface models, POM 1 We have changed the original notation of Dukowicz (2001) by replacing his q⁄, and ROMS, motivated primarily by the convenience: these models ⁄ P ? q , P to avoid notational conflict with vertically averaged densities q and q⁄ that do not store the unperturbed geopotential coordinate in a run-time appear in (3.19). For the same reason we also changed notation relatively to SM2005, ⁄ array. so q⁄ appearing in this article has the same meaning as q in SM2005. 44 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 most oceanic models are discretized using a finite-volume ap- and McWilliams (2003,); re-evaluate the accuracy of the mode- proach with a stretched vertical grid, so they already have an array splitting algorithm of SM2005 focusing on compressibility effects; to compute and store control-volume heights. A non-Boussinesq and inspect the EOS needs for subgrid-scale mixing model uses density weighting over control volumes, resulting in parameterizations. an additional feedback loop arising from the dependency of density on model dynamics by EOS pressure which adds extra complexity. 3.1. Pressure-gradient force in sigma-coordinates On the other hand, retaining r(P) approximated as r(z) only slightly modifies the procedure of calculating control volumes, while pre- Following SM2003, the baroclinic PGF in r coordinates can be serving the overall logical flow of a Boussinesq code. This means expressed entirely in terms of adiabatic derivatives of in situ den- that the model is still volume-conserving, but now control volumes sity: a density-Jacobian scheme is written as are rescaled to include r(z)-weighting that can be viewed just as a J ðq; zÞ¼a J ðH; zÞþb J ðS; zÞ; ð3:1Þ geometrical property of the grid since it does not depend on model x;s x;s x;s dynamics. In effect, this option approximates in situ density as which is then integrated vertically to compute PGF. J x;s denotes the q0 rðzÞ instead of the constant q0 in the standard Boussinesq Jacobian of its two arguments, approximation. @ @z @ @z To illustrate the effect of modifying the Boussinesq approxima- q q J x;sðq; zÞ¼ ; ð3:2Þ tion in this way, we reconsider (2.7)–(2.11). In this case it is natural @x s @s @s @x s 2 % 0; z ! f to chose q0 ¼ q1 and r(P)=1+P/(q1c ). Then the stiffened EOS where s ¼ sðx; zÞ (2.15) becomes q ¼ qEOSðP Þ¼q1, which is just a constant value, &1; z !h; i.e., qEOS becomes infinitely ‘‘stiff’’ and therefore insensitive to @s > 0; s is a generalized sigma-coordinate;2 and how EOS pressure is computed (the opposite of (2.11)). The renor- @z malized pressure is P = gq1(f z), resulting in ð1=q0ÞrxP ¼ gðq =q Þrxf ¼grxf, which coincides with the non-Boussinesq 1 0 a ¼ aðH; S; PÞ¼@q=@HjS;P¼const; version (2.4) and does not contain any spurious vertical shear. Note 2 2 b ¼ bðH; S; PÞ¼@q=@Sj ð3:3Þ 2 P =ðq1c Þ P =ðq1c Þ H;P¼const that PðP Þ¼q1c ðe 1Þ and rðP Þ¼e ; this translates 2 into rðzÞ¼egðfzÞ=c . are thermal expansion and saline contraction coefficients.3 Geopo- The preceding example is rather trivial because H, S fields are tential height z in (3.1) is used as a proxy for EOS pressure – replac- uniform which makes it possible to express the entire density var- ing it with gq0z, hence neglecting the non-uniformity of density iation in terms of r(P), so the subsequent replacement q ! q0 and the contribution due to f – 0. This is a common approximation leads to an equivalence of the modified Boussinesq and non-Bous- in Boussinesq codes. Eq. (3.1) has as its only EOS requirement on the sinesq models. In the general case H, S are not uniform, and the computation of a and b. Because a and b depend on pressure (depth), approximation is not exact. However, (2.12)–(2.15) is still a very the weighting of J x;sðH; zÞ and J x;sðS; zÞ in the r.h.s. changes with effective measure to reduce Boussinesq-approximation errors (by depth as well, so that the same pair of gradients of H and S yields 90%) because for realistic conditions the variations of speed of differing contributions in PGF with depth (a thermobaric effect). sound c are relatively small (i.e., c = 14801540 m/s) and a large Eq. (3.1) involves two separate Jacobians for H and S. Comput- portion of that variation is due to changes in pressure alone, which ing them separately and combining them at the last stage is unde- can be excluded from contributing to the errors. EOS in (2.1) is sirable because applying discretized monotonicity constraints to H nonlinear with respect to P; however, (2.4) still holds and r(P) and S separately does not guarantee positive stratification of inter- can absorb the entire density variation in this case as well. The polated density, even if the density values corresponding discrete effectiveness of using (2.12) is facilitated by the fact that variations H and S are positively stratified. This can lead to large errors and of H, S tend to decrease significantly with depth, where EOS non- possible numerical instability if the density field is not smooth linearities due to P are strongest. on the grid scale. Instead, for reasons explained below, the pre- Finally, we should note that McDougall et al. (2002) proposed ferred form of EOS is an alternative version of Boussinesq approximation, where they Xn interpret Boussinesq velocity not in its original meaning, but as q ¼ qð0Þ þ q0 ðH; SÞþ qð0Þ þ q0 ðH; SÞ ðzÞm; ð3:4Þ ~ 1 1 m m re-normalized mass flux per unit area, u ¼ qu=q0. Their system m¼1 does not produce non-physical shear in geostrophically-balanced where ð0Þ 0 H; S is density with a given potential temper- flow in the Boussinesq case (2.6), because now it is u~, not u be- q1 ¼ q1 þ q1ð Þ comes proportional to vertical density profile, which means that ature and salinity at surface pressure; the compressibility coeffi- cients q qð0Þ q0 H; S do not depend on z; ð0Þ; qð0Þ; ...; qð0Þ are the unscaled velocity in vertically uniform, hence is correct. They m ¼ m þ mð Þ q1 1 n constant bulk values chosen in such a way that ð0Þ 0 , concluded that the new Boussinesq makes EOS stiffening of Duko- q1 q1 qð0Þ q0 ; the absolute depth ( z) serves the role of EOS pressure wicz (2001) unnecessary, because it can be avoided by their ap- 1 1 proach. Unfortunately their system has an undesirable side effect (when it appears inside EOS it increases downward, counting from of altering scaling relationship between advection and Coriolis either the rest-state free surface z = 0, or the actual free surface term which makes it impossible to derive a potential vorticity z = f). Then J x;sðq; zÞ can be computed as equation for a shallow layer of barotropic compressible fluid, see Appendix A. This puts their system into disadvantage relatively 2 to Boussinesq equations with stiffened EOS, and negates their crit- Throughout this study we use s to denote an arbitrary, non-separable, surface- and terrain-following coordinate z=z(x,y,s). In contrast, r is strictly reserved for the icism of Dukowicz (2001). proportional (non-stretched) sigma-coordinate, r =(z f)/(h + f). However, in any case the displacements of coordinate surfaces caused by free-surface movement are

proportional to the distance from the bottom, otzjs=const = otf(z + h)/(h + f). 3. Pressure effects in EOS 3 In a more standard definition a and b are normalized by density, hence a = (1/ q)oq/oHjS,P=const and b = (1/q)oq/oSjH,P=const, where q is either in situ (non-Boussinesq version), or q = q is Boussinesq reference density (if Boussinesq approximation is In this section we examine the specific requirements on EOS for 0 used). Since for the purpose of the present study it is important to keep track of the the purposes listed in Section 1 to find a functional form compat- q ? q0 replacement on every occasion, we chose to exclude (1/q) from the definition ible with the PGF calculation in sigma-coordinates, Shchepetkin of a and b. A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 45

Xn leads to J ðq; zÞ¼J q0 ; z þ ðzÞm J ðq0 ; zÞ; ð3:5Þ Z x;s x;s 1 x;s m 0 m¼1 @P @f 0 ¼ gqjz¼f þ g J x;sðq; zÞds @x z @x s where (z)m are treated as coefficients not subject to differentia- @f Xn @f @f tion. For this reason this can also be viewed as a form of adiabatic ¼ gqð0Þ þ qð0Þ ðf zÞm ¼ gq : ð3:10Þ ð0Þ ð0Þ ð0Þ 1 @x m @x @x differentiation. The contribution of terms with q1 ; q1 ; q2 ; ..., can- m¼1 cels out identically here; i.e., they are dynamically passive. To en- In a Boussinesq model the last term in the r.h.s. is divided by q0, sure that the stratification corresponding to the interpolated which leads to a spurious vertical shear in a purely barotropic flow density field stays non-negative (non-oscillatory), the algorithm of (cf., (2.5) in Section 2). From this point of view, it is desirable to ex- SM2003 relies on a measure of the smoothness of density field ð0Þ ð0Þ clude q1 ; q2 ; ... from (3.4): based on the ratio of consecutive adiabatic differences. The scheme Xn is based on cubic polynomial fits and requires evaluation of density 0 0 0 0 m q ¼ q0 þ q where q ¼ q1ðH; SÞþ qmðH; SÞðzÞ ; ð3:11Þ derivatives at the same discrete locations as density itself, qi,j,k, m¼1 which in its turn needs some kind of averaging of elementary differ- after which using (z)orf z no longer makes a noticeable differ- ences over the two adjacent grid intervals. If the two elementary ence SM2003. EOS stiffening of Dukowicz (2001) can be imple- differences are of the same sign, but differ by more than a factor mented in this context by choosing of three, a simple algebraic averaging overestimates the derivative Xn at the location of qi,j,k and causes spurious oscillation of the cubic ð0Þ ð0Þ m rðzÞ¼1 þ 1=q1 qm ðzÞ ð3:12Þ polynomial interpolant. If EOS has no dependency of pressure, a m¼1 conventional monotonization algorithm for the interpolation of density would suffice, but for a realistic EOS the comparison of ele- and applying it to (3.4). This leads to cancellation of terms contain- ing qð0Þ; qð0Þ; ..., etc., and, after expansion in powers of ( z), the mentary differences is meaningful only if they are defined in an adi- 1 2 0 abatic sense, resultant q can be expressed in the same functional form as 0 (3.11), but with a modified set of coefficients: the qmðH; SÞ are 6 0ðadÞ 0 0 slightly reduced to account for 1/r(z) 1. Obviously, r(z) commutes Dqiþ1=2;j;k ¼ q1iþ1;j;k q1i;j;k with the Jacobian operator, Xn m 0 0 ziþ1;j;k þ zi;j;k þ q q : ð3:6Þ J x;sðrðzÞq ; zÞ¼rðzÞJx;sðq ; zÞ; ð3:13Þ miþ1;j;k mi;j;k 2 m¼1 however, the corresponding discrete relationship holds only within The two adjacent adiabatic differences are averaged using harmonic the order of accuracy, not exactly. mean, and (if needed) the compressible part is computed and added The above choice of r(z) is on par with Sun et al. (1999), Hallberg separately, (2005), but differs from Dukowicz (2001), who derives it from globally-averaged H,S-profiles from observations to make q rðzÞ as close as possible to in situ density: this is incompatible 2Dq0ðadÞ Dq0ðadÞ 0 @q 1 iþ1=2;j;k i1=2;j;k with the algorithm (3.6) and (3.7) for avoiding spurious oscillations di;j;k ¼ @n Dn 0ðadÞ 0ðadÞ i;j;k Dqiþ1=2;j;k þ Dqi1=2;j;k in stratification, which leads to the alternative fit in Section 4. "# In summary we identify the following requirements on EOS for 0 0 @z þ q þ 2q ðzi;j;kÞþ ; ð3:7Þ accurate computation of PGF in a sigma-model: accurate depen- 1i;j;k 2i;j;k @n i;j;k dency of a and b on H, S, and pressure (depth); non-appearance ð0Þ ð0Þ of in situ density and suppression of the bulk terms q1 ; q1 , ..., 0ðadÞ 0ðadÞ which is applicable if Dqiþ1=2;j;k and Dqi1=2;j;k have the same sign; etc. in PGF; and an EOS form that facilitates computation of adia- otherwise the first term in the r.h.s. is replaced with zero. Because batic differences in all directions. the harmonic averaging never exceeds twice the smaller of the two operands, it acts as monotonization algorithm for interpolation. 3.2. Barotropic–baroclinic mode-splitting 0 0 0 The algorithm (3.6), (3.7) requires that q1, q1, q2, ... be available separate from the EOS calculation. This is practical only if (3.4) is re- The barotropic–baroclinic mode-splitting algorithm of SM2005 0 stricted to a very few coefficients qm. In Section 4 we will present a makes the Boussinesq approximation without analyzing its conse- sufficiently accurate approximation to EOS with the functional form quences for mode-splitting. It assumes that the fluid is incom- 0 0 0 of (3.4) that contains only two coefficients, q1 ¼ q1ðH; SÞ and q2, pressible and that all q variations occur due to baroclinicity, 0 with the latter being just a constant multiplied by q1. which is not the realistic case where most of the q change is caused From the above one might get an impression that the passive- by P rather than (H,S) variation.4 In this section we provide a de- ð0Þ ð0Þ ð0Þ ness of the bulk terms q1 ; q1 ; q2 ; ...in (3.4) is just a consequence tailed analysis of how mode splitting is affected by the compressibil- of neglecting the contribution disturbance of f in EOS pressure. ity effects. This is not correct. Including f in EOS pressure would cause a Bous- The purpose of mode-splitting is to take advantage of the differ- sinesq error of the type (ii) in (2.5)–(2.11). Consider an EOS with ence of time scales between external gravity-wave propagation the form, and other, slower processes. Its key element is expressing the ver- tically-integrated PGF, Xn Z q ¼ qð0Þ þ qð0Þ ðf zÞm þ ð3:8Þ 1 f 1 m P dz f; f; x; z ; x; z ; 3:14 m¼1 F¼ r? ¼F½r? r?qð Þ qð Þ ð Þ q0 h where denotes the primed terms in (3.4) that depend on H and S. in two parts: one that can be efficiently computed from only the The contribution of the bulk terms barotropic variables (e.g., f) and another that is independent (or

Xn @z @f 4 This situation is partially addressed by removing the dynamically passive bulk- J ðq; zÞ¼ qð0Þ m ðf zÞm1 ; ð3:9Þ x;s m @s @x compressibility terms from EOS in SM2003, but the main motivation was to reduce m¼1 the PGF error, rather than to improve mode splitting. 46 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 as weakly dependent as possible) on f. With F the vertically inte- as an approximation for barotropic PGF (Berntsen et al., 1981; grated momentum equation is rewritten as Blumberg and Mellor, 1987; Killworth et al., 1991). These are Boussinesq-approximation models that assume the smallness of @tðDuÞþ¼ |{z}dF þ½FdF: ð3:15Þ |fflfflfflfflfflffl{zfflfflfflfflfflffl} q(x,z) q0, and their mode-splitting procedures rely on this small- – @ðdFÞ=@f 0 @=@f0 ness as well. Isopycnic models tend to be non-Boussinesq and use a different mode-split, essentially linking dF to the bottom pressure The first r.h.s. term, dF, is identified as the barotropic PGF. In split- explicit time-stepping it is treated as ‘‘fast’’ and recomputed at each of the resting state (f =0)(Bleck and Smith, 1990). Since the bot- tom pressure is computed by vertical hydrostatic integration, this barotropic time step. Conversely, the second is ‘‘slow’’ and accord- ingly kept constant during the barotropic stepping and only up- translates into dF¼gDr?ðqfÞ, where q is the vertically-aver- aged density. (Note that this dF is dimensionally different from dated during the baroclinic step. F must be computed at every baroclinic step before the barotropic stepping begins. When com- the similar term in (3.15) because non-Boussinesq models use den- sity-weighting to compute u.) This split is also empirical and puting F by (3.14), there is no other choice than to use the latest available f, which at this moment is at the previous time step. Con- approximate. Higdon and de Szoeke (1997) propose a more accu- rate split for a non-Boussinesq isopycnic model, which replaces q sequently, the residual dependency of FdF on f results in a r.h.s. term of a hyperbolic nature treated by using an effectively forward- with a different value computed from the local vertical profile of Euler baroclinic time-stepping. This may lead to a numerical insta- density (somewhat similar to q⁄, but expressed in terms of specific bility, imposing an additional non-physical restriction on the baro- volume rather than density). In all cases, with or without the Bous- sinesq approximation, the fluid was considered as incompressible clinic time-step size or may require extra damping. The difficulty 7 comes from the fact that (3.14) is generally a nonlinear functional, for the purpose of mode-splitting. involving products of density and, in principle, dependence of q on f The goal of replacing gDr\f with (3.18), (3.19) is to achieve mutual consistency between the 3D and 2D parts of the model– through EOS compressibility. To address these issues, dF is derived mainly in the ability of the split 2D part to yield the same barotrop- as a variational derivative of F (SM2005, also Shchepetkin and ~ McWilliams, 2008) ic gravity-wave phase speed c as the full 3D model. This consis- tency may or may not provide an improvement in the overall @F @F physical accuracy. The sources of mode-splitting error from using dF¼ dðÞþr?f df; ð3:16Þ @ðÞr?f @f gDr\f as the barotropic PGF are the following: where f and f are viewed as independent state variables.5 The r\ (i) ‘‘Horizontal baroclinicity’’: Suppose the fluid is incompress- use of (3.16) ensures that when two different time-stepping algo- ible and there is no vertical stratification, but the density rithms are applied separately to the barotropic and baroclinic com- varies horizontally, hence q ¼ q ¼ qðxÞ. Because of the ponents, the resultant sum of the updated barotropic PGF (i.e., Boussinesq approximation, F and ~c are seenp byffiffiffiffiffiffiffiffiffiffiffi the 3D part computed from the new f) and the original 3D ? 2D forcing term of the model as proportional to q=q and q=q , respec- ½FdF is sufficiently close to the vertically-integrated PGF com- 0 0 tively. The spatial variation of q makes it impossible to puted from the new f, choose q0 in such a way that the use of the gDr\f-term

0 @F 0 @F 0 for the barotropic mode accurately approximates F, espe- dF þ½FdF ¼ F þ r?ðf fÞþ ðf fÞ cially in a very large basin, thus contributing to mode-split- @ðr?fÞ @f ting error using gDr f. The small parameter associated ¼F0 þ Oððf0 fÞ2Þ; ð3:17Þ \ with this type of error is ðq q0Þ=q0. 0 0 0 (ii) Vertical stratification: ~c is smaller in a stratified compressible where F¼F½f; r?f; r?q; q and F ¼F½f ; r?f ; r?q; q corre- spond to the old f and the updated f0 each with same density field. fluid than in a stratified incompressible fluid with the same The Oððf0 fÞ2Þ estimate of the mismatch between F 0 and the l.h.s. depth, comes from the fact that (3.17) is essentially a Taylor-series expan- ~c2 ¼ gh ^c2; ð3:20Þ sion of F 0 in powers of f0 f. Assuming that q does not depend on f 1 6 and remains frozen during barotropic time-stepping, (3.16) yields where ^c1 is the gravity-wave phase speed of the first baro- "# ! clinic mode (Appendices C and D). The relevant small param- g q f2 eter for estimating this mode-splitting error is the ratio of the dF¼ hr?ðÞþqf r? þðq qÞfr?h ; ð3:18Þ q 2 2 0 squares of the modal phase , ~c1=ðghÞ. (iii) Seawater compressibility: In the case of constant bottom 8 Z f > 1 topography ~c is reduced relative to an incompressible fluid <> qðxÞ¼ qðx; zÞdz D with the same depth by where h Z Z 3:19 > f f ð Þ > 1 0 0 1 gh : q ðxÞ¼ qðx; z Þdz dz ~2 : 2 c ¼ gh 1 2 þ ð3 21Þ D =2 h z 2 c are two-dimensional horizontal (with x =(x,y)) fields kept constant (Appendices A and B for non-stratified and stratified cases). during barotropic time-stepping. This implies that the splitting The mechanism of this reduction is non-Boussinesq and is algorithm relies on the independence of q and q⁄ from f, which in associated with the fact that the volumetric divergence of turn relies on the assumption of independence of EOS from f. horizontal barotropic velocity causes a smaller response in A property of (3.18) is that if density is uniform, q ¼ q ¼ q0, dF f than in an incompressible fluid. The use of (3.18), (3.19) reverts back to gDr\f that is used by most of the oceanic models qualitatively captures the influence of compressibility–by

5 A finite-difference version of (3.14) is a function of two adjacent grid-point 7 In isopycnic coordinates this approximation is also needed to circumvent a values, fi,j and fi+1,j. Their average and difference are analogous to f and r\f. theoretical difficulty with the assumption that potential density is a Lagrangian 6 More precisely, the density field is ‘‘frozen in r-space’’ during barotropic time- conserved property, which implies that it can be defined globally relative to a given stepping. This is because the entire vertical coordinate system ‘‘breathes’’ when f reference pressure. In fact, the seawater EOS does not have this property (Jackett and moves up and down, so each vertical grid box also changes proportional to its height, McDougall, 1997), allowing only a local definition of potential density with respect to while the grid-box averaged values of density remain unchanged. a local reference pressure. A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 47

distinguishing q⁄ and q with q < q in this case–but the anal- which makes the numerical stability of the code sensitive to whether yses below indicate an underestimation of the effect, and (3.18), (3.19) is used or not. therefore a contribution to mode-splitting error with an asso- The physical explanation of item (iii) is non-Boussinesq in ciated small parameter of gh/c2. Since both corrections to the nature: despite the coincidence of (2.4) with the PGF due to the barotropic phase speed ~c, (3.20) and (3.21), are small, they gradient of f in a barotropic incompressible flow, the value of ~c is are approximately additive (Appendix C). smaller in a compressible fluid (cf., (B.6) in Appendix B), where a (iv) Sea-level contribution to EOS pressure: In principle, PGF is sen- convergence of horizontal velocity causes a change of both f and sitive to how EOS pressure depends on f (cf., (2.11)), hence density with relative proportions of 1 gh/c2 and gh/c2, F, depends on f through compressibility in EOS in addition respectively.

to the explicit dependence from r\f. In the case of constant Eq. (3.18), (3.19) are derived using the Boussinesq approxima- topography the impact on barotropic phase speed ~c due to tion, but nevertheless they also predict a smaller phase speed than 2 this effect is small relative to that of (iii)–Oðgf=c Þ vs. with gDr\f. When the density increases with depth, q < q,so 2 Oðgh=c Þ –in fact, it formally vanishes when linearizing with the PGF caused by a given r\f is slightly smaller than in the case respect to small f/h 1 (Appendices A and B). However, of vertically-uniform density with the same water-column mass

since f used in EOS pressure is always taken from the previ- (n.b., this implies that the choice of q0 ¼ q). Substitution of (2.8) ous baroclinic time step and is kept constant during the into (3.19) yields barotropic time stepping, this leads to the appearance of 2 c 2 1 gD hyperbolic r.h.s. terms that receive effectively a forward- q ¼ q ðegD=c 1Þq 1 þ þ in-time treatment. This potentially makes it a source of 1 gD 1 2 c2 3:22 2 2 ð Þ mode-splitting error and even instability. It should also be c c 2 1 gD q ¼ q ðegD=c 1Þ1 q 1 þ þ : noted that the effect can be amplified in the presence of 1 gD gD 1 3 c2 steep topography where the last term in (3.18), pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffi ~ ðq qÞfr?h, dominates over hr\(q⁄f), even though the With a flat bottom this implies c ¼ gh q=q0 instead of just gh. influence of f into q⁄ and q via EOS partially cancels due to While this qualitatively captures the effect of reducing ~c relative to subtracting one from the other. that of an incompressible fluid, even if we make the best possible

choice for reference density (q0 ¼ q), the correction is underesti- The mode-splitting procedure of SM2005 is designed to address mated by a factor of 1.5 relative to its true, non-Boussinesq magni- items (i) and (ii) within the Boussinesq approximation, while (iii) tude in (B.9) in Appendix B. This discrepancy is not surprising since and (vi) are given much less consideration. the non-Boussinesq explanation for the reduced phase speed is dif-

Notice that replacing gDr\f with (3.18), (3.19) motivated by ferent than in (3.18). item (i) is an artifact of the Boussinesq approximation.pffiffiffiffiffiffi From (2.4) Eq. (3.21) provides an estimate forpffiffiffiffiffiffi the barotropic speed reduc- the non-Boussinesq local barotropic phase speed gh does not de- tion due to effect (iii)of0.6% of gh assuming h = 5500m and pend on local vertically-averaged density q. (The inertial terms in c = 1500 m/s. This is one-and-half orders of magnitude larger than the non-Boussinesq momentum equation use local density rather the effect of baroclinicity (ii), and therefore it creates a stronger than q0, resulting in cancellation of density when computing accel- requirement for replacing gr\f with (3.18), (3.19) even thought eration and phase speed; Appendix B.) Paradoxically, using correcting for item (iii) was not the initial motivation. EOS stiffen-

gDr\f, rather than (3.18), (3.19) may look more suitable in this ing dramatically reduces the difference between q and q⁄. This case because it yields the correct ~c. Conversely, the use of (3.18), eliminates the non-physical mechanism of reduced barotropic (3.19) can be viewed as an introduction of an a priori physical dis- phase speed due to compressibility via (3.22). It also brings the tortion into the barotropic mode to match an existing distortion in mode-splitting procedure into the realm of assumptions for its ori- the 3D F to minimize mode-splitting error, which is the higher pri- ginal derivation. ority. EOS stiffening provides some relief in this conflict by merely The effect of (iv) is expected to be much smaller than (iii); how- transforming ðq q0Þ=q0 !ðq q0Þ=q0, which is expected to be ever, Robertson et al. (2001) observed a numerical instability in somewhat smaller; however, practical experience with ROMS POM while simulating tides under near-resonant conditions. The SM2005 indicates that the largest deviations of local vertically- source of the instability was traced back to the influence of f on averaged density are due to local H,S anomalies in shallow mar- EOS pressure through the use of old-time-step f due to the specifics ginal seas, often semi-enclosed by topography. Under such condi- of the mode-splitting algorithm. Although they did not classify it as a tions the bulk compressibility effect is not very strong, so mode-splitting instability, the mechanism of its appearance is stiffening does not make a large difference. Closely related to item essentially the same as in (iv). They proposed to eliminate the insta- (i) is the sensitivity of the numerical stability of the code to the bility by dropping pressure effects in EOS altogether: they split EOS choice of q0, and (3.18), (3.19) eliminates this problem. additively as q = qN(H,S)+qp(P) (starting with their Eq. (16)), and The reduction of ~c due to stratification, item (ii), occurs in both showed the dynamic passiveness of qp, which they subsequently ex- non-Boussinesq and Boussinesq cases, and (3.18), (3.19) provide an cluded. This leads to complete loss of the thermobaric effect, and accurate accounting of it (Appendix D). To estimate its importance, that may be not acceptable in many large-scale applications. EOS note that the ratio of phase speeds also sets the mode-splitting ra- stiffening of Dukowicz (2001) helps to reduce (but not to eliminate tio (i.e., the number of barotropic time steps per baroclinic step, entirely) the splitting error while keeping thermobaricity intact. typically in the range 30–70 and closer to the upper limit for an open-ocean configuration).8 This implies an estimated erroneous 3.3. Vertical mixing parameterization reduction of ~c by 103 of its value from (3.20). Although this might seem to too small to be a concern, recall that the phase error due to The vertical mixing parameterizations are based on the stratifi- the slightly different ~c values from using gDr\f is accumulated cation stability, expressed as the Brundt–Väisälä Frequency over many barotropic time steps performed at each baroclinic step, N(x,z,t), and the translation of surface heat and freshwater fluxes into a buoyancy flux. Both steps use the a(H,S,P) and b(H,S,P) coef- ficients from EOS, 8 In practice the splitting ratio is adjusted by the ratio of stability limits of the time- stepping algorithms for the 2D and 3D parts. For ROMS the splitting ratio is typically N2 ¼ g½a @ H b @S : ð3:23Þ 1.4 times larger than the ratio of phase speeds. z z 48 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

Thus, the requirement for EOS is to accurately reproduce a and b, updated version of which is available today as Locarnini et al. but now with a shifted emphasis on accurate computation of their (2006), Antonov et al. (2006)]. Although this approach yields the ratio, a/b. The primary sensitivity here comes from detecting when minimum possible range of variation for q, and thus has the max- stratification and/or buoyancy forcing change sign, because this cor- imum effect in reducing the Boussinesq–approximation errors, it responds to a drastic transition from one stable to convective mix- interferes with the ability to monitor stratification smoothness ing regime. The Boussinesq—non-Boussinesq and EOS stiffening by (3.6), (3.7) because the spatial differences of q constructed this issues are not a concern here because both a and b are normalized way unavoidably contain a contribution associated with the se- by the same density–whether in situ or replaced by q0 or q , lected mean density profile as long as the direction of differencing 0 is not strictly horizontal (unlike the horizontal differencing in z- 1 @q 1 @q 1 @q 1 @q a ¼ ! ; b ¼ ! ; ð3:24Þ coordinate models, for which the method of Dukowicz (2001) q @H q @H q @S q @S S;P 0 S;P H;P 0 H;P was originally intended). As a result, a change in sign for the differ- hence their ratio is not affected. Because negative stratification is ences no longer corresponds to the change from positive to nega- intolerable in a hydrostatic model and parameterized vertical mixing tive physical stratification. This also alters the ratios of is the only mechanism that prevents it (by entrainment of water from consecutive differences in (3.7) ultimately negating its monoton- adjacent positively stratified layers above or below), it is desirable ization properties. Therefore we alternatively choose constant ref- ref ref that the procedure for detecting negative stratification in the mixing erence values, H and S , that are representative of the abyssal scheme be consistent with the monotonized adiabatic differencing in part of the ocean, and then construct a multiplier rð^zÞ as the PGF algorithm (3.6), (3.7). In particular, the stratification may 1 ref ref ref ref 2 rð^zÞ¼ ; where K ð^zÞ¼K00 þ K0 þ K1 ^z þ K2 ^z ; change abruptly near the interior edge of the top and bottom bound- 1 0:1^z=Kref ð^zÞ ary layers. Accurate determination of the layer thickness requires ð4:2Þ density interpolation where it is often non-smooth on the vertical ref ref ref ref ref ref ref ref ref grid-scale; this leads to similar requirements on EOS as for PGF. with K0 ¼ K0ðH ; S Þ, K1 ¼ K1ðH ; S Þ, and K2 ¼ K2ðH ; S Þ. In the results presented here we choose Href = 3.50C and 0 ref ref 3.4. Neutral surfaces S = 34.5 /00, which imply K0 ¼ 2924:921, K1 ¼ 0:34846939, ref 5 ref ref K2 ¼ 0:145612 10 , and q1(H ,S ) = 1027.43879. The stiff- The definition of potential density depends a reference pres- ened EOS (2.15) with this Boussinesq-approximation rð^zÞ becomes sure, and for a realistic EOS it cannot be defined globally in the 1 0:1^z=Kref ð^zÞ q0ðH; S; ^zÞ¼½q þ q0 ðH; SÞ q : ð4:3Þ sense of a scalar function of local H,S,P with spatial derivatives 0 1 1 0:1^z=KðH; S; ^zÞ 0 equivalent to adiabatic derivatives of in situ density (Jackett and 0 McDougall, 1995). Instead, one should either construct a neutral q is the perturbation of q relative to a constant reference value q0, ref ref density (Jackett and McDougall, 1997), which is inherently non- which is naturally chosen as q0 ¼ q1ðH ; S Þ. After cancellation of local, or, alternatively, one could use a local procedure relying on the large terms, the stiffened EOS is rewritten as a , and b-weighting of temperature and salinity gradients (see q þ q0 ðH; SÞ q0ðH; S; ^zÞ¼q0 ðH; SÞþ0:1^z 0 1 Eqs. (31), (32) in Section 5 in Griffies et al. (1998)). EOS in the form 1 ref ref ref 2 K00 þ K0 þ K1 ^z þ K2 ^z (3.4) and the associated adiabatic differencing (3.6) allow direct Kref K ðH; SÞþ Kref K ðH; SÞ ^z þ Kref K ðH; SÞ ^z2 computation of the local slopes of neutral surfaces. 0 0 1 1 2 2 2 K00 þ K0ðH; SÞþðÞK1ðH; SÞ0:1 ^z þ K2ðH; SÞ^z q ðH; SÞþq^0ðH; S; ^zÞ^z; 4. A practical ‘‘stiffened’’ EOS 1 ð4:4Þ The seawater EOS of Jackett and McDougall (1995) has the form, so far without any approximation. This is already close to the de- q ðH; SÞ sired functional form (3.4); however q^0ðH; S; ^zÞ still explicitly de- ; S; ^z 1 ; qðH Þ¼ 2 pends on ^z, although weakly as we show below. Eq. (4.4) implies 1 0:1 ^z=½K00 þ K0ðH; SÞþK1ðH; SÞ^z þ K2ðH; SÞ^z that q0ðHref ; Sref ; ^zÞ0 and q^0ðHref ; Sref ; ^zÞ0 for all ^z. This ensures ð4:1Þ that the range of variation for q0 is expected to be small in general, where H is potential temperature; S salinity; q1(H,S) is the density and even diminish with depth since variations of H and S also at a surface pressure of 1atm, fit by a 15-term polynomial contain- diminish. ing various products of powers of Hn, n =1,...,5, and Sm, m =1,3/ A Taylor series expansion of (4.4) in powers of ^z yields

2,2 (not in all permutations). The divisor K = K00 + K0(H,S)+ 0 0 0 q ðH; S; ^zÞ¼q1ðH; SÞþq1ðH; SÞ^z; ð4:5Þ has K00 = const, and the remaining three coefficients K0, K1 K2 de- pend on H and S with similar polynomial fits with powers of where H,...,H4, and S, S3/2 that add up to a 26-term polynomial for K. ÂÃ q0 ðH; SÞ¼0:1 q þ q0 ðH; SÞ The UNESCO EOS has the same functional form, but it is expressed 1 0 1 in terms of in situ temperature; hence q is identically the same, but Kref K ðH; SÞ 1 0 0 : : ref ð4 6Þ the coefficients for K0,K1,K2 are different. In addition, EOS pressure in ðK00 þ K0ðH; SÞÞ ðK00 þ K0 Þ (4.1) is remapped into depth ^z.9 The complexity of the functional form of UNESCO EOS motivates oceanic modelers to derive simplified This has exactly the functional form of (3.4). It is an approximation versions for more efficient calculation (Mellor, 1991; Wright, 1997; to (4.4) where all K1 and K2 terms (14 out of 26 coefficients of K) are Brydon et al., 1999; McDougall et al., 2003; Jackett et al., 2006). discarded. In practice we use a slightly modified form, Dukowicz (2001) chooses the multiplier r(P)tofitanin situ den- 0 0 0 q ðH; S; ^zÞ¼q1ðH; SÞþq1ðH; SÞ^zð1 c^zÞ; ð4:7Þ sity profile computed from the globally horizontally averaged tem- 5 1 ref ref perature and salinity profiles based on Levitus WOA94 data [an with c = 1.72 10 m for the H and S values listed above. This captures some of the nonlinear dependency of the thermobaric effect without significant increase in complexity, and it also reduces 9 Throughout this section we adopt the convention that ^z increases downward, the same way as hydrostatic pressure. We use notation ^z to distinguish it from z errors relative to (4.5). Consistently with (4.7), the algorithm for (increasing upward) as it is used elsewhere in this article. computing elementary adiabatic differences (3.6) becomes A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 49 0 0ðadÞ ^ziþ1;j;k þ ^zi;j;k Isolines of q from (4.7) are plotted in the left column of Fig. 1 for Dq ¼ q0 q0 þ q0 q0 iþ1;j;k 1iþ1;j;k 1i;j;k 1iþ1;j;k 1i;j;k 2 2 five different depths: 0, 200, 1000, 2500, and 5000 m. The shading ^zi 1;j;k þ ^zi;j;k in Figs. 1,2 indicates the global distribution of hydrographic data 1 c þ : ð4:8Þ 2 values (Levitus WOA data, Antonov et al., 2006; Locarnini et al., 2006). At each depth the data samples are combined into

Fig. 1. ‘‘Stiffened’’ density perturbation q0 defined by (4.7) (left); the corresponding thermal expansion, a (middle), and saline contraction, b (right), coefficients as functions of potential temperature H and salinity S at five different depths ^z ¼ 0; 200; 1000; 2500 and 5000 m. The units are kg/m3, (kg/m3)/°C, and (kg/m3)/(‰) respectively (note that here a = @q/@HjS,P=const and b =+@q/@SjH,P=const without the usual division by q). Shading indicates the distribution of observed (H,S) values (see text). (The overall format is similar to Fig. 19 in SM2003.) 50 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

Fig. 2. Errors in a (left), b (middle), and their ratio, a/b (right) due to the approximate EOS (4.7) compared to the complete EOS (4.4) at four different depths: ^z ¼ 200; 1000; 2500, and 5000 m. The shading is the same as in Fig. 1, and the dashed box surrounds the domain of interest. (The format is similar to Fig. 20 in SM2003.)

0 0 3 DH DS = 0.25 C 0.25 /00 bins to compute the probability distri- contrast with qin situ 1050 kg/m (see Fig. 19, left column, in bution. This is shown by the three hues of shading: the lightest indi- SM2003; note that field plotted there is qin situ 1000). cates that this pair of H,S values is observed at least once in the The coefficients a and b are plotted in the center and right col- dataset, the medium shading contains 99% of the observed data at umns of Fig. 1. a shows a significant increase with depth, while b that depth, and the darkest contains 90%. There is a significant decreases slightly. One notices some differences in values and in reduction of variation of the observed H,S with depth as manifested patterns compared to Fig. 19 in SM2003, especially for b. For 0 0 by the shrinking of the shaded area, which was utilized by McDou- example, at ^z ¼ 5000 m, H 3.5 C and S =35 /00 b = 0.760 in gall et al. (2003) and SM2003 to simplify treatment compressibility that Fig. 19, while here b = 0.745 in Fig. 1. The difference of 2% effects in EOS (note that only a very little seasonal variation of H, S is explained by rð^zÞ, which is responsible for the density differ- remains at the depths of ^z ¼ 200 m, which is illustrated by a rather ence between qin situ 1050 vs. q0 1027:4 here, so that narrow strip shaded area, with the lightest shade becomes indistin- b½Fig: 19=qinsitu b½Fig:1=q0. Similar adjustment occurs for a, guishable). Furthermore, as highlighted by McDougall and Jackett and, as the result, adiabatic differences of stiffened density normal- (2007), there is a strong tendency for the probability distribution ized by q0 (using Boussinesq-like rules) are now close to that to align itself with the isolines density at each depth – which they computed from a full EOS (4.1), but normalized by qin situ (non- call ‘‘thinness in S H P space’’. Boussinesq rules). Isolines of q0 in the (H,S)-plane tend to rotate counterclock- As shown in Section 2, the most important requirement for EOS wise with increasing depth (thermobaric effect) and exhibit a gen- is to accurately reproduce a and b as functions of depth within the tle curvature (cabelling). However, as assured by the construction subspace of naturally occurring H and S values. Furthermore, of EOS, the q0 does not have tendency to increase with depth. because hydrostatic models are especially sensitive to the occur- The density range for observed (H,S) is much reduced; e.g.,at rence of negative stratification, the accuracy of representation of 0 0 0 ^z ¼ 5000 m, H 3.5 , S = 34.5 /00, and q stays close to zero, in the ratio of a/b is even more valuable than the accuracy of a and A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 51 b taken separately (e.g., this occurs in southern part of Atlantic there are fewer feedback loops and interdependencies among the Ocean characterized by the fresh, but cold near-surface layer on the model equations in the Boussinesq case, and accordingly, fewer top of warmer, but more saline deeper water, resulting in a ther- decisions about numerical splittings are to be made. In this and modynamically delicate situation with very week overall stratifica- previous studies we have described generally successful treatment tion, and the possibility of cabbeling and thermobaric instabilities, of computationally delicate couplings between mode-splitting, Paluszkiewicz et al., 1994; McPhee, 2000). This is also true for time-stepping, and realistic EOS algorithms in a Boussinesq code modeling deep currents in the presence of H and S anomalies, with accurate, numerically stable and efficient mode-splitting pro- which tends to cancel effects of each other, e.g., Mediterranean out- cedure without the necessity of excessive time filtering, with tracer flow. Therefore, we evaluate the differences between a, b, and a/b conservation and constancy preservation and with acceptable computed using (4.6), (4.7) against its prototype (4.4), which is the EOS-related errors in the PGF. In this section we examine how unapproximated stiffened EOS (Fig. 2). On each panel we indicate these coupling issues are manifested in a non-Boussinesq algo- the domain of interest with a dashed-line box surrounding ob- rithm like the ones presently used (e.g., in MOM4; Griffies, 2004) served (H,S) values. The error in computing a within the domain and suggest some directions for further non-Boussinesq model of interest can be estimated as ± 0.0001 at ^z ¼ 1000 m; ± 0.0005 improvements. at ^z ¼ 2500 m; and ± 0.002 at ^z ¼ 5000 m. For b similar errors Realistic oceanic simulation brings two particular issues that are ± 0.0004 at ^z ¼ 1000 m; ±0.001 at ^z ¼ 2500 m; and ±0.005 at are outside the standard consideration of the Boussinesq approxi- ^z ¼ 5000 m. These error estimates are conservative because the ob- mation: the free surface f and the necessity to reintroduce served (H,S) areas (shaded) occupy only a fraction of the domains compressibility and pressure into EOS in order to obtain a correct of interest we have defined. Normalized by the relevant values of a description of the thermobaric effect and other EOS-related nonlin- and b, the relative errors for both quantities stay within ±0.5%. This earities. These issues raise subtle questions, most importantly is substantially more accurate than in Fig. 20 of SM2003, and what whether to use the full dynamic pressure P in EOS or approximate is essentially new here is that zero-error line is always placed close it with, e.g., the reference value P0 = q0gz; the classical Boussinesq to the middle of the shaded area. The computation of a/b a better does not offer any guideline. Dewar et al. (1998) found that there is alignment of the zero-error line with the shaded area. This is a a quantitatively significant sensitivity to this choice and advocated somewhat unexpected benefit of EOS stiffening: the multipliers the use of full dynamic pressure in EOS computed self-consistently rð^zÞ essentially plays the role of a preconditioner to EOS of Jackett between q and P related by hydrostatic balance. Dukowicz (2001) and McDougall (1995) by removing most of the nonlinear depen- pointed out the error discovered by Dewar et al. (1998) is self- dency from depth (pressure). The remaining q can be more accu- canceling in a non-Boussinesq model, because the pressure gradi- rately fit by the simple function in (4.7). (Note that the for small ent and density are essentially multiplied by a common multiplier, depth, ^z ¼ 200m, the error pattern of a/b-ratio has a saddle point and the modification proposed by Dewar et al. (1998) actually in the vicinity of observed data, which makes a second-order brings error into the Boussinesq code they used10 [see also Section 2 smallness of error as H, S depart from it.) following (2.11)]. Dukowicz (2001) proposed to correct the PGF error while keeping both the Boussinesq approximation and the the use of 5. Does Boussinesq approximation still offer any simplification? reference pressure in EOS by stiffening the latter.11 However, his ap- proach received limited support. At first, because of the alternative During the review process we were challenged why a Bous- proposal to re-interpret Boussinesq velocity as normalized mass flux 12 sinesq code should still be used, given the recent theoretical enthu- per unit area qu/q0 as described by McDougall et al. (2002). They siasm and advocacy for the non-Boussinesq alternative (McDougall advocate full P in EOS and demonstrated that no EOS stiffening is re- et al., 2002; Greatbatch and McDougall, 2003; Marshall et al., 2004; quired to obtain correct geostrophically-balanced flow. A side effect Griffies, 2004). While we acknowledge that some aspects of oceanic of their approach is that it disturbs the relationship between Coriolis modeling become more natural in the non-Boussinesq framework, and advection terms, which interferes with the derivation potential notably the response to thermodynamic forcing (Mellor and Ezer, vorticity conservation even in the simplest case of barotropic, but 1995; Huang and Jin, 2002), the value of Boussinesq approximation slightly compressible fluid with free surface (Appendix A). Secondly, is due to accuracy and dynamical parsimony in retaining the impor- by noting that in a hydrostatic model it is actually not very difficult tant behaviors in oceanic circulation while excluding extraneous ef- to compute density via EOS using in situ pressure self-consistent fects (e.g., acoustic waves) that can be computationally difficult with the density being computed,13 therefore negating one of the (Spiegel and Veronis, 1960; Mihaljan, 1962; Zeytounian, 2003). starting arguments of Dukowicz (2001). The third reason for little The non-Boussinesq generalization does not bring in any important interest in Dukowicz (2001) comes from the realization that a additional circulation behaviors (Greatbatch, 1994; Dukowicz, free-surface, hydrostatic oceanic code can be relatively easy 1997) and a posteriori comparison between Boussinesq and non- Boussinesq results has shown that other aspects of the modeling codes (specifics of initialization, version of EOS, etc.) produce com- 10 Although Dewar et al. (1998) did not explicitly identify in their formulas that they parable or even greater sensitivities (Losch et al., 2004). used a Boussinesq code, this choice is evident from their Footnote 2, which discusses If one seeks a non-hydrostatic generalization of an oceanic sim- non-existence of sound waves and the absence of a time derivative in the continuity equation, as well as from the general context of the MOM2 code available at that time, ulation code for smaller, faster dynamical phenomena, the Bous- which they used. sinesq approximation offers a major simplification by excluding 11 Note that while Dukowicz (2001) suggests using both reference pressure dynamic pressure from EOS, which allows a decomposition of P0 = q0gzin EOS and stiffening of EOS at the same time, either measure taken pressure into hydrostatic free-surface, hydrostatic baroclinic, and alone is sufficient to solve the Case A dilemma of Dewar et al. (1998) in a Boussinesq model, cf., (2.11). However both measures are needed in the more general baroclinic non-hydrostatic components that then can be treated in quasi- case. independent ways (e.g., Kanarska et al., 2007). For hydrostatic 12 It is interesting to note that the idea of increasing/decreasing depending codes, the simplifications due to Boussinesq approximation are on local density to eliminate approximation errors can be traced back to Oberbeck somewhat less pronounced (besides the logistical efficiency of (1888, Sec. II, paragraph (5)) who was interested in explaining steady motions in the not having to compute q-weighted control volumes) which leads atmosphere. 13 This requires knowledge of the state of free-surface (or bottom pressure in a non- to the conclusion that Boussinesq approximation is not useful at Boussinesq code) which becomes available only after the advance of barotropic mode all, because one can solve an non-approximated system instead is complete. This obstacle is typically addressed by one-time-step lag of the pressure (e.g., de Szoeke and Samelson, 2002; Marshall et al., 2004). Still, field in EOS, e.g., Griffies and Adcroft (2008, see Sec. 11.4 there). 52 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 converted from Boussinesq to non-Boussinesq by replacing the dis- are associated with the barotropic mode (Section 3.2). In a non- cretized vertical volume factor q0Dz to qDz (Greatbatch et al., hydrostatic code these guidelines bring a substantial simplifica- 2001), or by noting that non-Boussinesq equations can be trans- tion by allowing decoupling of the non-hydrostatic pressure formed into pressure coordinates where they resemble Boussinesq from buoyant, and treating the former one as Lagrange multi- written in z-coordinates (de Szoeke and Samelson, 2002; Huang and plier to enforce nondivergence; Jin, 2002; Losch et al., 2004; Marshall et al., 2004). Non-Boussinesq as pointed out by Dukowicz (2001), because of nonlinearity of model requires the use of full dynamic P in the fully compressible, EOS pressure-dependency (only bulk r(P) nonlinearity is of con- realistic EOS: otherwise it would reintroduce the error pointed out cern for this purpose), remapping P = P(P) via (2.15) results in a by Dewar et al. (1998). This is natural and requires no extra effort in more accurate referencing of bulk pressure in comparison with pressure coordinates (in fact, it is impossible to separate ‘‘coordinate’’ just approximating it with q0gz. In practice this translates into pressure, which is also dynamic pressure from EOS pressure), but a re-tuning of pressure-related coefficients in z-dependent EOS if special effort should be taken if using approach of Greatbatch et al. they are originally tuned for using in situ pressure, but no extra (2001). The use of dynamic P does not reintroduce acoustic waves computational cost; because they are excluded by the hydrostatic approximation alone. if, due to specific needs of a particular ocean model, there is a What remains somewhat unsettled in the literature is that the preferred functional form of EOS different from the available choice of using reference q0gz vs. full pressure P in EOS is not standard EOS. Separating the bulk pressure effect from EOS arbitrary, but should be tied to whether the model is Boussinesq ‘‘preconditions’’ it to the extent that it can be fitted more easily or not. Thus, following the advice of Dewar et al. (1998), Losch or more accurately with the desired form. Similarly, after iden- et al. (2004, Sec. 2a. Initialization) advocate the use of P in EOS tifying that bulk compressibility is dynamically passive, exclud- for both Boussinesq and non-Boussinesq versions of MITgcm they ing it before computing pressure-gradient terms is preferable have compared and criticize Huang and Jin (2002) for doing it over relying on numerical cancellation within the PGF scheme otherwise (P for non-Boussinesq and z for Boussinesq) which is in a sigma-model; and actually a better choice. Similarly, P-dependent EOS appears in all existing mode-splitting algorithms in split-explicit models Boussinesq equations of Marshall et al. (2004), even thought it can be subdivided into two categories: clearly breaks the completeness of non-Boussinesq-P—Bous- sinesq-z-coordinate isomorphism, and changing to z-dependent (i) a priori ‘‘physicist’s’’ splitting by extracting a shallow-water EOS repairs this without causing any downstream contradiction like ‘‘fast’’ term (for Boussinesq models this is typically, (i.e., EOS depends on coordinate in both cases). The same applies gDr\f or (gD/q0)r\(qsurff), where qsurf is surface 0 to de Szoeke and Samelson (2002) who in their remark in Section 3, density at surface; and for non-Boussinesq ðg=q0Þpbr?pb 0 p. 2197, left column, indicated Dewar et al. (1998) as the reason for where pb and pb are bottom pressure and its perturbation rel- this choice. Furthermore, the classical Boussinesq (with pressure- atively to static reference) from the vertically-integrated PGF, independent EOS) equations have proper potential-to-kinetic en- while the remainder is treated as slow-time ‘‘forcing’’ (e.g., ergy conversion resulting in total energy conservation. This prop- Berntsen et al., 1981; Blumberg and Mellor, 1987; Bleck and erty is lost if a nonlinear pressure-dependent EOS is introduced Smith, 1990; Killworth et al., 1991, see also Sec. 7.7 in Griffies, into Boussinesq (or anelastic) equations, cf., Ingersoll (2005). Re- 2009, for an overview). In this approach no effort is made to cently Young (2010) showed that to maintain the energetic consis- take into account the influence of stratification within the 14 tency in the case of non-linear EOS the dynamic part of pressure in terms recomputed during fast-time stepping ;and EOS must be excluded, providing yet another argument for using (ii) ‘‘mathematical’’ splittings motivated by the operator-

q0gz in EOS in Boussinesq models. splitting theory, where the fast-time pressure-gradient Once this correspondence is respected, the only surviving argu- terms are designed to capture as close as possible (subject ments for EOS stiffening in Boussinesq model are: to practicality of implementation and cost) the time tenden- cies of the non-split 3D system. In practice this translates in conceptually it brings the model closer to the original Bous- introduction of a special density-weighting into ‘‘fast’’ terms. sinesq physical framework where the only density variations The residual ‘‘forcing’’ terms have very minor dependency on which matter are the ones which contribute to buoyancy varia- the state of free surface field. Higdon and de Szoeke (1997), tions (Oberbeck, 1879, 1888; Boussinesq, 1903, see p. VII, pp. Hallberg (1997), and SM2005 belong to this category. 154–161, and pp. 172–176 there; Mihaljan, 1962). Bulk com- pressibility does not translate into buoyancy and therefore must Both techniques rely on essentially the same small parameters, be excluded. Thermobaric EOS pressure dependency does, notably separation of time scales between the baroclinic and baro- hence is to be kept. EOS pressure is decoupled from the tropic processes which is ultimately linked to the smallness of den- dynamic, and becomes basically a function of location (in the sity perturbations, however the second captures the leading-order classical Boussinesq EOS pressure is constant or not needed at corrections due to non-uniform density and treats them as ‘‘fast’’, all). While these guidelines help to simplify theoretical inter- while the first one keeps them within ‘‘forcing’’. Naturally, algo- pretations, they actually have very little practical consequences rithms from the second category produce more accurate splitting in the hydrostatic models, and mostly related to the treatment (second-vs. first-order errors with respect to the associated small of free surface. This is not surprising, given that in a Boussinesq parameters) and require less fast-time filtering for the numerical model the absolute density (as opposite to density perturba- stability. However, they are also tend to be more code-specific, tion) appears only in the context of free-surface part of pressure and, more importantly, none of the available to date is designed 15 gradient term. Our analysis reveals that while bulk compress- to be compatible with fully-compressible EOS. For Boussinesq ibility is mainly dynamically passive (Sections 3.1, 3.3, and 3.4), its re-introduction into a Boussinesq code brings changes 14 This influence was noticed and suspected to be the cause of numerical instability which cannot be interpreted as correct physical effects (e.g., by Killworth et al. (1991, see Eq. (31) and the discussion in Section 3 c. Coupling proper decrease of barotropic wave phase speed if compressibil- between modes there). 15 Here we emphasize that although Higdon and de Szoeke (1997) is formally non- ity is taken into account; also the appearance artificial multipli- Boussinesq, one of their starting assumptions is that barotropic changes in free ers q/q0), are dependent on subtle code decisions (e.g., surface (or bottom pressure) cause proportional changes in thicknesses of each layer. qEOS(H,S,z) vs. qEOS(H,S,f z)) and, not surprisingly again, This assumption breaks down if the fluid is compressible. A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 53 model like ROMS it is acceptable, if EOS is stiffened. Conversely, re- leaves the slow-time continuity Eq. (5.1) no other role than com- introduction of bulk compressibility depletes its order of accuracy puting vertical velocity wk+1/2, which in this context has the mean- from the second to the first, thus negating the advantage in splitting ing of finite-volume fluxes across the interfaces between accuracy relatively to the first group. vertically-adjacent grid boxes moving with f. The compatibility For non-Boussinesq models with fully compressible EOS a split- conditions (5.4) ensure that the bottom and top kinematic bound- ting algorithm comparable in accuracy with that of Higdon and de ary conditions for vertical velocity computed are satisfied. while Szoeke (1997) or SM2005 is yet to be designed: using dynamic P is there is some freedom in choosing how to compute the flux-vari- EOS also means that f influences EOS via P, which means that ables with time index n + 1/2 (n.b., multiple variants of ROMS code dependency must be somehow reflected within the ‘‘fast’’ terms. exist), two important properties of (5.1)–(5.5) must always be re-

Parameter estimate in Section 3.2 suggests that the influence of spected: formally substituting qk 1 into (5.5) turns it into (5.1), compressibility on barotropic phase speed is at least as large as and vertical summation of (5.1) results in (5.3). These guarantee the influence of stratification, thus neglecting the former would that the tracer Eq. (5.5) have simultaneous conservation and con- negate any accuracy advantage of Higdon and de Szoeke (1997) stancy-preservation properties. Eq. (5.1)–(5.5) are solved explicitly or SM2005 in comparison with simple splitting, if fully compress- and sequentially (non-iteratively) as described in SM2005: com- ible EOS is used. pute r.h.s. terms for the 3D momentum equation; compute forcing (coupling) terms for the barotropic mode; update barotropic vari- 5.1. Comparison of discrete time stepping in Boussinesq and non- ables and their fast-time-averaged values hf; U; Vi and hh U; Vii ; up- Boussinesq models date 3D momentum equations and enforce the compatibility conditions (5.4); advance tracer concentrations with (5.5); then The ROMS time-stepping algorithm guarantees that the follow- roll the procedure over to the next time step. Notice that EOS does ing semi-discretized equations hold exactly: not participate anywhere in (5.1)–(5.5) it is needed only at the stage of computing the PGF for the momentum equation. We refer ÂÃ nþ1 n nþ1=2 this type of algorithm as a logically-Boussinesq, hydrostatic, free- Dzk ¼ Dzk Dt r?ðDzkukÞþwkþ1=2 wk1=2 ð5:1Þ surface code. Dznþ1 ¼ Dz Dzð0Þ; hfinþ1 ¼ Dzð0Þ 1 þhfinþ1=h ð5:2Þ Next, consider the non-Boussinesq version of (5.1)–(5.5): k k k k h nþ1 nþ1 n n nþ1 n nþ1=2 qk Dzk ¼ qk Dzk Dt r?ðÞþqkDzkuk qkþ1=2wkþ1=2 hfi ¼hfi Dt r?hh Uii ð5:3Þ i XN nþ1=2 nþ1=2 nþ1=2 qk1=2wk1=2 ð5:6Þ Dzk ¼ h þ f and hh Uii hhU; Vii k¼1 () ð0Þ n 1=2 Dzk ¼ Dzk Dzk ; f ðunchangedÞð5:7Þ XN XN þ ¼ Dzkuk; Dzkvk ð5:4Þ n 1 n nþ1=2 qnþ1 h þ f þ ¼ qnðÞh þ f Dt r hh qUii ð5:8Þ k¼1 k¼1 ? h nþ1 nþ1 n n where Dzk qk ¼ Dzk qk Dt r?ðqkDzkukÞþqkþ1=2wkþ1=2 i XN XN nþ1=2 1 q ¼ Dzkq and Dzk ¼ h þ f ð5:9Þ qk1=2wk1=2 ; ð5:5Þ h þ f k k¼1 k¼()1 n 1=2 XN XN þ where for symbolic simplicity we omit horizontal indices, tracer dif- nþ1=2 nþ1=2 hh qUii hhqU; qVii ¼ qkDzkuk; qkDzkvk ð5:10Þ fusion terms, and heat and fresh-water fluxes at the ocean surface. k¼1 k¼1 Dt is the ‘‘slow’’-time step (for the 3D ‘‘baroclinic’’ mode); time indi- ces n and n + 1 correspond to slow-time as well; r\ is the two- nþ1 nþ1 nþ1 n n n qk Dzk qk ¼ qk Dzk qk Dt r?ðqk qkDzkukÞ dimensional, horizontal-coordinate divergence operator; Dzk are the vertical grid-box heights which depend on f and are therefore nþ1=2 time-dependent and also depend on the horizontal coordinates þqkþ1=2 qkþ1=2wkþ1=2 qk1=2 qk1=2wk1=2 ð5:11Þ through f and topography; and q 2 {H,S,...} is material concentra- tion (tracer). Eq. (5.2) states that Dz are computed by perturbing k XN Dzð0Þ which correspond to f = 0. ROMS uses the specific way of per- 1 k q ¼ q ðH ; S ; P Þ where P ¼ g q 0 Dz 0 þ gq Dz : k EOS k k k k k k 2 k k turbing them given by the rightmost part of (5.2), but in principle it k0¼kþ1 may be by any other choice that satisfies the left condition (5.4) ð5:12Þ [e.g., the rescaled-height version of the MITgcm (Adcroft and Cam- pin, 2004); an implementation of the coastal coordinate of Stacey All vertical integrations are now done with density weighting. Nev- et al. (1995); and models that allow only the uppermost grid-box ertheless, similarly to (5.1)–(5.5), substitution of qk 1 into (5.11) to change with f while keeping all others fixed, as in MOM/POP turns it into (5.6), and the non-Boussinesq free-surface Eq. (5.8) is (Griffies, 2004) and TRIM (Casulli and Cheng, 1992; Rueda et al., derived by vertical summation of (5.1). Because of this, the system 2007)]. conserves mass and the integral content and constancy for each tra- In ROMS the barotropic mode is integrated forward explicitly in cer. In comparison with its Boussinesq counterpart, the new system ‘‘fast’’-time using much smaller time steps than the rest of the sys- exhibits a more sophisticated coupling among the equations. The tem. A special fast-time-averaging procedure is employed to en- major difficulty is associated with the free-surface Eq. (5.8): one sure that the averaged hfi and hh Uii are exactly matched to satisfy needs to know qnþ1 in advance in order to solve it. But knowing nþ1 nþ1 nþ1 nþ1 nþ1 the slow-time free-surface Eq. (5.3). This can be, in principle, q , hence qk , also requires Hk and Sk because qk is related replaced with an implicit free-surface algorithm using special to them through EOS (5.12). Ultimately this precludes a sequential precautions (Campin et al., 2004) to ensure that (5.3) is still re- algorithm comparable to that for (5.1)–(5.5). spected. In either case, once fn+1 is known, all grid-box heights There are two known approaches to address this dilemma. The nþ1 Dzk within each vertical column (k =1,...,N) are slaved to it. This first one is by Greatbatch et al. (2001) who proposed to break the 54 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

nþ1 n cyclic dependency by replacing qk and qk with their forward- where pb is identified as ‘‘bottom pressure’’–the total weight of extrapolated values, water column. Vertical velocity x~ kþ1=2 computed from (5.16) has the meaning of mass flux per-unit-area through, generally speaking, nþ1 n ðeÞ n n1 ðeÞ n1 n2 moving pressure surface. The kinematic boundary conditions at the q ¼ 2qk qk and; similarly q ¼ 2qk qk ; ð5:13Þ k k bottom and free surface (x~ ¼ 0 at both) are respected automatically because vertical summation of (5.16) yields (5.18). All other vari- everywhere throughout (5.6)–(5.12) where they appear in the con- ables, u , u, q ={H ,S ,...}, remain the same in both systems. Nei- trol volumes. Subsequently this approach was adopted in MOM4 k k k k ther density q , nor grid-box heights D z appear anywhere in (Griffies, 2004). A similar extrapolation was applied to convert a k k (5.16)–(5.21), while substitution of q = const into (5.21) converts it sigma-coordinate model (Mellor and Ezer, 1995), with credit given into (5.16) which means that simultaneous constancy and conser- to then unpublished work by Greatbatch and Lu). Despite the fact vation of tracers (now in mass-weighted sense) can be achieved that qn is available before the update of (5.6)–(5.12) begins, it can- k independently from EOS as long as the compatibility conditions not be used in Dznqn, because doing so implies that during the next nþ1 k k ðeÞ nþ1 (5.18)–(5.20) are respected. Another similarity between the non- time step qk will be replaced with qk when it becomes avail- nþ1 Boussinesq pressure-coordinate system and its Boussinesq counter- able;because qðeÞ –qnþ1, this results in loss of mass conservation. k k part is that EOS is involved only in computation of horizontal With this precaution taken, however, the discrete mass and tracer pressure-gradient terms (also stratification and isopycnic slopes conservation properties exist in form of X for the purpose of subgrid-scale mixing parameterization), but not n n1 n2 for density weighting of grid-box heights like in (5.6)–(5.12). How- DAi;jDzi;j;k 2qi;j;k qi;j;k ¼ const i;j;k ever, the role of EOS is reversed: now it is needed to compute grid- X n n n1 n2 box heights, geopotentials Uk+1/2, and, ultimately, free surface, DAi;jDzi;j;kqi;j;k 2qi;j;k qi;j;k ¼ const; ð5:14Þ i;j;k Dp Dz ¼ k a ðH ; S ; P Þ; k g EOS k k k where DAi;j is the horizontal area of grid element i,j. This is not Xk as accurate as mass, heat, and salt content conservation UNþ1=2 U ¼ g Dz 0 gh; and f ¼ : ð5:23Þ expressed in terms of simultaneous variables (i.e., computed as kþ1=2 k P 0 g n n n n n n k ¼1 DAi;jDzi;j;kqi;j;kqi;j;k with qi;j;k and qi;j;k ¼ðH; SÞi;j;k related by EOS). However (5.14) still guarantees that the associated errors are The pressure increments Dpk and EOS Pk above are known bounded with no tendency of accumulation with time. Additionally, as long as pb is known, extrapolation with some weights being negative, as in (5.13),is undesirable if monotonicity properties are required (e.g., near sharp ð0Þ ð0Þ ð0Þ Dpk ¼ pb Dzk =h where Dzk ¼ Dz ðx;yÞ fronts or extreme salinity anomalies associated with river out- ¼ zð0Þ ðx;yÞzð0Þ ðx;yÞ; ð5:24Þ flows); and, as we will show in the next section, extrapolation kþ1=2 k1=2 (5.13) is a source of mode-splitting error and may cause numerical after which instability.

The second, and actually more promising approach to address XN Pkþ1=2 þ Pk1=2 the solvability of (5.6)–(5.12) in the case of a hydrostatic model P ¼ and P ¼ Dp 0 : ð5:25Þ k 2 k1=2 k is to convert them into pressure coordinates, (de Szoeke and k0¼k Samelson, 2002; Marshall et al., 2004). The principal idea is to note Above zð0Þ zð0Þ x; y , k =0,1,...,N, such that zð0Þ h and that qk Dzk can be interpreted as vertical pressure increment over kþ1=2 ¼ kþ1=2ð Þ 1=2 ¼ zð0Þ 0isana priori defined generalized terrain-following coor- grid box Dzk, hence Nþ1=2 ¼ dinate mapping function (cf., Eq. (1.8) from SM2005. Note that in qnDzn ¼ð1=gÞDpn and qnþ1Dznþ1 ¼ð1=gÞDpnþ1; ð5:15Þ k k k k k k the case of uniform density q = q0 hence pb = q0g(h + f), the general- after which (5.6)–(5.11) can be rewritten as ized pressure-sigma coordinate reverts back to the original z-sigma, ÂÃEqs. (1.9)–(1.10) from SM2005). nþ1 n ~ ~ nþ1=2 Dpk ¼ Dpk Dt r?ðÞþDpkuk xkþ1=2 xk1=2 ð5:16Þ In summary, the principal distinction between the Boussinesq and non-Boussinesq cases is that the Boussinesq free-surface Eq. ð0Þ Dpk ¼ Dpk Dpk ; pb ð5:17Þ (5.3) entirely belongs to the barotropic mode (hence does not re- quire any mode-splitting decision about which terms are fast and nþ1 n nþ1=2 pb ¼ pb Dt r?hh pbuii ð5:18Þ which are slow), while all EOS-related computations occur entirely where within the slow mode. This is no longer the case in (5.8) as it ap- pears in the approach of Greatbatch et al. (2001). In the pres- XN sure-coordinate aproach of de Szoeke and Samelson (2002) the pb ¼ Dpk ð5:19Þ equation for ‘‘bottom pressure’’ pb, Eq. (5.18) is entirely ‘‘fast’’, k¼1 () n 1=2 however, despite the terminology, the vertically-integrated pres- XN XN þ nþ1=2 nþ1=2 sure gradient term cannot be computed from pb alone, but requires hh p uii hhp u; p vii ¼ Dp uk; Dp vk ð5:20Þ b b b k k the knowledge of geopotential heights and free-surface, which in hik¼1 k¼1 nþ1=2 nþ1 nþ1 n n ~ ~ their turn require the use of EOS (5.23). Because EOS is pressure Dpk qk ¼ Dpk qk Dt r?ðÞþqkDpkuk qkþ1=2xkþ1=2 qk1=2xk1=2 dependent, and pressure-coordinate levels are scaled by pb (which ð5:21Þ brings ‘‘fast’’ dependency in EOS), the barotropic system is closed which are isomorphic to their Boussinesq counterparts (5.1)–(5.5) via EOS, which means that in order to develop an efficient and subject to the correspondence between the variables, accurate solver mode-splitting unavoidably involves splitting of EOS as well. This is inherently related to the incompleteness of iso- morphism associated with free surface: the complete similarity Dpk $ Dzk between z-coordinate Boussinesq and pressure-coordinate non- pb $ D ¼ h þ f ð5:22Þ Boussinesq system would be only if both are rigid-lid (de Szoeke x~ $ w kþ1=2 kþ1=2 and Samelson, 2002), see their Section 4), which, in fact, decouples A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 55 barotropic (i.e., rigid lid) pressure from EOS. In the remainder of The solution procedure for (5.28), (5.29) uses values of f at the Section 5 we re-examine known mode-splitting techniques in or- previous time steps (up to n) to compute the r.h.s. term. (In an oce- n der to explore the implication for splitting non-Boussinesq ocean anic code this happens through EOS.) Using f and un at time t = tn models with fully-compressible EOS, while avoiding introduction as the initial conditions, advance them using fast-time stepping to n+1 of additional splitting errors. t = tn + Dt. The final values are accepted as f and unþ1, and the r.h.s. is recomputed in proceeding to the next baroclinic step. 5.2. Stability analysis of mode splitting algorithm in Greatbatch et al. We now demonstrate that this procedure is computationally (2001) unstable unless some temporal filtering is employed. Without loss of generality consider a one-dimensional analog of (5.28), (5.29), Using the identity, which makes it possible to obtain the solution as a sum of left- and right-traveling Riemann invariants: qnþ1 þ qn sffiffiffi ! sffiffiffi ! qnþ1ðh þ fnþ1Þqnðh þ fnÞ ðfnþ1 fnÞ pffiffiffiffiffiffi pffiffiffiffiffiffi 2 @ h @ h ! @tR gh @xR ¼ f u gh f u fnþ1 þ fn @t g @x g þðqnþ1 qnÞ h þ ; 2 1 gh 2fn 3fn1 þ fn2 ¼ : ð5:30Þ 2 c2 Dt one can introduce fast-and-slow splitting into (5.8) as follows (cf., Eq. (12.56) in Griffies, 200416): This is just a linear combination of one-dimensional versions of (5.28), (5.29). Rþ and R can be solved for separately pffiffiffiffiffiffi qðeÞnþ1 þ qðeÞn @f qðeÞnþ1 qðeÞn þ þ þ as R ðtn þ Dt; xÞ¼R tn; x Dt gh þ Q ðtn þ Dt; xÞ and R ðtn þ þ ðh þ fÞ 2 @t Dt ! pffiffiffiffiffiffi Dt; xÞ¼R t ; x þ Dt gh þ Q ðt þ Dt; xÞ, where Q±(t,x) are re- qðeÞnþ1 þ qðeÞn n n þ r? ðh þ fÞu ¼ 0; ð5:26Þ ± 2 sponses to the r.h.s. forcing in (5.30)with Q (tn,x) = 0. Consider a n f n ^f Fourier component, ¼ðkÞ eikx where the step multiplier where qðeÞ is vertically averaged density computed from (5.13). For u u^ the purpose of the subsequent analysis, we discretize the slow- k is not yet known. Ideally, without the errors introduced but pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi time, but keep fast-time continuous (i.e., assume that barotropic icDt 1egh=c2 numerical discretization, its values should be k ¼ e , time steps are sufficiently small that the associated discretization hence jkj = 1, which corresponds to the finite-time-step phase incre- errors are negligible in slow-time). Suppose density is computed ments for non-damped left-and right-traveling waves (cf., (B.8) in using the non-approximated EOS with full P. In this case q depends Appendix B). The phase speed is slightly smaller than that for on f through hydrostatic pressure. This dependency is taken into ac- incompressible fluid. The actual solution of (5.30) is count within the slow-mode when computing terms containing qðeÞ, sffiffiffi ! ffiffiffiffi but these terms are kept constant during the barotropic time- h p Rðt; xÞ¼kn ^f u^ eik xðttnÞ gh stepping. g For further simplicity of analysis, we now restrict ourselves to pffiffiffiffi the situation where density depends on pressure alone (Appendix 1 gh eikðttnÞ gh 1 ^f 2kn 3kn1 þ kn2 eikx pffiffiffiffiffiffi ; B). In this case EOS is = + P/c2, where = const is density at 2 q q1 q1 2 c ikðt tnÞ gh the surface atmospheric pressure, and c is speed of sound. This 2 translates into the vertical profile q ¼ q egðfzÞ=c and which after reaching t = tn+1 = tn + Dt becomes 1 sffiffiffi ! gðhþfÞ=c2 2 n h ikx ia q ¼ q1½e 1=½gðh þ fÞ=c R ðt þ Dt; xÞ¼k ^f u^ e e 2 g q1½1 þ gðh þ fÞ=ð2c Þþ: ð5:27Þ 1 eia 1 ^f 2kn 3kn1 þ kn2 eikx : Substituting this into (5.26), assuming a flat bottom at 2 ia z = h = const, linearizing about the rest state, and using the extrap- olation rule (5.13), we obtain

nþ1 n @f 1 gh fðeÞ fðeÞ þ hr u ¼ @t ? 2 c2 Dt 1 gh 2fn 3fn1 þ fn2 ¼ : ð5:28Þ 2 c2 Dt This and the barotropic momentum equation (Appendix B),

@tu þ gr?f ¼ 0; ð5:29Þ comprise the barotropic mode. Unlike the more usual situation with splitting in a stratified Boussinesq model, now it is the free-surface Eq. (5.28) that receives r.h.s. the forcing term from the slow mode, while there is no slow r.h.s. in the momentum equation. Density q is still allowed to change due to compressibility, and (5.29) does not imply smallness of density variation in vertical direction. Fig. 3. Absolute value of characteristic roots of (5.32) corresponding to the physical modes as a function of a for = 0.025, corresponding to h = 5500 m and 1 c = 1500 ms . Because the mode-splitting ratio Dt/Dtfast is expected to be 16 The original code of Greatbatch et al. (2001) uses leap-frog stepping; later a more significantly larger than unity, a is allowed to exceed p, hence entering the range, advanced, staggered time placement of tracers and momenta was introduced in where barotropic motions are aliased, if sampled with the baroclinic time steps,

MOM4. In this approach stepping of tracers and free surface is from n to (n +1)th tn,tn+1 ,.... Only two periods are shown; the continuation in a is nearly periodic with baroclinic step. damping toward jkj =1;jkj > 1 means numerical instability. 56 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 pffiffiffiffiffiffi The quantities a ¼ kDt gh and = gh/c2 haveq theffiffi same meaning as dependency in EOS into the fast mode. Without any approximation nþ1 ^ h^ ikx in Appendix B. Since R ðt þ Dt; xÞ¼k f gu e , EOS can be rewrittem as sffiffiffi ! sffiffiffi ! q ¼ r q þ q0 ; ð5:33Þ h h 1 eia 1 0 k ^f u^ ¼ ^f u^ eia ^f 2 3k1 þ k2 : g g 2 ia where r = r(f z) chosen to absorb most of the EOS compressibility, but is also simple to compute; q0 ¼ const is chosen in such that ð5:31Þ 0 0 q q0, and q is only weakly dependent on f. With (5.33) only This pair of equations is homogeneous for f^f; u^g, which means that the second parenthetical factor need be extrapolated in time. Then Z Z it admits non-trivial solutions only for the specific values of k deter- @ f @ 0 mined by the characteristic equation, qdz ¼ q ðh þ fÞdr @t @t h Z1 1 sin a @f 0 @r k2 2k cos a þ 1 þ ð2 3k1 þ k2Þ ¼ 0: ð5:32Þ ¼ q þ q0 r þðh þ fÞ dr 2 a @t 0 @f Z 1 0 0 ±ia @q The limit of ? 0 recovers k = e , and one can also verify that þ r ðh þ fÞdr: ð5:34Þ ±ia(1/4) k e for a, 1, which matches (B.9) in Appendix B. For 1 @t large a but still small , the splitting procedure distorts the ampli- Choosing r ¼ egðfzÞ=c2 (which in r-coordinate becomes tude, resulting in a possible numerical instability, jkj >1 (Fig. 3). r ¼ ergðhþfÞ=c2 ¼ er, where c is a representative constant value This mechanism is generic to mode-splitting instability, and it is for speed of sound) converts the above into associated with phase-delay of the slow-time r.h.s. terms—com- Z Z 0 0 0 puted only once at the beginning of the fast-time-stepping and kept @f 0 @q q0ð1 þ Þþ q ð1 2rÞdr þðh þ fÞ ð1 rÞdr constant thereafter—relative to the more rapidly changing phase of |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}@t 1 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}1 @t fast-time terms. Because a has the meaning of phase increment for \fast" \mostly slow" the barotropic wave during one baroclinic step Dt, a may exceed ± p ð5:35Þ by several multiples, depending on the mode-splitting ratio. The r instability occurs even if the fast-and slow-time algorithms are both where we have expanded r = e 1 r + for 1. stable if taken separately, and even if there is numerical dissipation Even in the simplest case of barotropic compressible fluid, 2 0 within the slow-mode algorithm. q = q1 + P/c (hence q0 ¼ q1 and q 0) the expression inside The remedy for instability is a more accurate splitting; i.e., elim- [...] in the ‘‘fast’’ term is not equivalent to vertically averaged den- inate or reduce the -terms, or to introduce artificial damping in sity q–as follows from (5.27) q ¼ q1ð1 þ =2Þ in this case instead of the fast-time-stepping, essentially preventing it from entering into q1(1 + ). This non-equivalence leads to the replacement of (5.28) the aliasing range jaj > p while still maintaining jkj near unity. In with the MOM4 code this is achieved by uniform averaging of both f ð1 þ Þ@tf þ ðÞ1 þ =2 hr?u ¼ 0; ð5:36Þ and u over a 2Dt interval, or 1Dt in the case of staggered time-step- ping (Sec. 12.5 of Griffies, 2004). This introduces damping compa- which in combination with (5.29) yields the correct barotropic rable to that of a backward-Euler implicit step and reduces the phase speed in agreement with (B.9). Unlike (5.28) the above does temporal accuracy to first-order. A gentler fast-time-averaging not have any r.h.s. at all, hence produces no splitting error. 0 – should take into account this instability mechanism, which is com- In the general case of q 0, splitting (5.35) requires forward 0 parable in its strength with that associated with the splitting of extrapolation of q as in (5.13) with subsequent computation of PGF terms (items (iii) and (iv) in Section 3.2). Furthermore, because the two-dimensional fields, Z Z of its specific form of fast-time averaging, MOM4 does not have ex- 0 0 0 c 0 act discrete consistency between the averaged free surface and q0 ¼ q dr and q0 ¼2 q rdr; ð5:37Þ averaged volume or mass fluxes (for the Boussinesq or non-Bous- 1 1 sinesq variants) in the slow-time step. Thus, the content conserva- with their discretized formulas,17 tion or constancy preservation properties for tracer advection XN 1 XN cannot be maintained simultaneously, and one must chose be- D ¼ Dz ; q0 ¼ Dz q0; k D k k tween them. The selected choice is constancy, implemented by k¼1 () k¼1 ! an auxiliary slow-time step for f in Eq. (12.95) of Griffies (2004)). 2 XN Dz XN c0 k 0 0 This f is then used to compute new-time-step control-volumes q ¼ 2 Dzk þ Dzk qk : ð5:38Þ D 2 0 for the tracer update but thereafter discarded. The loss of content k¼1 k ¼kþ1 conservation comes from the fact that the f updated this way is With (5.35), the non-Boussinesq nonlinear free-surface equation is not equivalent to that obtained from the barotropic mode, result- h f @f ing in a difference in control volumes. (Another source of non-con- 0 c0 þ q0 þ q þ q0 þ q g servation is the Robert-Asselin filter needed in the case of leap-frog c2 @t time-stepping.) The choice of vertical grid that allows a change of h þ f þ r q þ q0 þ q þ qc0 g ðh þ fÞu only the top-most grid-box height with f only (while all others are ? 0 0 2c2 "# fixed) results in a slight redistribution of discrete values of density @q0 @qc0 h þ f within the vertical column in the case of purely barotropic mo- f ; : ¼ðh þ Þ þ g 2 ð5 39Þ tions. The existing non-Boussinesq splitting algorithms neglect this @t @t 2c effect, which leads to some non-conservation of mass.

5.3. A method for stabilizing algorithm of Greatbatch et al. (2001) by 17 These sums do not rely on a particular structure of the vertical coordinate and are self-normalizing in the sense that substituting q0 1 yields q0 ¼ qc0 ¼ 1. Even splitting EOS k 0 c0 though Dzk depends on f, the resulting q and q are only weakly dependent through

EOS pressure, but the f-dependency through Dzk cancels out (cf., Eq. (3.23) in Dukowicz’ idea factoring of EOS provides a guideline to improve 0 SM2005). This makes it possible to use the most recently available Dzk to compute q stability and splitting accuracy in (5.26) by moving most of f and qc0 . A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 57 where we back-substituted = g(h + f)/c2 to expose all f dependen- equation following (2.11) there), and also in Hallberg (1997). The cies. The most accurate (but also the most complicated) time-split- above can be rewritten in terms of bottom pressure, pb gqD, ting procedure precomputes the r.h.s. time derivatives of q0 and qc0 @ q p ðh þ fÞ using slow-time variables, and keeps them constant during baro- ðÞþp u g r b p r h ¼ b ? b ? tropic time-stepping, while all f-terms, including the ones in @t |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}q 2 2 ð5:42Þ g(h + f)/c in both l.h.s. and r.h.s., are allowed to change at every ¼F barotropic step. The splitting error of this algorithm can be esti- @tpb þ r?ðÞ¼pbu mated as Oð2Þ and Oð Dðc2Þ=c2Þ. It does not rely on the smallness 0 of q =q0. This algorithm replaces (5.14) with where the new prognostic variable pb is more natural for non-Bous- X sinesq models because it appears as a single prognostic variable un- n n 0n1 0n2 DAi;jDzi;j;kri;j;k q0 þ 2qi;j;k qi;j;k ¼ const der time derivative in the second equation, however, the presence i;j;k of f in PGF terms separately from q or p cannot be eliminated com- X ð5:40Þ b n n n 0n1 0n2 pletely. It should be noted that despite the common meaning F’s DAi;jDzi;j;kqi;j;kri;j;k q0 þ 2qi;j;k qi;j;k ¼ const: i;j;k have different dimensions in (3.14), (5.41) and (5.42) – relatively to (5.41), F is divided by q0 in (3.14) and is multiplied by an extra These are closer to the simultaneous field-conservation laws since g in (5.42). Nevertheless, for notational simplicity we retain the n n ri;j;k is computed using the same f as used to compute Dzi;j;k and same symbol F for all versions, and, consistently with SM2005 all f-terms in (5.39) evolve in fast-time with r evolving synchro- and with (3.15) in Section 3.2, we choose the sign of F as it appears nously with f without any splitting. in the r.h.s. of barotropic momentum equations, hence negative sign A simplified, but slightly less accurate procedure for (5.39) can in (5.41) and (5.42). c 2 be devised by precomputing q0 gðh þ fÞ=c -terms at the beginning Mode-splitting requires decomposition of vertically integrated n 0 of barotropic stepping using f and combining them with q0 þ q . PGF into 0 2 0 This admits additional Oð f=h q =q0Þ¼Oðgf=c q =q0Þ-errors (definitely negligible in any practical case). Finally, precomputing F¼g½...¼\fast" þ \slow" ð5:43Þ q gðh þ fÞ=c2 using fn brings Oð f=hÞ¼Oðgf=c2Þ errors. This is 0 where ‘‘fast’’ term can be efficiently computed from either p , qD,or only marginally more computationally demanding than the non- b f field – whichever plays role of prognostic variable in the barotrop- linear analog of (5.28). Even in this case the splitting is more accu- ic continuity equation, while ‘‘slow’’ must be made as weakly rate than (5.28), which admits OðÞ error. However, these dependent as possible from this variable. The inherent dilemma in simplifications cause loss of synchronization between rn and i;j;k (5.41) and (5.42) is that while qD or p /g may be considered as a sin- Dzn , resulting in some compromising of the conservation proper- b i;j;k gle variable, in the general case of compressible fluid changes in p ties (5.40). b translate in changes in both free surface f (hence changing D) and q Splitting of PGF terms in the non-Boussinesq case follows Sec- (via dependency from pressure through EOS). In pressure-based tion 3.2 using EOS (5.33). The multiplier r can be moved outside coordinated, knowing p means that the distribution of pressure the pressure gradient operator (2.14) and furthermore can be sep- b throughout the water column is known, so one can use EOS to com- arated from the influence of f via (3.10). This means that q and q ⁄ pute specific volumes at each grid box, after which grid-box heights are now expressed entirely in terms of q and q0, so the difference 0 become known as well. Vertical summation of heights yields D, and from the Boussinesq model is in the appearance of r-terms as a therefore free surface f = D h. However, this would work only if multiplier in the PGF when the momentum equations are rewritten there is no mode splitting, because it involves using EOS to compute in conservation form. a 3D field, and EOS depends on pb, which changes in fast time. Therefore a computationally efficient time-split model should em- 5.4. An overview of mode-splitting algorithms in non-Boussinesq ploy some sort of approximation to allow computation of f via pb models in fast time solely from two-dimensional barotropic fields. The second aspect is that in the presence of stratification and non-uni- Regardless of the type of vertical coordinate, vertical integration form topography F consists parts which tend to cancel each other, of non-Boussinesq momentum and mass-conservation equation so any splitting which disregards this balance is doomed to be yields, inaccurate. "# ! SM2005 (cf., Eq. (3.15) there) addressed the latter issue by can- @ q D2 ðÞþqDu g r qDr h ¼ advection; Coriolis; celing the large terms by hand, first by rewriting the upper Eq. @t ? 2 ? |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} (5.41) as  ¼F D dissipation; forcing terms; @tðÞþqDu gD q r?f þ r?q þðq qÞr?h ¼ ð5:44Þ 2 @tðqDÞþr?ðqDuÞ¼fresh-water flux; ð5:41Þ and, subsequently, substituting D = h + f into gD{...} term and sep- R R R R arating terms which depend on f from those which do not. The where D ¼ h þ f; q ¼ 1 f qdz; q ¼ 2 f f qdz0 dz; u ¼ 1 f qudz resultant f-dependent part is given by (3.18) [In SM2005 this is D h D2 h z0 qD h are the total depth of water-column, vertically-averaged density, F¼Fð0Þ þF0 decomposition via Eqs. (3.31)–(3.32) there.] In the vertically-averaged ‘‘dynamic’’ density [both are the same as in Boussinesq case this is all what is needed because f is also prognos- (3.19)], and vertically-averaged density-weighted velocity, respec- tic variable of the barotropic continuity equation because of the tively. The derivation of pressure-gradient term in this form can q ! q0 replacement in terms with time derivatives, hence be found in Section 3.1 of SM2005, up to Eq. (3.15), with the only @tðqDÞ!@tðq0DÞ¼q0@tf. In doing so it is also assumed that both difference is that q ! q0 in terms containing time derivatives and q and q⁄ are independent of f, which in its turn imposes two restric- in the definition of u if Boussinesq approximation is applied. Anal- tions: (i) either exclusion of f from EOS pressure, or incompressibil- ogous derivations, but expressed in terms Montgomery potential ity of EOS; and (ii) specific functional dependency of how vertical can be found in Higdon and de Szoeke (1997, see their Section 2.1, coordinate system is adjusted by changes in free-surface elevation note the appearance of triangular sum in the second unnumbered – proportional stretching. 58 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

The same two issues must be dealt with in the non-Boussinesq it vertically. Since there is no use for q and q⁄ within the fast term, case using bottom pressure instead of free surface. A ‘‘physicist’s’’ there is no need to compute them as well, however we explicitly in- 18 split extracts the gpbr\f term from the PGF term in (5.42), clude all the terms in r.h.s. of (5.49) to facilitatep theffiffiffiffiffiffi error analysis. Neglecting all terms except ‘‘fast’’ yields gh for the phase q p ðh þ fÞ F¼g r b p r h speed of external waves. Unlike in the Boussinesq case, it does ? q 2 b ? not depend on the choice of q0 and it should not in non-Boussinesq q pbðh þ fÞ models. Although this is mainly correct, three effects are not cap- ¼gp r?f gr? 1 b q 2 tured: the slowdown of barotropic speed due to bulk compressibil- 1 ity (Appendix B), stratification (Appendices C and D), and gp½r ðh þ fÞðh þ fÞr p : ð5:45Þ 2 b ? ? b topographic coupling between free-surface and stratification if – Then, utilizing the fact density variations are small relative to its r\h 0(cf., the second line in Eq. (3.32) in SM2005). As all three effects are present in the 3D mode, and are also depend on the fast mean value, pb is dominated by bulk part which does not change variables, the differences contribute to mode-splitting error. The in time, so it is convenient to split pb into its reference value and anomaly, which in the simplest case19 are ‘‘mixed’’ term is baroclinic because it vanishes if density is uniform due to ððq =qÞ1Þ!0, but it also contains p0 which evolves in q ¼ q þ q0 q0 q ; b 0 0 fast time. This term is mainly responsible for baroclinic slowdown 0 0 ð5:46Þ pb ¼ q0gh þ pb pb q0gh (recall that q < q for positively stratified fluids) and for topo- – after which (5.45) can be rewritten as graphic coupling, if h const. It should also be noted that in the "# !case of compressible fluid the ratio q=q also depends on f and 2 q q gh p0 þ q gf p0 q gfÞ p0 due to pressure dependency in EOS, so the ‘‘slow’’ term also con- F¼gp r f gr 1 0 þ b 0 h þ b 0 b b ? ? 0 q 2 2 2 tains some traces of pb-dependency. The accuracy of this split relies ÂÃ on the following smallnesses: 1 0 0 0 0 gpb q0gf r?h hr?ðpb q0gfÞþpbr?f fr?pb 2 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} q q q gh 0 0 ¼0; if f¼p =ðq0gÞ 1 1; r?h 1; 1 ð5:50Þ b q q c2 ð5:47Þ and mode-splitting error has terms proportional of each of the so far without any approximation. This still needs a relationship to three. One of the main difficulties specific to the non-Boussinesq translate p into f within the barotropic mode (hence using baro- b case is the definition of the reference state for p : while (5.46) by tropic variables alone) in order to close the system. In the simplest b itself is merely a variable change and does not constitute any case it is approximated as approximation, (5.46) in combination with (5.48) is a rather strong f p0 = g ; 5:48 ¼ b ðq0 Þ ð Þ assumption: free-surface elevation f computed by 3D mode via EOS which turns (5.42) into does not necessarily agree with (5.48), @ p0 q ðÞþp u g q gh þ p0 r b ¼gr 1 p0 h p q p0 p0 @t b 0 b ? g ? b f ¼ D h ¼ b h ¼ h 0 1 þ b vs: f ¼ b : ð5:51Þ |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}q0 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}q qg |fflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflffl}q qg q0g \fast" \mixed" "# bias q q gh2 gr 1 0 þ ? q 2 In the case of flat bottom the bias mostly differentiates out from the |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} ‘‘fast’’ term gpbr\f leaving only a minor error of Oððq q0Þr?fÞ, baroclinic;\slow" and mostly cancels out from all other terms in (5.47). However, in 0 0 @tpb þ r? q0gh þ pb u ¼; the case of non-flat topography the bias does affects the split (hence ð5:49Þ the second parameter in (5.50)) and is not easy to remove by includ- ing the ‘‘mostly slow’’ into the terms recomputed during fast-time where dots (...) in the first equation indicate other slow terms, such stepping: if computed as a part of 3D algorithm, it uses the correct as advection, Coriolis, forcing, viscous dissipation terms, as well as values of free surface, but once treated as fast, there is no other minor 3D correction terms in pressure-gradient associated with choice than to use an approximate f form (5.48). For the same rea- the fact that (5.48) is only approximately match the actual free sur- son it is not easy to modify this algorithm to account for the effect of face as it is computed by the 3D mode using the actual EOS. Typi- slower barotropic phase speed due to the influence of stratification cally only the ‘‘fast’’ term is recomputed at every barotropic time within the ‘‘fast’’ term.20 The other aspect specific to non-Boussinesq step, while all other terms are computed by the 3D mode and play case is that for a fully compressible EOS it is no longer possible to the role of 3D ? 2D forcing. The particular form of ‘‘fast’’ term as in interpreted the ratio of q =q as purely due to stratification: it is af- (5.49) appears in Griffies and Adcroft (2008, see Eqs. (182)-(183)); fected by bulk compressibility as well. In the next section we will de- also Griffies (2009, see Section 7.7.4, Eqs. (7.137)–(7.139) there).A sign a more accurate split which avoids the use of a statically defined similar approach of considering perturbation p0 relative to a stati- b reference state altogether. cally-defined rest-state reference field, with subsequent approxi- mate closure to compute geopotential was taken by Marshall et al. (2004, see Eq. (27) and the two paragraphs after it, Eqs. 5.5. Mode splitting using incremental variables: The Boussinesq case

(40)–(42), and, finally, Ul = bsrs at the end of Section 3a) for an atmospheric model. The actual codes do not compute ‘‘slow’’ and Because the theoretical rationale for splitting the total fluid mo- ‘‘mixed’’ terms literally as in (5.49), but instead compute the full tion into barotropic and baroclinic modes mainly comes from the baroclinic 3D PGF term using an appropriate scheme and integrate orthogonality of wave motions in the case of linearized equations over flat bottom, and, accordingly, virtually all theoretical studies about numerical stability of splitting algorithms are done in the 18 This particular form is motivated by the PGF term of a barotropic layer of compressible fluid, see Appendix B, Eq. (B.2), note the mutual placement of pb and f. 19 A more elaborate decomposition involves using reference profile for density 20 This aspect is somewhat parallel to the initialization issues for pressure- (specific volume) instead of constant value can be found in Appendix B of de Szoeke coordinate models, Griffies (2009, see Sections 7.2, 7.3 there, especially the difficulties and Samelson (2002). with the sigma-pressure model, Section 7.3.3.7.). A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 59

flat-bottom framework, the justification of splitting in the presence where, obviously, the initial state for df = 0, and the right-most of bottom topography is more obscure: while the separation of operations symbolize setting new state of the ‘‘slow’’ variables, time scales remains well-defined, the orthogonality principle is which are also used as the initial state for the barotropic mode dur- no longer valid. Nevertheless, the splitting must be dealt with in ing the next 3D time step. the general case of non-flat bottom despite the fact that a complete In comparison with (3.18) the incremental form (5.53) com- analysis of numerical stability is no longer possible. SM2005 (and pletely ‘‘hides’’ the baroclinic-topographic hydrostatic balance into even more so in Section 3.2 Shchepetkin and McWilliams (2008)) the 3D term. Assuming spatially uniform free surface, hence setting – advance the following principle: the modification of vertically- f = const 0in(3.18) turns it into gf½ðh þ f=2Þr?qþ integrated pressure gradient term by advancing the barotropic ðq qÞr?h. It must vanish in the case of horizontally uniform mode from 3D time step n to n + 1 should resemble as close as pos- (flat) stratification. However its vanishing requires cancellation of sible the difference between the original and the new vertically- the two terms inside square braces [] because in the presence of integrated pressure gradient as it would be computed by the 3D topography flat stratification results in non-uniform q and q⁄. mode using the new free-surface field, but the same baroclinic The incremental form (5.53) ensures this cancellation for any density distribution. The intuitive rationale for this principle is f = const (not necessarily f = 0) as long as the vertically integrated the presumption that if the barotropic mode drives the barotropic pressure gradient term computed by 3D mode vanishes: recall that fields toward a new equilibrium when advancing from n to n +1, 3D computing of pressure gradient term is inherently more accu- that equilibrium should be disturbed as little as possible during rate that via q and q⁄. It should also be noted that smallness of the next time step. The resultant form of the barotropic pressure df/D is more justifiable than smallness of f/D (or, similarly f/h) be- gradient term coincides with that of Higdon and de Szoeke cause in deep areas where phase barotropic speed is large both are (1997) in the case of flat bottom (subject to non-Boussinesq to small, but comparable, since f may change rapidly per time step, if Boussinesq translation), but it also leads to specific form of topog- barotropic is running using time step close to the maximum al- raphy-and-free-surface terms, and practical experience of gaining/ lowed by stability. On the other hand, in shallow areas where loosing stability of the model when switching between treating/ free-surface changes may no longer be very small in comparison not-treating these as ‘‘fast’’ terms. with depth, the barotropic motions may resolved in 3D time step This leads to an equivalent, but alternative to SM2005 interpre- resulting is smooth changes, hence df is expected to be smaller tation of the splitting procedure if we rewrite (5.41) in terms of than f. For this reason, if linearization is required, e.g., in the case incremental variables – basically changes caused by the barotropic of implicit treatment of free surface using a third-party elliptic sol- mode starting from the initial state corresponding to 3D time step ver, the use of df in (5.53) provides a more natural approach. It n. Thus we introduce df = f hfin, and, consequently, substitute should be noted that the most commonly used approach retains only the gDr (q df) term, and usually with q replaced with q . f ! f þ df hfin þ df hence D ! D þ df h þhfin þ df ð5:52Þ \ ⁄ ⁄ 0 Eq. (5.53) suggests two more terms, and notably the very last of into (5.41) while algebraically separating all terms containing df. the first equation couples stratification with topography and free The Boussinesq version of it becomes surface, but still the whole approach yields essentially the same 5-diagonal elliptic equation for df. @ ðÞFþq ðD þ dfÞu gDðÞþ df r ðÞþq df gq dfr f @t 0 ? ? 5.6. Mode splitting using incremental variables: non-Boussinesq case df2 g r q þ gðÞq q dfr h ¼ with fully compressible EOS 2 ? ? @ df þ r ðÞ¼ðD þ dfÞu Another consequence of incremental form (5.53) is that it can @t ? be generalized to the case of non-Boussinesq model with com- 5:53 ð Þ pressible EOS. Similarly to (5.52) we introduce incremental where now only df and u are changing during the barotropic time variables stepping (e.g., f is kept constant in fast-time in gq⁄df r\f – the last term in the first line of the first equation). qD ! qD þ dm; The solution procedure is therefore as follows: before starting f ! f þ df hence D ! D þ df ð5:55Þ the barotropic modehi the full vertically-integrated pressure-gradi- q ! q þ dq q D2 ent term F¼g r? 2 qDr?h is precomputed via the actual q ! q þ dq pressure gradient scheme of 3D mode using the state of free-surface at time step n and the predicted or extrapolated density field at after which the barotropic continuity equation becomes n + 1/2. Note, this is not equivalent to computing q and q first ⁄ @ and then computing F as suggested by this formula using an ad dm þ r ððqD þ dmÞuÞ¼ ð5:56Þ @t ? hoc spatial discretization – when considering continuous equations these two forms are equivalent to each other, but discrete forms which identifies dm as the natural fast-time prognostic variable. they are not. In a sigma-model not exercising proper care here The incremental form of the non-Boussinesq version of (5.41) would result in an unacceptable pressure gradient error passed into can be derived by noting that the barotropic mode. Instead, the precomputed q and q are to be ⁄ ! used only in terms containing df. Once all preparations are q D2 q qD D r qDr h r qDr h complete, the barotropic variables are advanced and fast-time ? 2 ? ? q 2 ? averaged, 0 1 0 1 q q ðÞqD þ dm ðÞD þ df nþ1 nþ1 n nþ1 ! r þ d ðÞqD þ dm r h; hdfi hfi ¼hfi þhdfi ? q q 2 ? df ¼ 0 B C B n 1 C nþ1 B Dnþ1 h f þ C n ! @ hðD þ dfÞui A ! @ ¼ þh i A ð5:57Þ u ¼hui nþ1 nþ1=2 nþ1 hðDþdfÞui hh ð D þ dfÞuii hui ¼ nþ1 Dþhdfi where, we must provide some the means to compute responses df ð5:54Þ and dðq=qÞ to changing dm. Both relationships involve EOS, 60 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 however they are needed during fast-time stepping, so they must q r q þ q0 1 q0 q0 ¼ 0 1 1 ; ð5:66Þ be expressed somehow in terms of 2D fields only. 0 q r q0 þ q 6 q0 The principal assumption that at the ‘‘slow’’ time step n the which leads to an estimate of how = responds to perturbation free-surface field f and the three-dimensional density are in hydro- ðq qÞ in free surface df, and dm, static equilibrium with each other as governed by fully compress- ible EOS, e.g., given a distribution of masses throughout each q r q q 1 1 df ¼ ! 1 vertical column, hydrostatic pressure is computed by integration q r q q 6 6 D from surface downward, after which specific volume and height q 1 1 dm 1 ; ð5:67Þ of each grid box is computed via EOS, and vertical summation of q 6 6 qD grid box heights results in f. Once the barotropic mode departs 2 from the state corresponding to time step n, the change in dm re- where we have neglected quadratically small terms Oð Þ and 0 0 q q sults in change of both free surface df and vertically averaged den- Oð Þ. q0 sity dq in such a way that the hydrostatic equilibrium is Substitution of (5.58) and (5.67) into r.h.s. of (5.57) turns it into 2 3 maintained. This means that an increase in dm results in propor- 1 dm ðÞqD þ dm D þ 1 tional increases in both df and dq, q 1 1 dm 2 q r 4 1 5 ? q 6 6 qD 2 1 dm 1 1 dm 1 dm dq ¼ ; df ¼ 2 1 ; ð5:58Þ 2 D 1 dm 2 ; : 1 þ 2 qD q q ðÞqD þ dm r?h ð5 68Þ where the 1 dm term in denominator quadratically small, and is which, after some algebraic transformation yields 2 qD merely to keep @ q 1 D dm u gD dm ðÞðq þ Þ Fþ r? qD þ dm ¼ðq þ dqÞðD þ dfÞð5:59Þ @t q2 q 1 q 1 as an exact identity. Above 1 is effective vertically integrated þ g dmr?f þ g 1 dmr?h q 2 q 2 compressibility parameter computed via EOS. In the simplest case 2 3 2 5 dm 1 dm (see Appendix B) = gD/c , where c is speed of sound, resulting in q þ gr? 2 ¼ an estimate 0.025 for deep ocean. In a more general case we as- q 6 q 6 q D @ sume EOS in form of dm þ r?ðÞðqD þ dmÞu ¼ ð5:69Þ 0 @t q ¼ rðPÞ q0 þ q ðH; S; PÞ ; ð5:60Þ where we have kept terms with all powers of dm, but have dropped 0 0 where q0 ¼ const, q q0, and ð@q =@PÞjH;S¼const dr=dPR, so most all terms with power of higher than the first, and terms which in- f of pressure effect is absorbed into r(P). Since q ¼ 1 qdz ¼ R R R D h volve quadratically-small product of by ðq=q 1Þ. 1 f 0 1 f 1 f 0 D h r q0 þ q dz ¼ q0 D h r dz þ D h rq dz it is natural to The entire splitting algorithm is therefore formulated as fol- express Z lows: bottom pressure pb is considered to be a prognostostic vari- 1 f able, and it evolves in slow time by adding increments g dm, 0 q ¼ r q ¼ r q0 þ q where r ¼ r dz and which are computed (fast-time averaged) by the barotropic mode. D h Z Before starting fast-time stepping of barotropic mode from n to 1 f q0 ¼ rq0 dz: ð5:61Þ n + 1 all necessary terms notably the state of free-surface f and full rD h vertically integrated PGF terms are precomputed using full 3D Change in the total depth of water-column causes proportional algorithms with compressible EOS. Also computed at this stage stretching of q profile (hence q is not affected by the change), and kept constant thereafter until the next baroclinic time step while in contrast, r(P) profile moves up-and-down with free surface are the stiffened density ratios q=q needed by (5.69). After these without any stretching at all (since it is function of pressure alone) preparations, the barotropic mode is advanced toward n +1,

0 1 dm ¼ rbottq df rbottq df; ð5:62Þ nþ1 0 1 bott 0 hdmi nþ1 n nþ1 dm ¼ 0 B C hpbi ¼hpbi þ ghdmi nþ1 @ A where r and q are bottom values of r and q . On the other ! @ hðqD þ dmÞui A ! nþ1 ; bott bott u ¼huin u nþ1 hðqDþdmÞui n 1=2 h i ¼ nþ1 hand, hh ð qD þ dmÞuii þ hpb i =g 1 1 ð5:70Þ dm ¼ 1 rq df 1 rq df ð5:63Þ 2 2 0 where the first column symbolizes setting of initial conditions, the which leads to an estimate second in time stepping of barotropic mode via (5.69) performing fast-time averaging on the way, and the third column is translation ¼ 2ð1 r=rbottÞ: ð5:64Þ back to slow-time variables.21 In the simplest case of vertically uniform speed of sound r is a linear function of pressure, r ¼ 1 þ =2, cf., (3.22). A more general (5.64) 21 To prevent the accumulation of roundoff errors it is useful to extract a constant- accounts for the nonuniformity of c due to its pressure dependency, in-time bulk part from pb, Z leaving aside only the temperature effect in the upper ocean. f¼0 p pð0Þ p^ ; where pð0Þ pð0Þ x; y g r dz; b ¼ b þ b b ¼ b ð Þ¼ q0 The ratio ðq=qÞ is affected by both compressibility and barocli- z¼h nicity, so its behavior is controlled by on EOS. Similarly to (5.61), and use p^b as the prognostic variable in instead of pb, meaning that the increments Z Z n+1 ^ n+1 f f hdmi are added to pb in (5.70), not to pb. Then, whenever needed, hpbi is com- 2 nþ1 ð0Þ ^ nþ1 0 0 puted afterward by adding back the bulk part, hpbi ¼ pb þhpbi , which can be q ¼ rq ¼ r q0 þ q ; where r ¼ 2 r dz dz and D h z used everywhere in the code except time differencing and time integration: these Z Z ^ ð0Þ f f must still use pb. It can be easily estimated that for typical oceanic conditions pb 0 2 0 0 ð0Þ is 34 orders of magnitude larger than p^b, while the contrast between p and q ¼ 2 rq dz dz; ð5:65Þ b rD h z increments ghdmi is even greater – so the roundoff errors cannot be ignored, even with double precision. However, we emphasize that p^b is merely for bookkeeping, where r⁄ can be estimated as r⁄ =1+/3 in the case of uniform c, cf., and from the mathematical point of view, the splitting algorithm does not rely on ^ ð0Þ (3.22). Combining the above, the smallness of pb relatively to pb . A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 61 The overall structure of (5.69) is similar to its Boussinesq coun- gh D c2 ¼ -0:025; 0:04; terpart (5.53) with an obvious one-to-one correspondence be- c2 c2 tween all the terms, with the exception of dm2- and dm3-terms in f q0 2 104 0:2; 0:005 0:01; ð5:71Þ r.h.s. of the first Eq. (5.69). As expected, (5.69) reverts back to shal- h q0 low-water equations if ðq=q Þ!1 and ? 0. What is essentially – – new is that in the general case of q=q 1 and 0 linearization where the extreme parameter values typically do not occur simul- of (5.69) around the rest state, f ¼ u ¼ 0, captures the correct taneously which limits the algorithmic error estimates that contain phase speed for the barotropic waves, where both effects – slow- their products. We have assumed a range of values of c = 1480– down due to stratification (cf., (3.20), also Appendices C and D) 1540 since most of this variation is purely due to pressure effect, and seawater compressibility (cf., (3.21), also Eq. (B.9) from Appen- and therefore can be ‘‘absorbed’’ into r if a nonlinear function of dix B.1) – are now accurately represented within the fast mode pressure/depth is used. The assumed range of depths varies from 0 alone, and the phase speed does not depend on the choice of refer- mid-ocean to the inner continental shelf. The estimate for q =q0 0 ence constants such as q0 – and it should not in non-Boussinesq (cf., Fig. 1) is significantly smaller than typical values of q /q0 due models. The derivation procedure for (5.69) also illustrates that to stiffening. the contributions due to the two physical effects – baroclinicity The mode-splitting error of the Boussinesq ROMS is estimated 0 2 and compressibility – cannot be combined into a single effective as Oððq =q0Þ Þ with all other parameters (5.71) being irrelevant 0 field: ðq=q Þ and appear in different combinations in r.h.s. of (see Section 3.2). The error increases to the first-order Oðq =q0Þ (5.69), so the baroclinic ratio ðq=q Þ must be computed from the if q and q⁄ in (3.18), (3.19) are replaced with q0; and an additional ‘‘stiffened’’ density field separately from bulk compressibility effect Oðgh=c2Þ error is introduced if a non-stiffened, realistic EOS is used accounted by . This confirms the assumption made in Section 3.2 in an ad hoc way. that the slowdown of barotropic wave speed due to vertical strat- Non-Boussinesq models must use full dynamic pressure in EOS ification (3.20) can be correctly estimated by the barotropic mode which implies that density (specific volume) within each vertical in a Boussinesq model as long as q and q⁄ in (3.19) are ‘‘stiffened’’. grid box (or layer in layered model) depends on the state of free Conversely, using non-stiffened version of them does not yield the surface. At this time we are not aware of any reference where correct estimate of influence of compressibility (3.21), not the one takes into account the finite compressibility of seawater into combination of both effects, resulting in overall incorrect barotrop- the context of mode-splitting – the density field is usually com- ic phase speed. puted using the sate of free surface at the latest available baroclinic – The case with 0 while keeping q=q 1 corresponds to step and kept constant during barotropic time stepping from that ‘‘stiffened’’ non-Boussinesq model. In this case the modification baroclinic step to the next. This causes mode-splitting errors and, of pressure gradient terms relatively to uniform-density shallow- in principle, opens a possibility for the numerical instability either water equations is controlled entirely by the ratio q=q . This is via a mechanism similar to one described in Higdon and Bennett comparable to splitting algorithm of Higdon and de Szoeke (1996), or in our Section 5.2. With some effort, splitting in a non- (1997), Hallberg (1997), which is also non-Boussinesq, however Boussinesq model can also be made predominantly second-order assuming that all variations of density are solely due to stratifica- accurate in sense that the error estimate depends on pair-wise tion. In terms of complexity and computational cost (while main- products of parameters (5.71). This can be done in both implemen- taining the same level of mode-splitting errors) this is very tations of non-Boussinesq model – the density extrapolation meth- similar to the Boussinesq version (5.53): dm and df can be easily re- od of Greatbatch et al. (2001) (our Section 5.2, following Eq. (5.33)) lated in fast time as dm ¼ qdf, where q does not change in fast and if using pressure-based coordinates (Section 5.6). The splitting time. This, in principle, makes it possible to express everything di- error is essentially avoided by including the f ? EOS pressure feed- rectly in the original rather than incremental variables. back into the fast-time stepping. This is facilitated by factoring EOS Clearly, most of the complexity of (5.69) relative to its Bous- in a manner used by Dukowicz (2001), even though it was not orig- sinesq counterpart is associated with the bulk compressibility - inally intended for non-Boussinesq modeling. A complete account- terms: because of EOS pressure dependency and, correspondingly, ing of all f dependencies within the barotropic mode results in a the feedback of the state of free-surface f into density distribution, substantial increase in complexity, most likely beyond the point f can be accurately computed from bottom pressure pb only by of diminishing return, especially if keeping in mind that a model using full 3D algorithm. Since f is needed to compute barotropic- with stiffened EOS already captures all important physical effects pressure gradient term, a simplified algorithm is needed to express (thermobaricity, and also the steric effect – the principal non-Bous- it using 2D variables only during the fast-time stepping. This sinesq effect), so re-introduction of bulk compressibility brings necessitates approximations which may admit splitting errors. only minor quantitative changes. Using incremental variables offers relief: now f is computed using Existing oceanic codes like MOM4p1 use simpler mode-splitting full 3D algorithm, but only once per baroclinic time step (at the procedures resulting in stronger reliance on the smallness of beginning of fast-time stepping), while it is increment df which parameters (5.71), e.g., smallness of f relative to total depth and is computed using a simplified 2D algorithm [essentially via even to the uppermost grid-box if there is strong stratification (5.58) leading to (5.63) and ultimately to (5.69)]. This avoids within the upper portion of the domain. The later is due to vertical mode-splitting errors, but brings extra cost associated with the redistribution of density by barotropic motions in the case of ver- additional terms in (5.69) recomputed at each fast-time step and, tically fixed grid. This can be traced back to the long-standing vi- an extra 2D field – – to be computed once and stored. It is essen- sion of free-surface pressure as ‘‘pressure on the rigid lid’’, where tial that EOS compressibility can be split into the bulk and the the Poisson equation was considered primarily as a more efficient much smaller residual parts – a property of seawater EOS pointed replacement for the original stream-function method, and subse- out by Dukowicz (2001). quently, the split-explicit free-surface was motivated more by the ease of implementation in the era of parallel computing (or 5.7. Summary for Boussinesq and non-Boussinesq mode splitting lack of efficient parallel elliptic solvers at that time) rather than by the interest to the physical phenomena associated with the free The preceding analysis shows that the existing non-Boussinesq surface itself. This view is inherited from the historical de-empha- models essentially rely on the same assumptions as the Boussinesq sis of temporal accuracy for barotropic motions (first-order) and models, with the relevant smallness parameters estimated as the practice of rather heavy-handed temporal filtering of them. 62 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

In this case conversion to a non-Boussinesq model with new text of r-coordinate modeling. In essence, it comes from the real- sources of mode-splitting error does not usually lead to an instabil- ization that the bulk of the seawater compressibility effect is ity because sufficient numerical damping is already present. Since dynamically passive and can be separated in the EOS from the fine-resolution regional modeling gives more interest in barotropic dynamically relevant parts. Then the constant Boussinesq refer- processes (e.g., tides and topographic amplification of tidally-in- ence density q0 is much closer to the varying q = q (H,S,P) com- duced motions), the accuracy can be restored by using a more pared to simply replacing q ? q0 in the standard Boussinesq time-scale selective fast-time averaging filter, but this also brings approximation. This significantly reduces the Boussinesq errors sensitivity to splitting errors. One should note that legacy MOM while retaining all the necessary physical effects outlined in Sec- code does not formally guarantee discrete finite-volume conserva- tion 3. The output of the EOS routine is not the in situ density or 0 0 0 0 tion property for tracers, even in their simpler Boussinesq versions its anomaly, but q1 ¼ q1ðH; SÞ and q1 ¼ q1ðH; SÞ. The former one (Griffies et al., 2001; Griffies, 2004), and therefore have somewhat essentially retains its original meaning derived from Jackett and less to lose when converting to non-Boussinesq in a simple way McDougall (1995)), while the latter is now defined by (4.6). The (Greatbatch et al., 2001). This situation has been improved with functional form of EOS is modified to include the cz2 term in conversion to pressure-based coordinates (with relative ease for (4.7), which causes a corresponding change in the algorithm for z-coordinate model, somewhat more difficult for sigma), but this adiabatic differencing (4.8) and a minor revision of the pressure- also commits the model to use hydrostatic approximation and gradient algorithm. there is no obvious way to overcome this limitation. When consid- The limitations of the Boussinesq approximation are widely dis- ering barotropic mode splitting, the vertical coordinate ‘‘integrates cussed in the literature, and sometimes its complete abandonment out’’ exposing essentially the original dilemma – density (specific is advocated. In Section 5 we show that doing so leads to a more volume) depends on the state of free surface via EOS pressure – complicated code: the mode-splitting procedure interferes with which must be dealt with during fast-time stepping or accept addi- the density computation via EOS since EOS pressure depends on tional mode-splitting errors. For hydrostatic models it is still sim- the state of free-surface field, and consequently EOS can be no pler to make a Boussinesq code more self-consistent in its longer considered as belonging entirely to the slow mode, resulting discretized properties than a non-Boussinesq one. Conversely, a in a more complicated splitting algorithm to avoid additional split- more general, nonhydrostatic, non-Boussinesq code for flows with ting errors and/or extra temporal filtering for the barotropic mode low Mach number (e.g., Gatti-Bono and Colella, 2006) would be to control numerical instability. This computational aspect of EOS more computationally expensive, hence less competitive for realis- compressibility is usually overlooked in theoretical studies. tic, large-scale oceanic simulations. Remarkably, though originally intended for a Boussinesq code, Another class of hydrostatic oceanic models uses an isopycnic the factoring of EOS as q ¼ rðPÞqEOSðH; S; PÞ by Dukowicz (2001) vertical coordinate. As in the case of pressure-based coordinates, provides a useful framework for designing accurate mode-splitting these models also avoid the density extrapolation (5.13) by the in a hydrostatic, non-Boussinesq, free-surface model that retains specific design of their coordinate due to Lagrangian or predomi- all the compressibility effects in EOS. Removing the bulk compress- nantly Lagrangian movement in the vertical direction. The use of ibility from EOS, but keeping thermobaric part of it (i.e., stiffening) the Montgomery potential in the horizontal pressure-gradient eliminates the need for splitting EOS pressure into fast and slow force makes it natural to have a non-Boussinesq formulation. Orig- components, thus simplifying the algorithm, however departure inally these models were derived using the assumption of incom- from the fully realistic EOS also means that the model can no long- pressible EOS and Lagrangianly conserved (potential) density er be considered as a fully non-Boussinesq. Notably, among the (Bleck and Boudra, 1981; Bleck and Smith, 1990). When the ther- existing non-Boussinesq models, modern isopycnic-coordinate mobaric effect was included later by Sun et al. (1999), it introduced models always use stiffened EOS (Sun et al., 1999; Hallberg, EOS stiffening for the first time. This also leads to the necessity of 2005). This allows retention of the principal non-Boussinesq ef- using ‘‘thermobaric references’’ to avoid pressure gradient errors of fects, notably steric sea-level changes. an essentially sigma-type (despite using isopycnic coordinates (!)), Post facto we note a hierarchy of four approximations, all of resulting in a mechanism for numerical instability and a delicate which are in practical use in hydrostatic oceanic modeling today. treatment (Hallberg, 2005). [This approach (along with this partic- They differ only by the treatment of compressibility effects in ular reason for stiffening) may become obsolete after a recent EOS: full non-Boussinesq ? non-Boussinesq with stiffened alternative proposed by Adcroft et al. (2008).] In addition to the EOS ? Boussinesq with stiffened EOS ? standard Boussinesq (q0 above, the mode-slitting algorithm of Higdon and de Szoeke in combination with full EOS). We recommend that the last of (1997), Hallberg (1997), still used today, was derived assuming these be discontinued; i.e., if the Boussinesq approximation is cho- incompressible EOS. For these reasons, and because of their prac- sen, it should be applied uniformly to the entire code, including tices these models can be classified as ‘‘stiffened’’ non-Boussinesq EOS. This means stiffening. models.

Acknowledgments 6. Summary This research is supported by the Office of Naval Research through Grants N00014-05-10293 and N00014-08-10597. The desire for a physically correct representation of EOS effects (e.g., thermobaricity) in oceanic modeling requires the use of the nonlinear, realistic seawater EOS. It is often implanted in an Appendix A. Alternative variants of Boussinesq approximation ‘‘add-on’’ fashion into a Boussinesq-approximation code. This and potential vorticity (PV) equation in a shallow barotropic brings a set of internal inconsistencies with spurious effects (e.g., layer of compressible fluid vertical dependency of acceleration created by a purely barotropic pressure gradient) and interference with barotropic–baroclinic McDougall et al. (2002,) proposed an alternative version of mode-splitting, including potential numerical instability. This pa- Boussinesq approximation – their Eqs (27)–(29) – which have ex- per shows in Sections 2–4 how a combined approach of Dukowicz actly the same form as the original Boussinesq equations, with the (2001) and SM2003 leads to an accurate Boussinesq model with a exception that velocity u~ is not the usual velocity, but is the aver- computationally-practical form of stiffened EOS in the specific con- aged normalized mass flux per unit area, A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 63

~ q q u ¼ qu =q0 ¼ qu=q0; where u ¼ qu=q; ðA:1Þ pb@tAþpbu r?AA@tpb Au r?pb ¼ 0 ðA:7Þ see their Eq. (23), where overbar means Reynolds averaging and, for which ultimately leads to PV equation simplicity, we have changed their notation u~ ! u~. Their motivation f þ r u comes from subgrid-scale parameterization. They noticed that ðÞ@ þ u r ? ¼ 0: ðA:8Þ q t ? defining mean velocity as density-weighted average u instead of pb a more conventional Eulerian average u, leads to a more physically So the principle dynamics of this compressible, but barotropic fluid interpretable turbulent correlation terms. Following these is (i) vertical uniformity of u (as a consequence, vertical uniformity guidelines they derived a set of averaged non-Boussinesq equations of relative vorticity), and (ii) Lagrangian conservation of barotropic – their Eqs. (24)–(26) – to which they applied Boussinesq approxi- PV as stated above. The above derivation can be performed for uni- mation to derive their alternative Boussinesq. MGL2002 argue, and form (on an f-plane) or non-uniform Coriolis parameter, and in hor- provide some support for their claim, that their alternative Bous- izontal orthogonal curvilinear coordinates as well. The fact that sinesq equations are more accurate than the standard – notably, fluid is compressible adds almost nothing – one can easily repeat the stationary parts of continuity and tracer equations are equiva- the above with constant-density layer (in this case it does not mat- lent to their non-Boussinesq counterparts, the geostrophic-balance ter whether it is Boussinesq or non-Boussinesq) the only difference is their momentum equations is equivalent to non-Boussinesq (see is replacement p ? gq (h + f). their Section 5). They also use this claim to dismiss the EOS b 0 In the case of conventional Boussinesq approximation with stiffening approach of Dukowicz (2001) as unnecessary, because pressure-dependent EOS the pressure-gradient term in the first their alternative Boussinesq equations already eliminate the non- Eq. (A.2) becomes (1/q ) p = gq/q f, the gq = P0(f z), physical shear in a geostrophically-balanced flow without any need 0 r\ 0r\ which is no longer vertically uniform. This precludes the transition for adjustment in EOS. from (A.2) to (A.3) and the subsequent derivation of PV equation Unfortunately the alternative Boussinesq equations of MGL2002 similar to above. If one considers only the geostrophic balance in also alter the relationship between the advection and Coriolis terms Boussinesq version of (A.2), the resultant velocity becomes propor- making it impossible to derive barotropic PV equation, which is tional to (q/q )-profile as well, which is an artifact of Boussinesq possible to derive from non-Boussinesq or stiffened Boussinesq 0 approximation. sets. Excluding dynamic pressure from EOS equation of (A.2) by Consider a layer of non-stratified, but slightly compressible replacing it with q ¼ q þ q0 ðq gzÞ eliminates the vertical fluid, hydrostatic, non-Boussinesq, 0 EOS 0 dependency, @ u þ u r u þ w@ u þ f k u ¼ð1=qÞr p; Z t ? z ? 1 q þ q0j g f p ¼g 0 z¼f f q0 ðq gzÞ dz0 @tq þ r? ðquÞþ@zðqwÞ¼0; r? r? r|fflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflffl}? EOS 0 ðA:2Þ q0 q0 q0 z @ p ¼gq subject to pj ¼ 0; ¼0 z z¼f ! ! q ¼ q ðpÞ EOS @q0 gf2 EOS EOS f f f ; : g 1 g r? gr? 2 ðA 9Þ @p z¼f 2c along with proper kinematic boundary conditions at free surface z = f and bottom z = h, where h = h(x,y) is bottom topography. while introducing an insignificant non-physical term due to the

Above u,w =(u,v,w) is 3D velocity vector, r\ is horizontal (two- artificial assumption that q = q0 at z = 0 instead of free surface dimensional) gradient or divergence operator. As discussed in Sec- z = f (above c is speed of sound, so the associated smallness param- tion 2 from (2.1) to (2.4), under these circumstances EOS and hydro- eter gf/c2 2 106 assuming c = 1500 m/s and f = 1 m). With this static equations can be solved resulting in self-consistent profiles choice made it is possible to derive an analog of (A.8) while using for density and pressure, q ¼ð1=gÞP0ðf zÞ and p ¼Pðf zÞ (where Boussinesq approximation. Note that the extra term in (A.9) does P0 means derivative of P with respect to its argument f z), and, as not preclude elimination of pressure gradient term when taking follows from (2.4), the acceleration due to pressure gradient is sim- curl of (A.3). ply gr\f and is independent of z regardless of the functional form EOS stiffening by Dukowicz (2001) (in this case trivially revert- of P¼Pðf zÞ. This means that(A.2) admits solutions where hori- ing EOS in (A.2) to constant density, q = q0, making it insensitive to zontal velocities are independent of z, the choice of which pressure is used in EOS), also eliminates the

vertical dependency in (1/q0)r\p, allowing derivation of baro- @tu þ u r?u þ f k u ¼ gr?f; ðA:3Þ tropic PV Eq. (A.8). @tpb þ r? ðpbuÞ¼0; If the alternative Boussinesq system is used – the hydrostatic R version of Eqs. (27)–(29) from MGL2002 in combination with where p g f dz f h is identified as bottom pressure. It b ¼ h q ¼Pð þ Þ EOS using in situ pressure, q = q (p)asin(A.2) – then it is not 1 EOS is assumed to be invertible, h þ f ¼½P ðpbÞ. The pressure gradient the ordinary velocity, but the density-scaled velocity u~ becomes term r\f can be eliminated by taking horizontal curl of u-equation proportional to (q/q0), which means that unscaled velocity is ver- (A.3), tically uniform as it should. However, despite the correct geo- strophic balance, the modified Boussinesq set of MGL2002 also @t½r? uþu r?½r? uþf r? u þ½r? ur? u ¼ 0; does not produce a counterpart of (A.8). Inspection of the deriva- ðA:4Þ tion above shows that there must be proper scaling relationships or among all three terms: Coriolis, pressure-gradient, and advection. In the original Boussinesq the scaling between Coriolis and advec- @ Aþu r AþAr u ¼ 0; ðA:5Þ t ? ? tion is correct, but pressure gradient receives non-physical verti- where A is absolute vorticity, A¼f þ r? u. On the other hand, cally-dependent multiplier. In the modified case, rescaling of pb-equation (A.3) can be dressed up as velocity by q/q0 corrects the relationship between Coriolis and pressure gradient, but at the expense of sacrificing the relationship @ p þ u r p þ p r u ¼ 0: ðA:6Þ t b ? b b ? between Coriolis and advection – it is ‘‘unscaled’’, rather than den-

Multiplying the A-equation by pb, the latest pb-equation by A, and sity-weighted (hence vertically-dependent) vorticity should be subtracting them to cancel the r\ u-terms, combined with f in order to form absolute vorticity, and then PV. 64 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

Conversely, the alternative non-Boussinesq set–Eqs. (24)–(26) which admits wave solutions with phase speed from MGL2002–contains the reverse density multiplier q /q in sffiffiffiffiffiffiffiffiffiffiffiffi 0 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffi the nonlinear terms, which makes it possible to derive the PV q % gh; gh=c2 1 ~c ¼ gh ¼ c 1 egh=c2 ðB:8Þ equation above merely because the alternative set can be trans- 2 qb & c; gh=c 1: formed back into the original non-Boussinesq written in terms of the non-scaled u. (Since ghq ¼ Pb can be identified as bottom pressure, this result In contrast, stiffening of EOS by Dukowicz (2001) repairs the coincides with Eq. (29) in Dukowicz (2006) for a non-stratified case, relationship between pressure gradient and Coriolis terms without i.e., by there setting N2 = 0.) For typical oceanic conditions of disturbing the already correct mutual relationship between Corio- h = 5500 m, speed of sound c = 1500 m/s, and acceleration of gravity lis and advection. g = 9.81 m/s2, we estimate = gh/c2 = 0.025 1. This means that the inclusion of the compressibility effect leads to a slightly smaller Appendix B. Surface gravity waves in a compressible barotropic (0.6%) phase speed than that of a layer of the same thickness filled shallow-water layer by an incompressible fluid, rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffi pffiffiffiffiffiffi 1 e B.1. Non-Boussinesq case ~c ¼ gh ¼ gh 1 þ ; 1: ðB:9Þ 4 Eq. (2.1)–(2.4) from Section 2 show that the horizontal acceler- The physical explanation for the reduced phase speed comes from ation generated by a free-surface gradient does not depend on the the fact change in qD caused by divergence of vertically-integrated vertical coordinate when vertical variation of density is due only to fluxes results in a lesser, by a factor of 1 /2, change in f than in compressibility and there is hydrostatic balance, the case of incompressible fluid, while the remaining /2 fraction of @tu þ¼gr?f: ðB:1Þ qD translates into change in density q, which does not contribute to acceleration due to pressure gradient in (B.7). This makes it possible to consider motions where u is vertically uni- Eq. (B.8) indicates that the gravity-wave phase speed cannot be form. In this case (B.1) integrates vertically in a trivial manner, and larger than the speed of sound. The opposite asymptotic limit, gh/ together with vertically integrated mass-conservation equation it c2 1, has meaning as well, ~c ! c. This corresponds to a lowest- yields, vertical-mode wave of compression in an isotropic atmosphere,

@tðqDuÞþ¼gqDr?f which does not have a well-defined free surface; rather its density decreases with height, so that the e-folding scale c2/g plays the role @tðqDÞþr? ðqDuÞ¼0; ðB:2Þ of its effective thickness. The hydrostatic approximation alone ex- where cludes acoustic waves without making an assumption of incom- Z Z 1 f 1 f pressibility or small density variation; in fact, acoustic and u ¼ qudz ¼ udz ¼ u; qD D gravity waves become indistinguishable in the hydrostatic case. Z h h 1 f q ¼ qdz; and D ¼ h þ f: ðB:3Þ B.2. Boussinesq case with q = qEOS(P) D h Note that the difference between its density-weighted and volume As follows from (2.5), the Boussinesq counterpart of (B.1) with 2 averaged u disappears because of vertical uniformity of u. Solution pressure-dependent EOS q = q1 + P/c is of (B.2) implies that the prognostic variable qD (to be interpreted gðfzÞ=c2 here as a whole symbol having the meaning of total weight of water @tu þ¼ðg=q0Þq1e r?f; ðB:10Þ column) needs to be translated into f in order to close the system. where u can no longer be vertically uniform. However it is still pos- This is done through EOS. For simplicity we assume that EOS has ~ gðfzÞ=c2 2 sible to derive an analog of (B.7) by substituting u ¼ u e , the form of (2.7), viz., q = q1 + P/c with q1 and c constant. Com- hence bined with hydrostatic balance, this leads to the vertical profile 2 gðfzÞ=c2 2 gðfzÞ=c2 q = q1 exp{g(f z)/c }, which results in e @tu~ þ u~ g=c e @tf þ

2 gðfþhÞ=c2 gD=c2 gD=c2 gðfzÞ=c e 1 e 1 e 1 ¼ðÞg=q q e r?f; ðB:11Þ q ¼ q ¼ q ; hence qD ¼ q : 0 1 1 gðf þ hÞ=c2 1 gD=c2 1 g=c2 or ðB:4Þ ~ ~ 2 @tu þ u g=c @tf þ¼gðÞq1=q0 r?f; ðB:12Þ This depends on f through D. Now we consider small motions in a compressible fluid layer which admits solutions with u~ independent of z as long as the non- over a flat bottom. Substituting expression for qD from (B.4) into linear terms (denoted as dots) are vanishingly small. Equation for the second equation (B.2) with h = const yields free surface becomes 2 ! gD=c Z 2 gD=c2 e 1 f gD=c e @ f u f u 0; B:5 gðfz0Þ=c2 0 e 1 q1 fgt þ r? þ q1 2 r? ¼ ð Þ @ f ~ ~ : g=c t ¼r? ue dz ¼r? u 2 ðB 13Þ h g=c or Linearization of (B.12) and (B.13) assuming h = const, yields @tf þ u r?f þðq=qbÞDr? u ¼ 0; ðB:6Þ 2 ~ ~ gD=c @tu ¼gðq1=q0Þr?f and @tf þ he½ðÞ 1 = r? u; ðB:14Þ where we identify qb ¼ q1e as the value of the density near the bottom. To derive (B.6) we have used the EOS for the purpose of where, once again, = gh/c2. The resultant phase speed of barotropic specific volume, i.e., to express f from mass content qD. This situa- waves is tion is common for non-Boussinesq models, and it reverses the role qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi of EOS in a Boussinesq-approximation model. Linearization of (B.1) ~c ¼ ghðq1=q0Þðe 1Þ= ðB:15Þ and (B.6) yields the system, where it is worth to note, cf., (B.4), that q ðe 1Þ= ¼ q, hence pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 @tu ¼gr?f and @tf ¼ðq=qbÞhr? u; ðB:7Þ ~c ¼ gh q=q0. The choice of Boussinesq reference density q0 ¼ q A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 65 pffiffiffiffiffiffi makes ~c ¼ gh, however it should be noted that in the case of non- ix u^ ¼ik g^f; ix ^f þ ix g^ ¼ik H u^ ; 1 1 1 uniform topography this choice cannot be made universal because q q ix u^ ¼ik g 1 ^f ik g 1 1 g^; ix g^ ¼ik H u^ : q depends on h. The effect of slowdown of barotropic waves by 2 q q 2 2 compressibility is lost. 2 2 ðC:2Þ

B.3. Boussinesq with reference pressure in EOS The right pair of equations can be used to exclude u^1 and u^2 from the left pair: Everything is the same as in the previous case, except that EOS ð~c2 gH Þ^f ¼ ~c2g^; pressure is computed assuming f 0, and is not allowed to change 1 2 ðC:3Þ with f. Then q = q1 exp{ gz/c }, so the counterpart of (B.1) 2 q2 q1 q1 ^ ~c gH2 g^ ¼ gH2 f; becomes q2 q2 Z f 1 0 2 where we have introduced ~c ¼ x=k which is identified as phase @ u þ¼ r gq egz =c dz0 t q ? 1 speed for the vertical modes, external or internal.22 This has non- 0 z Z f trivial solutions if g g gz0=c2 0 ¼ q r?f r? q1e dz ðB:16Þ q0 z¼f q0 z |fflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflffl} 2 2 q2 q1 2 q1 ð~c gH1Þ ~c gH2 ¼ ~c gH2 : ðC:4Þ 0 ¼ q2 q2 2 gq1 gf=c gq1 or @tu þ¼ e r?f r?f which permits solutions q0 q0 It can be rewritten as with vertically uniform u, and we note that gf/c2 5 106 ~4 ~2~2 ~2^2 assuming c = 1500 m/s. The analog of the linearized system (B.7) c c c0 þ c0c1 ¼ 0; ðC:5Þ becomes where

@tu ¼gðÞq =q r?f and @tf ¼hr? u: ðB:17Þ 1 0 2 2 H1H2 q2 q1 ~c0 ¼ gHðÞ1 þ H2 and ^c1 ¼ g : ðC:6Þ which yields phase speed H1 þ H2 q2 qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Eq. (C.5) has two solutions, ~c ¼ gh q =q : ðB:18Þ 1 0 rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ~c2 ~c4 ~c2 ~c2 For the choice of q ¼ q ¼ q ðe 1Þ= q ð1 þ =2Þ, where = gh/ ~c2 ¼ 0 0 ~c2^c2 ¼ 0 0 1 4^c2=~c2 0 1 pffiffiffiffiffiffi 1 2 4 0 1 2 2 1 0 c2 1, the above turns into ~c gh ð1 =4Þ, which is similar to ~c2 ~c2 (B.9). This result is merely a coincidence: the Boussinesq system 0 0 2 2 2 ^c1; as long as ^c1 ~c0; ðC:7Þ (B.17) does not provide a proper physical mechanism for phase 2 2 ~2 ~2 ^2 speed reduction due to compressibility effects (note that in compar- where cþ ¼ c0 c1 is associated with the barotropic mode, and ~2 ^2 ison with (B.7) the density multiplier appears in front of pressure c ¼ c1 with the baroclinic. This indicates that the presence of strat- gradient term, rather than in free-surface equation). This result also ification reduces the square of phase speed of the barotropic mode suggests that using the near-surface value of density to compute relative to that of a constant-density layer of the same thickness, pressure gradient term in barotropic mode is an optimal choice H1 + H2, by the square of the baroclinic phase speed. This conclusion for a simple mode-splitting algorithm (simple means that it does is true even beyond the assumption of a small density difference, not take into account the influence of stratification onto barotropic q2 q1 q2: (C.5) has the property that the sum of its two roots 2 phase speed) in a Boussinesq model with reference EOS pressure cf., is always ~c0. Griffies (2004, see Sections 12.3–12.4 there), Griffies (2009, see Sec- Structure of the barotropic mode: ^f and g^ are moving in tion 7.7.3, Eq. (7.129)). proportion,

H1H2 q2q1 g^ gH H2 H þH q Appendix C. Surface gravity waves in a stratified two-layer fluid ¼ 1 1 ¼ 1 2 2 2 H1H2 q2q1 ^f c H1 þ H2 H1þH2 q "#2 C.1. Incompressible case 2 H2 H1 q1 1 2 1 ; ðC:8Þ H1 þ H2 H H q The simplest system with both barotropic and baroclinic modes ð 1 þ 2Þ 2 is a two-layer model. It is also the simplest way to illustrate the which is slightly smaller than the fraction of the distance from the influence of stratification on the phase speed of surface gravity bottom to the interface between the two layers relative to the total waves. For small oscillations around the resting state, the two- depth. Correspondingly, layer model has a set linear equations: u^ ^c2 H q 2 ¼ 1 1 1 1 1 1 ; ðC:9Þ ^ @ u ¼g r f; @ ðf gÞþH r u ¼ 0; u1 gH2 H1 þ H2 q2 t 1 x t 1 x 1 q1 q1 indicating that the bottom layer moves slower than the top. @tu2 ¼g rxf g 1 rxg; @tg þ H2 rxu2 ¼ 0; q2 q2 Direct splitting: Eqs. (C.8) and (C.9) indicate that neither the vol- ðC:1Þ ume-nor density-weighted vertically averaged velocity, H u þ H u q H u þ q H u u ¼ 1 1 2 2 or u ¼ 1 1 1 2 2 2 ; ðC:10Þ where uk, qk, and Hk are velocities, densities, and unperturbed thick- H1 þ H2 q1H1 þ q2H2 nesses of the top (k = 1) and the bottom (k = 2) layers; f is free- surface elevation; g is interface elevation (both are relative to their unperturbed states, z = 0 and z = H1). This system assumes hydro- 22 static balance for an incompressible fluid, but it does not use the Because later in this appendix we will consider the case of compressible fluid with a finite speed of sound, to avoid potential conflict in notation, we denote the Boussinesq approximation. phase speed of gravity waves as ~c or ^c, using ~c for both modes, if they appear together, ^ kxixt Fourier analysis: Let ðu1; f; u2; gÞ¼ðu^1; f; u^2; g^Þe , then (C.1) or for barotropic, if separately, while ^c is used for baroclinic only if it appears becomes separately. Plain c (without any symbol on top) is reserved for speed of sound. 66 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 8 < gðfzÞ=c2 can be identified as a depth-independent barotropic flow. However, q e 1 ; ^ 1 the proportionality property of perturbations, g^ vs. f and u^2 vs. u^1, q ¼ : g H z =c2 2 ðg 1 Þ 2 provides a path for splitting (C.1) into independent barotropic and q2 þ P1=c2 e ; 8 hi baroclinic subsystems. To do this multiply the upper-left Eq. (C.1) ðC:19Þ > 2 gðfzÞ=c2 < c e 1 1 top; by H and the lower-left by bH and combine the layers; similarly, q1 1 1 2 hi P ¼ > multiply the lower-right by b and combine it with the upper- : 2 gðgH zÞ=c2 P þ P þ q c e 1 2 1 bottom; right: 1 1 2 2 g f H =c2 2 ð gþ 1 Þ 1 q1 q2 q1 where P1 ¼ q1c1½e 1 is pressure at the interface be- @tðÞ¼H1u1 þ bH2u2 rx gH1 þ bH2 f þ bgH2 g ; q2 q1 tween the layers, z = H1 + g. Eq. (C.19) yields continuity of pres- sure P across the interface. Similar to (2.4), the acceleration due to @t½f þðb 1Þg¼rxðÞH1u1 þ bH2u2 ; PGF (1/q)r P is independent of the vertical coordinate within C:11 x ð Þ each layer and equal to where b is yet to be determined. Note that u1 and u2 already appear 1 r P ¼gr f and in identical combinations under @t and rx in the first and the sec- q x x ond equations, and the goal is to achieve the same for f and g. This g f H =c2 ð gþ 1Þ 1 leads to the proportionality condition, 1 q1gðÞrxf rhixg e rxP ¼ grxg ðC:20Þ 2 2 gðfgþH Þ=c2 q c =c e 1 1 1 q q q q2 þ q1 1 2 gH bH 1 2 1 1 þ 2 q bgH2 q 2 ¼ 1 ; ðC:12Þ 1 b 1 for the top and bottom layer, respectively. This leads to the momen- tum equations, and the selection of b as a root of the quadratic equation 2 q H q H 2 1 2 1 @tu1 ¼grxf; b q 1 H b q H ¼ 0 or, 1 8 2 1 2 9 "# q q gH q c2 < 2 1=2= 1 1 1 1 1 @tu2 ¼grxf g 1 1 ðrxg rxfÞ; 1 q2 H1 H1 4H1 q1 2 2 b ¼ 1 1 þ 1 : ðC:13Þ q2 q2 c1 q2c2 2 q : H H H q ; 1 2 2 2 2 ðC:21Þ

2 Assuming that 1 q1/q2 1, this leads to where we have expanded (C.20) in a Taylor series for gH1=c1 1 and retained only the leading-order terms. The equations are linear- H2 q2 bþ ¼ 1 þ 1 and ized assuming f, g H1, H2 and neglecting the advection terms. As H1 þ H2 q1 expected, the second Eq. (C.21) reverts to (C.1) if c1 ? 1, while the H1 H2 q 2 ratio c1/c2 remains finite. Furthermore, the additional terms due to b ¼ 1 1 ; ðC:14Þ H2 H1 þ H2 q 2 1 compressibility vanish if gH1=c1 remains finite, but q1c1 = q2c2, indi- which corresponds to the barotropic and baroclinic modes respec- cating their baroclinic and thermobaric nature. tively. Once b is known, (C.11) can be turned into two independent The top-layer thickness equation is derived following the path of transition from (B.2) to (B.6) in Appendix B. This leads to systems (choosing either + or sign index below), 8 1 gH1 > f ¼ f þðb 1Þg; @tðf gÞ¼H1 1 rxu1; ðC:22Þ 2 < 2 @ U ¼~c r f ; 2 c1 t x = ; where > U ¼ H1u1 þ bH2u2ðq1 q2Þ @tf ¼grxU; : 2 which is linearized, and only leading-order corrections due to finite ~c ¼ g½H1 þ b H2ðq =q Þ: 1 2 compressibility are retained. The bottom-layer thickness equation ðC:15Þ stems from mass conservation, ~2 It can be shown that the phase speeds c for each mode are the @tðÞþq2ðH2 þ gÞ rxðÞ¼q2ðH2 þ gÞu2 0; ðC:23Þ same as (C.7) for b = b±, respectively. One can also verify that (C.8) or and (C.9) can be obtained from the conditions,

ð@t þ u2 rxÞðq2ðH2 þ gÞÞ þ q2ðH2 þ gÞrxu2 ¼ 0; ðC:24Þ f þðb 1Þg ¼ 0 and H1u1 þ b H2u2ðÞ¼q1=q2 0; ðC:16Þ where, as follows from (C.19), the vertically averaged density with- that have the meaning of non-excitation of baroclinic degrees of in the bottom layer is freedom by purely barotropic motions. Since 2 gðH2þgÞ=c P1 e 2 1 1 < bþ < q2=q1; ðC:17Þ q2 ¼ q2 þ 2 2 : ðC:25Þ c2 g=c2 the weighting of u1 and u2 for the barotropic mode is within the bounds of set by (C.10). It leans toward q2/q1 when the top layer Since the interface pressure P1 depends on the thickness of the top is shallow relative to the bottom layer, H1 H2. layer, q2 depends on it as well. This leads to the participation of f in the bottom thickness equation. Substitution of the expression for P1 C.2. Compressible two-layer non-Boussinesq case just after (C.19) into (C.25), with subsequent substitution into (C.24) leads to Consider a two-layer fluid with densities in the upper and lower q1 gH2 1 gH2 layers dependent on pressure, @tg 2 @tðf gÞþH2 1 2 rxu2 ¼ 0; ðC:26Þ q2 c2 2 c2 q ¼ q P=c2 and q ¼ q P=c2; ðC:18Þ 1 1 2 2 where we retain only leading-order compressibility corrections. The with q1 – q2 due to stratification and speeds of sound c1 – c2 to above reverts to the corresponding equation in (C.1) in the incom- simulate the dependencies on temperature, salinity, and pressure. pressible limit, gH2/c2 ? 0. Using the hydrostatic balance the above leads to self-consistent Eqs. (C.21), (C.22), and (C.26) comprise a closed system that de- profiles of density and pressure in the top, H1 + g < z < f, and bot- scribes small oscillations in a compressible two-layer fluid. Its Fou- tom, H1 H2 < z < H1 + g, layers: rier analysis similar to the transition from (C.1) to (C.2) yields A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 67

ix u^ ¼ik g^f; ix ^f þ ix g^ ¼ik H0 u^ ; So the counterparts of (C.12) and the left side (C.14) become 1 1 1 0 ^ 0 ix u^2 ¼ikgðÞ1 d f ikgd g^; ðC:27Þ 2 q2 H1 H1 b b ¼ 0; bþ ^ 0 q1 H2 H2 ixð1 Þg^ ix f ¼ik H2u^2; q H q 1 2 2 2 1 : C:33 where we define ¼ þ ð Þ q1H1 þ q2H2 q1 2 q q gH q c 1 gH This indicates, once again, that the velocity weighting parameter b+ d0 ¼ 1 1 1 1 1 1 1 ; H0 ¼ H 1 1 ; q q c2 q c2 1 1 2 c2 corresponding to the barotropic mode is neither 1 (volume weight- 2 2 12 2 1 ing) nor q2/q1 (density weighting). q1 gH2 0 1 gH2 ¼ 2 ; H2 ¼ H2 1 2 ; q2 c 2 c 2 2 Appendix D. Surface gravity waves in a stratified shallow-water C:28 ð Þ layer and expect that d0, are sufficiently small and H0 ; H0 deviate only 1 2 Consider a Boussinesq fluid layer, where, for simplicity, we re- slightly from H1, H2. This leads to the characteristic equation, Âà strict our attention to a two-dimensional case in an x–z plane with- 4 0 0 2 2 0 0 0 ~c gH2 þ H1ð1 Þ ~c þ g d H1H2 ¼ 0; ðC:29Þ out : where ~c ¼ x=k. This essentially repeats (C.5) and (C.6), but with a @tu þ¼ð1=q0Þ@xP; modified set of coefficients. The resulting phase speeds for the baro- @tq þ u@xq þ w@zq ¼ 0; tropic and first baroclinic modes are ðD:1Þ @zP ¼gq; ÂÃ0 0 0 0 0 gd H H @ u þ @ w ¼ 0: ~c2 ¼ gH þ H ð1 Þ 1 2 ^c2 x z þ 2 1 H0 þ H0 ð1 Þ 2 1 We rewrite this with a r-coordinate that follows f: 0 0 0 gd H1H2 ¼ 0 0 ; ðC:30Þ z f % 0; z ! f; H2 þ H1ð1 Þ r ¼ h þ f &1; z !h; where, similar to (C.7), we keep only leading-order corrections aris- % f; r ! 0; ing from stratification and here compressibility. conversely; z ¼ f þ rðh þ fÞ ðD:2Þ 2 2 &h; r !1: When gH1=c1 ! 0 and gH2=c2 ! 0, both phase speeds revert to their incompressible limits in (C.7). On the other hand, for a com- We assume bottom topography is flat, h = const, so that the only dis- pressible fluid without stratification, q1 = q2, and the speed of tinction between @x—z and @x—r is due to f – 0. Thus, sound is the same in both layers (c1 = c2); hence, the barotropic @P @P @z @P @P @f @P phase speed from c+ from (C.30) becomes ¼ ¼ ð1 þ rÞ : ðD:3Þ @x z @x r @x r @z @x r @x @z 2 1 gðH1 þ H2Þ R R ~ f 0 0 cþ ¼ gðH1 þ H2Þ 1 þ ; ðC:31Þ Since P g dz g h f d , we can further transform this 2 c2 ¼ z q ¼ ð þ Þ r q r into where the dots denote higher-order terms with respect to Z Z 0 0 2 @P @f @q g(H1 + H2)/c 1. This coincides with (B.9) where h = H1 + H2. ¼ g qð1 þ rÞþ qdr0 þ gðh þ fÞ dr0: ðD:4Þ In the general case with both stratification and compressibility @x z r @x r @x r effects, as follows from (C.30), the stratification still causes the The density equation in r-coordinates is reduction of phase speed of the barotropic mode relative to the non-stratified case in the same manner as in (C.7), i.e., the square @tjrq þ u @xjrq þðW=ðh þ fÞÞ @rq ¼ 0; ðD:5Þ of barotropic phase speed is reduced by the square of the first baro- where @t—rq is the time tendency relative to the moving r-surface. clinic mode speed. In addition, both are reduced by the compress- The vertical velocity in r-coordinates W is related to its Eulerian ibility (finite speeds of sound), due to the replacement of layer counterpart as W¼w ð1 þ rÞ½@f þ u @f, which automatically thicknesses H , H with their primed counterparts H0 ; H0 . The baro- @t @x 1 2 1 2 satisfies the no-flux boundary condition Wj ¼ 0 at the free sur- 0 r¼0 clinic mode speed is also affected by the second term in d , which face as a consequence of the Eulerian kinematic surface boundary 2 2 involves the ratio of q1c1=q2c2. In principle, this admits the exis- condition, w = @tf + u@xf. The non-divergent continuity equation is tence of internal waves even if q1 = q2, but the speed of sound in the upper layer is greater than in the lower to yield a positive @tf þ @xjrððh þ fÞuÞþ@rW¼0; ðD:6Þ 0 d > 0. For typical oceanographic conditions we expect the ratio of which leads to equations for f, phase speeds for the first baroclinic and the barotropic modes to Z 0 be within the range of 20–100, which leads to an estimate of @ f þ @ ððh þ fÞuÞ¼0; where u ¼ udr; ðD:7Þ ^2 ~2 3 t x c=cþ 10 . This causes a substantially smaller reduction of the 1 barotropic wave speed than the influence of bulk compressibility and for W (B.9) and makes stratification less of a concern as the source of mode-splitting error. @xjrððh þ fÞðu uÞÞ þ @rW¼0: ðD:8Þ

C.3. Boussinesq case The first equation in (D.1) with its PGF expressed by (D.4), along with (D.7), and (D.8), comprise a closed system which describes The Boussinesq version of (C.1) is evolution of a layer of stratified fluid with a free surface. Since we are interested in small oscillations around the mean resting state, @ u g = f; @ f H u 0; t 1 ¼ ðÞq1 q0 rx tð gÞþ 1 rx 1 ¼ f u W0 and q = q(r), and we linearize the system using q2 q1 the variables, @tu2 ¼gðÞq1=q0 rxf g rxg; @tg þ H2 rxu2 ¼ 0: q0 0 0 0 0 ðC:32Þ f ¼ f ; u ¼ u þ u ; W¼W; q ¼ qðrÞþq ; ðD:9Þ 68 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 where all except q(r) are considered as small perturbations. Note (D.18) is that for q(r) = const, the only possible non-trivial solution 0 ^ – 2 2 c Rthat splitting of horizontal velocity into u and u , such that is f 0, as allowed by x = k gh q/q0, and W0. This corre- 0 0 1 u dr 0, is a matter of convenience, rather than an assump- sponds to familiar barotropic gravity waves. It also makes q0 = q tion that the second (primed) term is smaller than the first. The sys- the natural choice for the Boussinesqpffiffiffiffiffiffi reference density, resulting tem becomes in a correct phase speed x=k ¼ gh. Conversely, assuming ^f 0 Z but dq(r)/dr < 0 results in a Sturm–Liouville problem for Wc alone, @ g 0 @f0 ðu þ u0Þ¼ ð1 þ rÞqðrÞþ qðr0Þdr0 which leads to a set of baroclinic modes. @t q @x Z 0 r In the general case a dilemma is that the expression inside 0 0 gh @q {.[...]} in l.h.s. of (D.18) depends on r, while ^f does not. To resolve dr0; ðD:10Þ q0 r @x r this, as in the case of (D.15), vertical integration of (D.18) yields 0 0 0  Z Z @f @u @q W dqðrÞ x2 q k gh 0 0 dqðr0Þ þ h ¼ 0; þ ¼ 0; ik gh ^f ¼ Wc dr0 dr; ðD:20Þ @t @x @t h dr 2 q x q dr 0 0 k 0 0 1 r @u 1 @W þ ¼ 0; ðD:11Þ @x h @r wherep theffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi expression inside {...} no longer depends on s. Setting r ^ c x=k ¼ gh q=q0 allows for a non-trivial f, provided that W¼0, where the first equation can be split into separate ones for u, ob- however, substitution of this x/k back into (D.18) results there in tained by vertical integration of (D.10), non-vanishing expression {.[...]} and ultimately leads to a nontriv- Z Z c c @u g @f0 0 0 ial profile of W¼WðrÞ, which is proportional, and in fact, is driven ¼ ð1 þ rÞqðrÞþ qðr0Þdr0 dr by ^f. @t q @x 0 Z Z 1 r This dilemma has two consequences. First, it suggests an itera- 0 0 0 gh @q dr0 dr; ðD:12Þ tive method for finding x/k for the barotropic mode: use 2 2 q0 1 r @x r x = k gh q⁄/q0 as the initial guess and substitute it into and for u0, the residual of (D.10) after subtraction of (D.12). With 2 c gh dqðrÞ x @ W k gh c dqðrÞ Z ik r ^f ¼ þ W ; ðD:21Þ 0 2 q0 dr k @r x q0 dr PðrÞ¼ qðr0Þdr0; ðD:13Þ r which is the vertical derivative of (D.18). Then the l.h.s. of (D.21) c integration of the first term inside the left integral in the r.h.s. of can be treated as known. This leads to a problem for W alone. This (D.12) yields problem is well posed, because this value of x/k is far away from Z Z the eigenvalues of the operator in the r.h.s. of (D.21) (i.e., its eigen- 0 0 dP values are associated with internal modes and have much lower fre- ð1 þ rÞqðrÞdr ¼ ð1 þ rÞ dr dr quencies). The solution results in a profile, W¼c Wðc rÞ, proportional 1 1 Z 0 to ^f. Substitute it into the r.h.s. of (D.20) and recompute x/k, after 1 0 d : D:14 ¼ð|fflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflffl}þ rÞPðrÞj1 þ PðrÞ r ð Þ which the iterative cycle is repeated. Convergence is guaranteed be- 1 ¼0 cause (D.21) can be rewritten as Then the entire (D.12) an be rewritten as 2 c 2 ^ @ W 2 c Z Z ix s f ¼ 2 þ W; ðD:22Þ 0 0 0 0 @r @u gq @f gh @q 0 ¼ dr dr; ðD:15Þ 2 k2 2 2 k2 1 dqðrÞ @t q @x q @x where ¼ 2 h N ¼ 2 gh ð Þ is of the same order as the 0 0 1 r r x x q0 dr square of the ratio of the first-baroclinic and barotropic mode phase where we have identified speeds, hence 2 1. The scaling of Wc relative to ^f is estimated as Z Z c 0 0 Wix2^f, and the scaling of the mismatch between this l.h.s. and 0 0 q ¼ 2 qðr Þdr dr; ðD:16Þ r.h.s. of (D.20) is estimated as 1 r  2 which coincides with (3.19) from Section 3.2. x q x 4 ik 2 gh vs: ix ; ðD:23Þ Let k q0 k which implies that the corrections are indeed sufficiently small. ðÞ¼f0; u; u0; W0; q0 ^f; u^; u^0; Wc; q^ eikxixt; ðD:17Þ The second consequence is that, even though the system is lin- where the last three, u^; Wc; q^ are functions of r. Substitution into ear, it did not split into two independent subsystems: barotropic (D.10) leads to and baroclinic. This does not mean that the it is not splittable in Z principle, but rather that the actual structure of the barotropic 2 0 x gh 0 0 ^ mode cannot be represented by a vertically uniform velocity: it ik 2 ð1 þ rÞqðrÞþ qðs Þdr f k q0 r has a non-constant profile that depends on stratification q(r). Sim- Z c ^ c 0 dqð 0Þ ilarly, the presence of a non-trivial W slaved to f indicates than x @W k gh c r 0 ¼ W dr ; ðD:18Þ vertical density profile is not ‘‘frozen’’ in r-coordinates in purely k @r x q dr 0 r barotropic motions, but it changes following f. This indicates that where we have eliminated all variables except ^f and Wc using a Fou- the ideal stretching of the r-coordinate by f should not just be pro- rier-transform of (D.11), viz., portional to the distance from the bottom,

x ^f 1 Wc dqðrÞ 1 @Wc z ¼ zð0Þ þ f ðzð0Þ þ hÞ=h; ðD:24Þ u^ ¼ ; q^0 ¼ ; and u^0 ¼ : ðD:19Þ k h ix h dr ikh @r but should depend on the density profile as well to cancel W asso- Eq. (D.18) comprises a Sturm–Liouville problem with unknowns ciated with barotropic motions, and thus cancel changes of density. x (playing the role of an eigenvalue), ^f (an arbitrary non-trivial This determines the level of error in the mode-splitting algorithm of Fourier amplitude), and W¼c Wðc rÞ (a vertical profile multiplied SM2005 because the mismatch in (D.20) indicates that the phase by an arbitrary non-zero constant). The profile is subject to a pair speed of the barotropic mode is different between thep 2Dffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi and 3D c c of boundary conditions,Wjr¼0 ¼ 0 and Wjr¼1 ¼ 0. A property of parts of the code. The 2D part sees it as just x=k ¼ gh q=q0, A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70 69 and the 3D part sees it as the complete solution of (D.20) and (D.21). Hallberg, 2005. A thermobaric instability of Lagrangian vertical coordinate ocean This is a mode-splitting error, because there are contributions in the models. Ocean Modeling 8, 279–300. doi:10.1016/j.ocemod.2004.01.001. Higdon, R.L., Bennett, A.F., 1996. Stability analysis of operator splitting for large- vertically-integrated r.h.s. of the 3D momentum equations that de- scale ocean modelling. Journal of Computational Physics 123, 311–329. pend on f and have a hyperbolic character, yet are frozen during the Higdon, R.L., de Szoeke, R.A., 1997. Barotropic–baroclinic time splitting for ocean barotropic time-stepping, hence are computed using effectively a circullation modeling. Journal of Computational Physics 135, 31–53. Huang, R.X., Jin, H.Z., 2002. Sea surface elevation and bottom pressure anomalies forward-in-time Euler algorithm. due to thermohaline forcing. Part I: Isolated perturbations. Journal of Physical Oceanography 32, 2131–2150. Ingersoll, A.P., 2005. Boussinesq and anelastic approximations revisited: Potential energy release during thermobaric instability. Journal of Physical Oceanography References 35, 1359–1369. doi:10.1175/JPO2756.1. Jackett, D.R., McDougall, T.J., 1995. Minimal adjustment of hydrostatic profiles to Adcroft, A., Campin, J.-M., 2004. Rescaled height coordinates for accurate achieve static stability. Journal of Atmospheric and Oceanic Technology 12, representation of free-surface flows in ocean circulation models. Ocean 381–389. Modeling 7, 269–284. doi:10.1016/j.ocemod.2003.09.003. Jackett, D.R., McDougall, T.J., 1997. A neutral density variable for the world’s oceans. Adcroft, A., Hallberg, R., Harrison, M., 2008. A finite volume discretization of the Journal of Physical Oceanography 27, 237–263. pressure gradient force using analytic integration. Ocean Modeling 22, 106– Jackett, D.R., McDougall, T.J., Feistel, R., Wright, D.G., Griffies, S.M., 2006. Algorithms 113. doi:10.1016/j.ocemod.2008.02.001. for density, potential temperature, conservative temperature, and the freezing Antonov, J.I., Locarnini, R.A., Boyer, T.P., Mishonov, A.V., Garcia, H.E. 2006. World temperature of seawater. Journal of Atmospheric and Oceanic Technology 23, Ocean Atlas 2005. Salinity. Levitus, S. (Ed.), vol. 2. NOAA Atlas NESDIS 62, US 1709–1728. Government Printing Office, Washington, DC, 182 pp. Kanarska, Y., Shchepetkin, A.F., McWilliams, J.C., 2007. Algorithm for non- Berntsen, H., Kowalik, Z., Sælid, S., Sørli, K., 1981. Efficient numerical simulation of hydrostatic dynamics in ROMS. Ocean Modeling 18, 143–174. doi:10.1016/ ocean hydrodynamics by splitting procedure. Modeling, Identification and j.ocemod.2007.04.001. Control 2, 181–199. Killworth, P.D., Stainforth, D., Webb, D.J., Paterson, S.M., 1991. The development of a Bleck, R., Boudra, D.B., 1981. Initial testing of a numerical ocean circulation model free-surface Bryan–Cox–Semtner ocean model. Journal of Physical using a hybrid (quasi-isopycnic) vertical coordinate. Journal of Physical Oceanography 21, 1333–1348. Oceanography 11, 755–770. Locarnini, R.A., Mishonov, A.V., Antonov, J.I., Boyer, T.P., Garcia, H.E., 2006. World Bleck, R., Smith, L.T., 1990. A -driven isopycnic coordinate model of the north Ocean Atlas 2005. Temperature. Levitus, S. (Ed.), vol. 1, NOAA Atlas NESDIS 61, and equatorial Atlantic Ocean: 1. Model development and supporting US Government Printing Office, Washington, DC, 182 pp. experiments. Journal of Geophysical Research 95C, 3273–3285. Losch, M., Adcroft, A., Campin, J.-M., 2004. How sensitive are coarse general Blumberg, A.F., Mellor, G.L., 1987. A description of a three-dimensional coastal circulation models to fundamental approximations in the equations of motion? ocean circulation model. In: Heaps, N.S. (Ed.), Three-Dimensional Coastal Ocean Journal of Physical Oceanography 34, 306–319. doi:10.1175/1520- Models. Pub. AGU, Washington, DC, pp. 1–16. 0485(2004)034<0306:HSACGC>2.0.CO;2. Boussinesq, J., 1903. Théorie analytique de la chaleur. Tome II. In: Analytic theory of Lu, Y., 2001. Including non-Boussinesq effect in Boussinesq ocean circulation heat. Vol. 2, Gauthier-Villars, Paris, 625pp. . Marshall, J., Adcroft, A., Campin, J.-M., Hill, C., White, A., 2004. Atmosphere-ocean Brydon, D., Sun, S., Bleck, R., 1999. A new approximation of the equation of state for modeling exploiting fluid isomorphisms. Monthly Weather Review 132, 2882– seawater, suitable for numerical ocean models. Journal of Geophysical Research 2894. doi:10.1175/MWR2835.1. 104, 1537–1540. McDougall, T.J., Garrett, C.J.R., 1992. Scalar conservation equations in a turbulent Campin, J.-M., Adcroft, A., Hill, C., Marshall, J., 2004. Conservation of properties in a ocean. Deep-Sea Research 39, 1953–1966. free-surface model. Ocean Modeling 6, 221–244. doi:10.1016/S1463- McDougall, T.J., Jackett, D.R., 2007. The thinness of the ocean in S H p space and 5003(03)00009-X. the implications for mean diapycnal advection. Journal of Physical Casulli, V., Cheng, R.T., 1992. Semi-implicit finite-difference methods for 3- Oceanography 37, 1714–1732. doi:10.1175/JPO3114.1. dimensional shallow-water flow. International Journal for Numerical Methods McDougall, T.J., Greatbatch, R.J., Lu, Y., 2002. On conservation equations in in Fluids 15, 629–648. oceanography: How accurate are Boussinesq ocean models? Journal of de Szoeke, R.A., Samelson, R.M., 2002. The duality between the Boussinesq and non- Physical Oceanography 32, 1574–1584. doi:10.1175/1520- Boussinesq hydrostatic equations of motion. Journal of Physical Oceanography 0485(2002)032<1574:OCEIOH>2.0.CO;2. 32, 2194–2203. doi:10.1175/1520-0485(2002)032<2194:TDBTBA>2.0.CO;2. McDougall, T.J., Jackett, D.J., Wright, D.G., Feistel, R., 2003. Accurate and Dewar, W.K., Hsueh, Y., McDougall, T.J., Yuan, D.I., 1998. Calculation of pressure in computationally efficient algorithms for potential temperature and density ocean simulations. Journal of Physical Oceanography 28, 577–588. and of seawater. Journal of Atmospheric and Oceanic Technology 20, 730– Dukowicz, J.K., 1997. Steric sea level in the Los Alamos POP code – Non-Boussinesq 741. effects. In: Lin, C., Laprise, R., Ritchie, H. (Eds.), Numerical Methods in McPhee, M.G., 2000. Marginal thermobaric stability in the ice-covered upper ocean Atmospheric and Oceanic Modeling: The Andre Robert Memorial Volume. over Maud Rise. Journal of Physical Oceanography 30, 2710–2722. doi:10.1175/ NRC Research Press, pp. 533–546. 1520-0485(2000)030<2710:MTSITI>2.0.CO;2. Dukowicz, J.K., 2001. Reduction of density and pressure gradient errors in ocean Mellor, G.L., 1991. An equation of state for numerical modeling of oceans and simulations. Journal of Physical Oceanography 31, 1915–1921. estuaries. Journal of Atmospheric and Oceanic Technology 1991, 609–611. Dukowicz, J.K., 2006. Structure of the barotropic mode in layered ocean models. Mellor, G.L., Ezer, 1995. Sea level variations induced by heating and cooling: An Ocean Modeling 11, 49–68. doi:10.1016/j.ocemod.2004.11.005. evaluation of the Boussinesq approximation in ocean models. Journal of Gatti-Bono, C., Colella, P., 2006. An anelastic allspeed projection method for Geophysical Research 100, 20557–20565. gravitationally stratified flows. Journal of Computational Physics 216, 589–615. Mihaljan, J.M., 1962. A Rigorous exposition of the Boussinesq approximations doi:10.1016/j.jcp.2005.12.017. applicable to a thin layer of fluid. Astrophysics Journal 136, 1126–1133. Greatbatch, R.J., 1994. A note on the representation of steric sea level in models that doi:10.1086/147463. conserve volume rather than mass. Journal of Geophysical Research 99 (12), Oberbeck, A., 1879. Ueber die Wärmeleitung der Fls¨sigkeiten bei Berc¨ksichtigung 76712,77. der Strm¨ ungen infolge von Temperaturdifferenzen. Annalen der Physik 243, Greatbatch, R.J., McDougall, T.J., 2003. The non-Boussinesq temporal residual mean. 271–292. doi:10.1002/andp.18792430606. Journal of Physical Oceanography 33, 1231–1239. Oberbeck, A., 1888. On the phenomena of motion in the atmosphere (first comm). Greatbatch, R.J., Lu, Y., Cai, Y., 2001. Relaxing the Boussinesq approximation in In: The Mechanics of the Earth’s Atmosphere, Translated by Cleveland Abbe. ocean circulation models. Journal of Atmospheric and Oceanic Technology 18, publ. Smithsonian Inst., Washington, 1891. pp. 176–187. 2.0.CO;2. books.google.com/books?id=kGBDAAAAIAAJ>. Griffies, S.M., 2004. Fundamentals of Ocean Climate Models, vol. 496. Princeton Paluszkiewicz, T., Garwood, R.W., Denbo, D.W., 1994. Deep convective plumes in the University Press. 496 pp. ISBN-13#09780691118925. ocean. Oceanography 7, 3744. Griffies, S.M., 2009. Elements of MOM4p1. GFDL Ocean Group Technical Report No. Robertson, R., Padman, L., Levine, M.D., 2001. A correction to the baroclinic pressure 6. NOAA/GFDL, April 21, 2009, 444 pp. gradient term in the Princeton ocean model. Journal of Atmospheric and Griffies, S.M., Adcroft, A.J., 2008. Formulating the equations of ocean models. In: Oceanic Technology 18, 1068–1075. Hecht, M.W., Hasumi, H. (Eds.), Ocean Modeling in an Eddying Regime, Rueda, F.J., Sanmiguel-Rojas, E., Hodges, B.R., 2007. Baroclinic stability for a family Geophysical Monograph 177. American Geophysical Union, Washington, DC, of two-level, semi-implicit numerical methods for the 3D shallow water pp. 281–318. equations. International Journal of Numerical Methods in Fluids 54, 237–268. Griffies, S.M., Gnanadesikan, A., Pacanowski, R.C., Larichev, V.D., Dukowicz, J.K., doi:10.1002/fld.1391. Smith, R.D., 1998. Isoneutral diffusion in a z-coordinate ocean model. Journal of Shchepetkin, A.F., McWilliams, J.C., 2003. A method for computing horizontal Physical Oceanography 28, 805–830. pressure-gradient force in an oceanic model with a non-aligned vertical Griffies, S.M., Pacanowski, R.C., Schmidt, M., Balaji, V., 2001. Tracer conservation coordinate. Journal of Geophysical Research 108, 3090–3124. doi:10.1029/ with an explicit free surface method for z-coordinate ocean models. Monthly 2001JC001047. Weather Review 5, 1081–1098. Shchepetkin, A.F., McWilliams, J.C., 2005. The regional ocean modeling system: a Hallberg, 1997. Stable split time stepping schemes for large-scale ocean modeling. split-explicit, free-surface, topography-following-coordinate oceanic model. Journal of Computational Physics 135, 54–65. Ocean Modeling 9, 347–404. doi:10.1016/j.ocemod.2004.08.002. 70 A.F. Shchepetkin, J.C. McWilliams / Ocean Modelling 38 (2011) 41–70

Shchepetkin, A.F., McWilliams, J.C., 2008. Computational kernel algorithms for fine- Tailleux, R., 2009. On the energetics of stratified turbulent mixing, irreversible scale, multi-process, long-term oceanic simulations. In: Ciarlet, P.G. (Ed.), thermodynamics, Boussinesq models and the ocean heat engine controversy. Temam, R., Tribbia, J., (Guest Ed.), Handbook of Numerical Analysis. Journal of Fluid Mechanics 638, 339–382. doi:10.1017/S002211200999111X. Computational Methods for the Ocean and the Atmosphere. vol. XIV, Elsevier Tailleux, R., 2010. Identifying and quantifying nonconservative energy production/ Science, pp. 119–182. doi:10.1016/S1570-8659(08)01202-0. destruction terms in hydrostatic Boussinesq primitive equation models. Ocean Spiegel, E.A., Veronis, G., 1960. On the Boussinesq approximation for a compressible Modeling 34, 125–136. doi:10.1016/j.ocemod.2010.05.003. fluid. Astrophysics Journal 131, 442–447. Wright, D.G., 1997. An equation of state for use in ocean models: Eckart’s formula Stacey, M.W., Pond, S., Nowak, Z.P., 1995. A numerical model of the circulation in revisited. Journal of Physical Oceanography 14, 735–741. knight inlet, British Columbia, Canada. Journal of Physical Oceanography 25, Young, W.R., 2010. Dynamic enthalpy, conservative temperature, and the seawater 1037–1062. Boussinesq approximation. Journal of Physical Oceanography 40, 394–400. Sun, S., Bleck, R., Rooth, C., Dukowicz, J., Chassignet, E., Killworth, P., 1999. Inclusion doi:10.1175/2009JPO4294.1. of thermobaricity in isopycnis-coordinate ocean models. Journal of Physical Zeytounian, R.Kh., 2003. Joseph Boussinesq and his approximation: a contemporal Oceanography 29, 2719–2729. doi:10.1175/1520-0485(1999)029<2719: view. Comptes Rendus Mecanique 331, 575–586. doi:10.1016/S1631- IOTIIC>2.0.CO;2. 0721(03)00120-7.