JULY 2001
NOTES AND CORRESPONDENCE
1915
Reduction of Density and Pressure Gradient Errors in Ocean Simulations JOHN K. DUKOWICZ Theoretical Division, Los Alamos National Laboratory, Los Alamos, New Mexico 23 October 2000 and 30 January 2001 ABSTRACT Existing ocean models often contain errors associated with the computation of the density and the associated pressure gradient. Boussinesq models approximate the pressure gradient force, r 21=p, by r 21 0 =p, where r 0 is a constant reference density. The error associated with this approximation can be as large as 5%. In addition, Cartesian and sigma-coordinate models usually compute density from an equation of state where its pressure dependence is replaced by a depth dependence through an approximate conversion of depth to pressure to avoid the solution of a nonlinear hydrostatic equation. The dynamic consequences of this approximation and the associated errors can be significant. Here it is shown that it is possible to derive an equivalent but ‘‘stiffer’’ equation of state by the use of modified density and pressure, r* and p*, obtained by eliminating the contribution of the pressure-dependent part of the adiabatic compressibility (about 90% of the total). By doing this, the errors associated with both approximations are reduced by an order of magnitude, while changes to the code or to the code structure are minimal.
1. Introduction Consider the horizontal pressure force in ocean models: 1 PGF 5 =p, r
(1)
where the pressure is obtained from the hydrostatic equation ]p 5 2rg, ]z
(2)
and the density from an equation of state
r 5 r (S, u, p),
(3)
such as the Jackett and McDougall (1995, hereafter JMcD) equation, which is a fit of the commonly accepted international UNESCO equation of state in terms of potential temperature u rather than in situ temperature T. Boussinesq models approximate (1) by PGF ø
1 =p, r0
(4)
where r 0 is a constant reference density. A common Corresponding author address: Dr. John K. Dukowicz, Los Alamos National Laboratory, Theoretical Division, T-3 Fluid Dynamics, MS B216, Los Alamos, NM 87545. E-mail:
[email protected]
approximation to (3) in fixed vertical coordinate models is
r ø r (S, u, p 0 (z)),
(5)
where p 0 (z) is a specified depth-to-pressure conversion function such as that proposed by Fofonoff and Millard (1983), for example. This is done in order to avoid a nonlinear solution procedure for density and pressure. There are three types of error associated with these approximations. The first error, the one connected with the approximation in (4), we will call the Boussinesq error. Assuming that r 0 5 1 g cm 23 as in many codes derived from the original Bryan model (Cox 1984; Semtner 1986; Dukowicz and Smith 1994), the Boussinesq error can be as large as 5% based on the typical range of densities present in the ocean. The second type of error is the error in the calculation of density due to the approximation (5); we will call this the density error. Assuming a baroclinic displacement of 50 m relative to the mean represented by p 0 (z), the density error is estimated to be of order 2 3 10 24 g cm 23 , which is quite small when compared to a typical in situ density deviation, r 2 r 0 ø 3.5 3 10 22 g cm 23 . However, this can have significant dynamic consequences because the density error implies a corresponding pressure gradient error, which we will call the dynamic error. Dewar et al. (1998) have analyzed this error in detail and they concluded that it can lead to spurious transports of several Sverdrups (Sv [ 10 6 m 3 s 21 ) and associated ve-
1916
JOURNAL OF PHYSICAL OCEANOGRAPHY
locities of several centimeters per second. They therefore recommend against the use of approximation (5). However, this considerably complicates the computation of the baroclinic pressure gradient and entails substantial code modifications. Let us assume that (2) and (3) may be simultaneously integrated so that the solution for the pressure may be formally expressed as p 5 F[r (S, u, p), z],
(6a)
and therefore the corresponding approximate pressure is p9 5 F[r (S, u, p 0 (z)), z],
(6b)
where all variables are functions of (x, y, z, t) unless explicitly indicated. The errors in the above approximations may now be evaluated as follows. The pressure gradient error is
EPGF 5
(
1 1 =p 2 =p9 r r0
(
\PGF\
5 E1 1 E3 ,
(7)
where
E1 5
(1
2 (
1 1 2 =p r r0 \PGF\
(
1 \=( p 2 p9)\ ø r 0 \PGF\
]r
(1
2(
p
k dp9 p
k ( p) dp9 exp
\=p9\
r( p) 5 A exp
(
(
]r ( p 2 p0 (z)) ]p \r \
5 rk 5
1 2
]r DS 1 ]p u, p
p
dk dp9
pr
(14)
E
p
k ( p) dp9,
pr
r*(S, u, p) 5 A21r(S, u, p r ) exp
(15a)
E
p
dk dp9,
(15b)
pr
.
1 , c2
Du 1 rkDp, S, p
E
where p r is an arbitrary reference pressure, and (9)
(10)
(11)
where k is the adiabatic compressibility and c is the speed of sound in seawater, we observe that the errors E 2 and E 3 are directly related to the compressibility (or, alternatively, to the sound speed). Similarly, the Boussinesq error E1 is largely associated with compressibility, since any vertical density difference in the water column may be written as
1 2
E E
5 r( p)r*(S, u, p),
]F ]r ( p 2 p0 (z)) ]r ]p
u, S
]r Dr 5 ]p
(13)
where k (p) is dependent on pressure only and dk is the residual, termed the thermobaric compressibility. As seen in Sun et al. (1999), dk is at least an order of magnitude smaller than k (p) or k. There is some arbitrariness in choosing k (p) , however. In view of (11) and (13), the density may be written as
5 r(S, u, p r ) exp
Noting that
1]p2
k 5 k (p) 1 dk,
pr
=
\ r 2 r9\ ø \r\
Following Sun et al. (1999), we observe that compressibility may be split into two terms:
(8)
is the dynamic error considered by Dewar et al. (1998). The density error is simply
E2 5
2. Modified density, pressure, and equation of state
pr
is the Boussinesq error, and
E3 5
and the last term dominates for a density difference over the entire column. Therefore, since these errors are directly related to the compressibility, the lower the compressibility (i.e., the ‘‘stiffer’’ the equation of state) the smaller the errors. In the following we will show how to transform Eqs. (1)–(3) into equivalent forms that effectively make use of a much stiffer equation of state before making the approximations (4)–(5), thereby resulting in much smaller errors.
r 5 r(S, u, p r ) exp
(
r ø 12 r0
VOLUME 31
where A( p) is a function of pressure only, which we will subsequently use to appropriately modify the factor r( p). Thus, the density may be expressed as the product of two factors, a factor r( p) that contains most of the pressure dependence and a factor r* that is only weakly dependent on pressure. As a result, r* will be very nearly independent of depth, much more so than the density r itself. In Sun et al. (1999), r* is called the ‘‘virtual potential density,’’ although here we prefer to call it the thermobaric density due to its direct dependence on the thermobaric compressibility dk. We now define an associated quantity, called the thermobaric pressure p*, through the relationship p*( p) 5
(12)
E
p
0
which results from integrating
dp9 , r( p9)
(16a)
JULY 2001
1917
NOTES AND CORRESPONDENCE
FIG. 1. Global mean in situ temperature and salinity from the Levitus et al. (1994a,b) climatology, and the associated potential temperature from the Bryden (1973) algorithm.
dp* 1 5 . dp r( p)
(16b)
We may expect that the pressure function p*( p) is invertible in general so that we can alternatively write p 5 p(p*). Given (14) and (16), an ocean model may alternatively be expressed in terms of r* and p*, rather than r and p. Equations (1)–(3) then become 1 PGF 5 =p*, r*
(17)
]p* 5 2r*g, ]z
(18)
and
r* 5 r(S, u, p( p*))/r( p*) 5 r*(S, u, p*),
The approximations corresponding to (4) and (5) may now be introduced to obtain PGF ø
where this is the modified equation of state. Note that these equations retain their original form, although the functional relationship of the equation of state is modified. In fact, as we will see, this modification serves to ‘‘stiffen’’ the equation of state. The equations are exact at this point; there is no approximation.
(20)
and
r* ø r*(S, u, p*(z)). 0
(21)
We have already shown that the error due to these approximations is directly related to the magnitude of the adiabatic compressibility. The effective compressibility associated with the equation of state (19) is
r*k* 5 (19)
1 =p* r0
1]p*2 ]r*
u, S
1
5 r dk 2
5
[1 2 1 ]r r ]p
2
2
u, S
d lnA # rdk, dp
]
r dr dp r 2 dp dp* (22)
where we have made use of (11) and (15a). Noting that dk is at least an order of magnitude smaller than k, the modified equation of state (19) is at least an order of
1918
JOURNAL OF PHYSICAL OCEANOGRAPHY
VOLUME 31
FIG. 2. The self-consistent density and pressure associated with the global mean Levitus et al. (1994a,b) climatology, obtained using the Jackett and McDougall equation of state and the Bryden algorithm.
magnitude stiffer with respect to changes in thermobaric density than is the original equation of state (3) with respect to changes in in situ density. Therefore, the error associated with the above approximations will also be at least an order of magnitude smaller. Also, note that we can use the degree of freedom provided by A to make k* vanish along some curve in the ‘‘phase space’’ of S, u, and p, thereby further reducing the compressibility in some desired region of phase space. We will make good use of this possibility in what follows. How feasible is it to make such a change in variables? Most ocean codes make use of the Boussinesq approximation. A Boussinesq code is particularly simple because it is unchanged if r is replaced by r* and p by p*, except for the equation of state (and possibly in some of the parameterizations where in situ density or pressure may be required, but notably not in the convective adjustment parameterization). The equation of state must be changed from (3) or (5) to (19) or (21). However, this is a very minor change that entails no change in the structure of the code. If the in situ density or pressure is required for diagnostic or parameterization purposes, or in the continuity equation of a non-Bous-
sinesq code, then it is a simple matter to make the conversion using (14) and (16a). 3. Specific example We will now describe the implementation of these ideas in the Parallel Ocean Program (POP), a Boussinesq, z-coordinate code based on the Bryan–Cox model (Dukowicz and Smith 1994; further information available online at http://www.acl.lan.gov/climate/models/ pop). We will optimize the transformation described previously around the global mean climatology of Levitus et al. (1994a,b). Figures 1a,b show the vertical profiles of global mean in situ temperature and salinity from this climatology, as a function of depth in the depth range from 0 to 5500 m. These profiles (or a ‘‘cast’’) are defined as T(z) and S(z), respectively. Because in situ temperature is provided, we use the Bryden (1973) algorithm to convert to potential temperature. The corresponding potential temperature is shown in Fig. 1a. Given these profiles, self-consistent density and pressure as a function of depth were obtained by integrating the hydrostatic equation (2) using Mathematica. The inte-
JULY 2001
1919
NOTES AND CORRESPONDENCE
Ideally, we would like to choose r( p) so that k* is as small as possible in order to minimize the approximation errors, as discussed previously. One way of doing this is to enforce k* 5 0 along the global mean cast since then departures will be minimized. According to (22), this will be true if
1 2
1 d 1 ]r r( p) 5 r( p) dp r ]p
(24)
u, S
along the cast, or where S 5 S( p) and u 5 u (p). This is an ordinary differential equation that is easily integrated using Mathematica and the JMcD equation of state. Since r( p) is undetermined to within a constant factor, we have chosen to normalize it so that r(z 5 3000) 5 r (z 5 3000)/r 0 , where r 0 5 1 gm cm 23 , in order that the thermobaric density be equal to r 0 at a depth of 3 km. The scaling factor r( p) is plotted in Fig. 3, but as a function of depth instead of pressure for convenience in comparing it with density. It is apparent that it effectively captures the bulk of the effect of compressibility on the density. The scaling factor may be fitted by r F ( p) 5 1.02819 2 2.93161 3 1024 exp(20.05p) 1 4.4004 3 1025 p,
FIG. 3. The density scaling factor r ( p) plotted as a function of depth, and the in situ density, overlaid for comparison.
gration is carried out with g 5 9.806 m s 22 , the JMcD equation of state, the Bryden (1973) algorithm, and assuming that pressure equals zero at the surface. The resulting profiles are denoted by r (z) and p(z), and are plotted in Figs. 2a,b respectively. We note that the pressure is nearly proportional to the depth so that it is always possible to invert this functional relationship and express depth as a function of pressure; that is, z 5 z( p). This means that we may alternatively express any quantity along the cast as a function of pressure rather than depth, that is, T( p), S( p), r ( p), u (p). Because the cast is representative of the entire ocean, it is convenient to take p 0 (z) 5 p(z) as the depth-to-pressure conversion function. A simple fit to this function is p0 (z) 5 0.059808[exp(20.025z) 2 1] 1 0.100766z 1 2.28405 3 1027 z 2 ,
(23)
where the pressure is in bars and depth is in meters. The error of the fit is in the range {20.03 ↔ 0.02} bars over the depth range from 0 to 5500 m.
(25)
where the pressure p is in bars, with an error in the range {21 3 10 24 ↔ 2 3 10 24 } over the pressure range from 0 to 560 bars. Note that both fits, (23) and (25), were chosen so that the error is constrained not to grow excessively outside the fitted range. Equations (23) and (25) are all that we need to implement both the transformation and the approximate conversion of pressure to depth. In order to get a feel for the error resulting from the spread of ocean states around the fitted mean, we make use of the data from Levitus et al. (1994a,b) for the mean temperature and salinity in the North and South Pacific, the North and South Atlantic, and the North and South Indian Oceans, for a total of six representative datasets. The corresponding self-consistent density, pressure, and potential temperature were obtained as described previously for the global mean dataset. In Fig. 4a we plot the thermobaric density, obtained from (19), for each of the datasets. We observe that thermobaric density may be approximated by r 0 5 1 gm cm 23 with an error of about 0.5%, about an order of magnitude smaller than previously. The error is largely concentrated within the thermocline, that is, within the upper one or two kilometers. Figure 4b shows the thermobaric density error, calculated as E2 5
rJMcD (S, u B (S, T, p), p) r( p) 2
rJMcD (S, u B (S, T, p0 (z)), p0 (z)) . r F ( p0 (z))
(26)
1920
JOURNAL OF PHYSICAL OCEANOGRAPHY
VOLUME 31
FIG. 4. Thermobaric density as a function of depth, and the associated density error due to the use of the approximate depth-to-pressure conversion function, for six representative temperature and salinity profiles from the Levitus (1994) climatology.
where rJMcD represents the density calculated with the JMcD equation of state and u B represents the potential temperature calculated from the Bryden conversion algorithm. We note that the maximum error is less than about 3 3 10 27 gm cm 23 . This is more than an order of magnitude smaller than the rms error in the international equation of state or the maximum error of the JMcD fit (5 3 10 26 and 6.7 3 10 26 gm cm 23 , respectively, according to JMcD). It is also about three orders of magnitude smaller than the density error in current models estimated in the introduction. Unfortunately, it is not possible to easily evaluate the improvement in the dynamic error, E 3 , which is problem dependent. However, as is obvious from the definitions in the introduction, both the dynamic and the density errors are directly related to the magnitude of the density perturbation and, therefore, if the density error vanishes then so does the dynamic error. Furthermore, since both these errors are directly related to the magnitude of the adiabatic compressibility, it is clear that if the compressibility is reduced by a constant factor then both errors are reduced by the same factor, all other things
being equal. It is to be expected, therefore, that if the density error is reduced because compressibility is made smaller, then the dynamic error will be correspondingly reduced. The implementation of this method in the POP code is straightforward. The equation of state routine is called to obtain the in situ density, r 5 r (S, u, p 0 (z)), rather than the thermobaric density. Thus, this routine is unchanged except for the use of (23) to convert depth to pressure. This is done to minimize changes in the code and also in case the in situ density is required for other purposes. The biggest change is to the hydrostatic equation, which is solved in the form ]p* rg 52 ]z r( p0 (z))
(27)
to compute the thermobaric pressure in place of the true pressure. The momentum equation is left unchanged and it thus effectively computes the pressure gradient as given by (20). The true pressure p is never calculated because it is not used elsewhere in the code.
JULY 2001
1921
NOTES AND CORRESPONDENCE
4. Summary Many existing ocean codes make certain simplifying approximations based on the fact that the adiabatic compressibility of seawater is rather low. However, the error associated with these approximations is not negligible and can have significant dynamic consequences, as detailed in Dewar et al. (1998). We demonstrate that it is possible to greatly reduce the error by transforming to an equation of state with a much smaller compressibility, expressed in terms of new state variables termed the thermobaric density and pressure, before making these approximations. The error in the thermobaric density obtained from the transformed equation of state due to these approximations is within the uncertainties in the equation of state itself. The dynamic error studied by Dewar et al. (1998) is directly related to the density error, and it should be reduced by at least an order of magnitude by means of the present method. The present method is particularly simple for a Boussinesq model and the resulting code changes are minimal. Acknowledgments. This work was made possible by the support of the DOE CCPP (Climate Change Prediction Program) program.
REFERENCES Bryden, H. L., 1973: New polynomials for thermal expansion, adiabatic temperature gradient and potential temperature of seawater. Deap-Sea Res., 20, 401–408. Cox, M. D., 1984: A primitive equation three-dimensional model of the ocean. GFDL Ocean Group Tech. Rep. No. 1, NOAA/GFDL, Princeton University, 250 pp. Dewar, W. K., Y. Hsueh, T. J. McDougall, and D. Yuan, 1998: Calculation of pressure in ocean simulations. J. Phys. Oceanogr., 28, 577–588. Dukowicz, J. K., and R. D. Smith, 1994: Implicit free-surface method for the Bryan–Cox–Semtner ocean model. J. Geophys. Res., 99, 7991–8014. Fofonoff, N. P., and R. C. Millard Jr., 1983: Algorithms for computation of fundamental properties of seawater. UNESCO Marine Science Tech. Paper 44, 55 pp. Jackett, D. R., and T. J. McDougall, 1995: Minimal adjustment of hydrographic profiles to achieve static stability. J. Atmos. Oceanic Technol., 12, 381–389. Levitus, S. and T. P. Boyer, 1994b: World Ocean Atlas 1994, Vol. 4: Temperature, NOAA Atlas NESDIS 4, U.S. Dept. of Commerce, 117 pp. ——, R. Burgett, and T. P. Boyer, 1994a: World Ocean Atlas 1994, Vol. 3: Salinity, NOAA Atlas NESDIS 3, U.S. Dept. of Commerce, 99 pp. Semtner, A. J., Jr., 1986: Finite-difference formulation of a World Ocean model. Advanced Physical Oceanographic Numerical Modelling, J. J. O’Brien, Ed., D. Reidel, 187–202. Sun, S., R. Bleck, C. Rooth, J. Dukowicz, E. Chassignet, and P. Killworth, 1999: Inclusion of thermobaricity in isopycnic-coordinate ocean models. J. Phys. Oceanogr., 29, 2719–2729.