Modified (hyper-)viscosity for coarse-resolution ocean models
Abstract
We present a simple parameterization for coarse-resolution ocean models. To replace computationally expensive high-resolution ocean models, we develop a computationally cheap parameterization for coarse-resolution models based solely on the modification of the viscosity term in advection equations. It is meant to reproduce the mean quantities like pressure, velocity, or vorticity computed from a high-resolution reference solution or using observations. We test this new parameterization on a double-gyre quasi-geostrophic model in the eddy-permitting regime. Our results show that the proposed scheme improves significantly the energy statistics and the intrinsic variability on the coarse mesh. This method shall serve as a deterministic basis model for coarse-resolution stochastic parameterizations in future works.
1 Introduction
Ocean general circulation models used at climatic scales are limited for evident computational reasons to too coarse horizontal resolutions to solve correctly ocean mesoscale and sub-mesoscale eddies, even with large computational infrastructure. The horizontal resolution of the most recent climatic ocean models is of the order of the Rossby radius of deformation. These models are hence in the so-called eddy-permitting regime and they can solve partially the mesoscale (i.e. 10-100 km) eddy field. These models however suffer from strong limitations. In particular, they are unable to reproduce accurately large-scale structures such as the eastward turbulent jet in an idealized double-gyre configuration.
Recent parameterizations have shown significant improvements in coarse-resolution models compared to high-resolution reference solutions [3]. However, it remains an important topic of research, as the actual generation of parametrizations is not completely able to resolve the effects of the unresolved scales on the large-scale flow structures.
A wide range of subgrid parametrizations relies on eddy viscosity such as Laplacian and biharmonic schemes [17, 11, 5, 4]. It has been shown in [10] that including only these (hyper)viscosity in coarse-resolution models often causes too much dissipation and results in an artificial energy sink at large scales. In general, even eddy-permitting models are not energetic enough and as a result, the long-time average of any coarse model’s variable of interest departs completely from the long-time average of high-resolution models subsampled at the same scale. This becomes the main motivation of the present work. In particular, we would like to answer the following question: how can we reduce the excessive resolved kinetic energy loss due to the viscosity while simultaneously ensuring numerical stability?
We propose a simple affine parameterization of (hyper)viscosity. The (bi)laplacian operator is replaced by , where is a field of same dimension as that does not depend upon time. We interpret this method as a mathematical regularization technique to guide the solutions towards prior information. We frame as the solution of an optimal control problem to reproduce statistics computed from a reference solution or observations. We present a method to solve this optimal control problem.
We test the proposed method with an idealized double-gyre configuration. For that purpose, we release with this article a fast, concise, and CPU-GPU portable Pytorch implementation of a multi-layer quasi-geostrophic model on a rectangular domain. We implement and test our optimization procedure within this setting.
2 Double gyre quasi-geostrophic model
2.1 Governing equations
We use the same multi-layer quasi-geostrophic model in a non-periodic rectangular domain as in [7]. Here, we only give a brief review of this system. The quasi-geostrophic pressure and potential vorticity (PV) are stacked in three isopycnal layers. We adopt vector forms to denote the layered pressure and potential vorticity (PV):
The forced and damped quasi-geostrophic (QG) equations can be then written as
(1) | |||
(2) |
where denotes the horizontal Laplacian, the bi-laplacian operator, stands for the Jacobi operator, is the Coriolis parameter under beta-plane approximation with the meridional axis center , and are the Laplacian and biharmonic viscosity coefficients. Parameters of the configuration are listed in the Tables 1 and 2 in Appendix. Besides, the second term on the right-hand side of equation ((1)) represents the external forcing applied on different layers. In this work, we only consider an idealized case in which the ocean basin is driven by a stationary and symmetric wind stress on the surface and by a linear Ekman stress at the bottom. In that case, the forcing term can be specified by
where is the magnitude of surface wind, is the background thickness of layer , and is the bottom Ekman layer thickness. The vertical stratification level of such a model is described by the term in Equation (2) with
where is the reduced gravity defined across the interface between layers and . A multi-layered generalization of this model can be found in [6]. Note also that such a multi-layered model can be considered as a vertical discretized approximation of the continuously stratified QG system [18] with approximated by finite differences, and in which denotes the buoyancy (or Brunt-Vaisala) frequency.
2.2 Pytorch implementation
To facilitate numerical developments and benefit from built-in automatic differentiation, we develop a Pytorch [13] implementation of the above-described multilayer QG model 111Available at https://github.com/louity/qgm_pytorch. For this purpose, we follow rigorously the strategy of [8]:
-
1.
we use a regular numerical grid with finite differences
- 2.
-
3.
We apply a vertical change of coordinate to equation (2) which becomes a set of three inhomogeneous Helmholtz equations. We solve these equations with the spectral Discrete Sine Transform (DST) method, and we add corresponding homogeneous Helmholtz equation solutions to ensure mass conservation.
-
4.
We update the boundary values of the potential vorticity using equation (2).
Detailed equations and numerical routine design choices can be found in [8]. We use a Heun-Runge-Kutta 2 time-stepping instead of the Leap-Frog time scheme used by [8].
For sake of numerical efficiency, we follow the recommendation of [15]: we compile computationally demanding routines and simplify finite difference calculations by reducing as much as possible the number of multiplications. We end up with a very concise code (less than 300 lines) that only depends upon Numpy and Pytorch libraries. This implementation will be open-sourced at the time of the publication.
2.3 Eddy-resolving and eddy-permitting regimes
We consider two spatial settings for our simulations :
-
1.
The eddy-resolving regime, our high-resolution reference with a 5 km resolution.
-
2.
The eddy-permitting regime, our low-resolution setting with a 40 km resolution.
Parameters for these two different regimes are written in table 2 in Appendix.
[16] studied the resulting flows’ differences between these two regimes. The high-resolution eddy-resolving model shows a well-pronounced eastward jet fuelled by mesoscale eddies circulating while the low-resolution eddy-permitting model does not induce a proper eastward jet as shown on Fig. 1. Temporal statistics significantly differ between high- and low-resolution simulations.

3 Proposed modified viscosity
3.1 Motivation
In both resolutions, we use biharmonic viscosity as in [17, 11, 5, 4] essentially because it is less dissipating at large scales than a Laplacian. Compared to the usual Laplacian viscosity, it preserves large-scale structures. However, hyperviscosity remains much too dissipative in the “eddy-permitting” regime [10]. This too strong dissipation kills the eastward jet that is present in the high-resolution and that we expect to see in such a double-gyre quasi-geostrophic model. Fig. 2 shows a sequence of snapshots of the low-resolution models where we input a downsampled snapshot of the high-resolution (see Appendix for details on downsampling). After as few as three years, the eastward jet has almost disappeared, showing that the model is too dissipating. Lowering the hyper-viscosity coefficient by a factor of 10 does not solve this problem, and creates spurious gradients in the potential vorticity as shown in Fig. 2. These numerical artifacts are due to a bad representation of the direct enstrophy cascade, causing a piling up of the small-scale vorticity gradients at the cut-off frequency together with aliasing effects.

3.2 Modified viscosity
Here we propose a simple affine modification parameterization of hyperviscosity. We add a bias to the term in eq. (1), which becomes where is a dimensional field that does not depend upon time. The PV advection equation with hyperviscosity becomes
(3) |
The elliptic equation (2) remains unchanged.
The goal of this additional term is to reproduce a relevant time-average pressure field relying on observations or high-resolution solutions. For example the high-resolution average can be downsampled to the targeted coarse grid resolution in , and we want the average of the modified low-resolution model to be as close as possible to the high-resolution reference .
We face here an optimal control problem, as the low-resolution average is a function of the control parameter . We state it with the following least-square formulation
(4) | ||||
(5) |
This optimization problem is a priori non-convex and we shall not expect to find a global optimum. In the following, we propose a numerical procedure to find a heuristic of the optimal solution .
Computationally, the implementation of this modified hyperviscosity is simple and computationally cheap. We precompute and subtract it from at each time-integration step. It increases the integration time of the advection equation (1) by less than 1% on CPUs and GPUs.
3.3 Modified viscosity regularization
The continuously stratified QG equations can be rewritten in a variational formulation [9] with a Hamiltonian defined as
Our model is a discretized version of the continuous stratification. Since we add an external wind forcing term and we use an energy conservative Arakawa advection scheme, we need to add some viscosity or hyperviscosity to dissipate energy. In a variational formulation, these (hyper-)viscous terms become the following penalization
added to the Hamiltonian to produce a smooth solution. The Gradient norm penalization of Laplacian guides the minimization toward solutions of smooth Laplacian. Hyperviscosity corresponds to the Laplacian norm penalization and enforces a solution of minimum Laplacian norm. The parameters and quantify the strength of these regularization constraints.
Here, we simply propose to replace it with the following penalization
We now penalize instead of , meaning that we guide the solution to a possibly non-smooth reference that will produce the correct large scale behavior.
3.4 Iterative procedure
Here we present a method to find a solution to the optimization problem (4). A natural guess for is . We solve the equations and compute the average pressure . Results are shown in Fig. 4. It is a good first-guess, but the difference is still large.
We propose the following iterative procedure to find a better guess for . In the following we assume that we are in low resolution, i.e. and unless explicitly written.
- •
-
•
Choose .
-
•
Start with .
-
•
Evolve the ensemble for years and compute the corresponding average pressure with ensemble average.
-
•
For :
-
–
Set .
-
–
Evolve the ensemble for years and compute new average pressure .
-
–
-
•
return and
There is no theoretical guarantee that this procedure converges, but we observe in the next section that it converges with the double-gyre QG model that we use.
4 Results and discussion
4.1 Statistics
We use ensemble averages to compute the statistics. To create ensembles of size , we start from a zero solution and spin up the models for 100 years with a timestep of 1200 seconds to reach statistically steady states as in [14]. Then we run the models for 500 years and save 10 snapshots a year to get 5000 snapshots, and we randomly select snapshots out of these 5000 snapshots. The ensemble averages are simply average over these ensemble members that we evolve in parallel. Such ensemble averages are denoted with in the following, i.e. the average pressure is denoted by , average velocity by , etc.
4.2 Iterative procedure

We test the iterative procedure described in section 4.2 with the double-gyre model presented in section 2 in the eddy-permitting regime. We use years to evolve the ensemble after each iterate. We compute the reference pressure average with the same model in the eddy-resolving regime.

Fig. 3 shows the relative square error at iterations of the procedure with and . The procedure converges with and oscillates with .

Fig. 4 shows the output average pressure of the iterative procedure, the reference and the difference between the two, as well as for zonal velocity . Our model can reproduce the eastward jet produced by the high-resolution reference model. Kinetic energy spectra shown on Fig. 5 shows also the improvement of our model compared to low-resolution. Finally, Fig. 6 shows high-resolution and low-resolution snapshots as well as a snapshot of the proposed model at low-resolution. Our model effectively produces the eastward jet and a re-circulation zone around it where eddies are created. Artifacts can be also observed on the zonal velocity and potential vorticity on the right of Fig. 6. They can likely be Rossby waves created by the harmonic regularization terms, which remain an artificial constraint, but this needs to be studied further.

5 Conclusion
We presented a simple modified-viscosity scheme for coarse resolution ocean modeling that we derived and tested on a double-gyre multi-layer quasi-geostrophic model. We interpret it as a modified regularization technique that will guide the solution to a reference rather than producing a too smooth solution in the eddy-permitting regime. The technique requires solving an optimization problem, and we presented a procedure to find a good guess for the solutions. We showed that it converges to a reasonable solution that fairly reproduces the input reference.
If this method mimics the average of the high-resolution, it only reproduces partially the variability and higher-order statistics of the high-resolution. We see in Fig. 5 our model’s snapshots resemble the averages. In future works, we consider using this method as a deterministic basis for stochastic parameterizations such as Location-Uncertainty [12].
Acknowledgments
The authors acknowledge the support of the ERC EU project 856408-STUOD.
Appendix
Downsampling procedure
Downsampling the high-resolution solution on a low-resolution grid consists of interpolating the high-resolution (769 961) streamfunction on the low-resolution (97121) grid. Then we can compute the potential vorticity using equation (2). Because of the no-flow constraint, the downsampled streamfunction should be constant on the boundaries and should satisfy a mass conservation constraint [8]. We also want to preserve the frequency information and prevent aliasing.
Parameter tables
Parameters | Value | Description |
---|---|---|
km | Domain size | |
m | Mean layer thickness | |
m s-2 | Reduced grativity | |
m | Bottom Ekman layer thickness | |
m2 s-2 | Wind stress magantitude | |
m2 s-1 | Laplacian viscosity coefficient | |
s-1 | Mean Coriolis parameter | |
(m s)-1 | Coriolis parameter gradient |
Grid dimensions | Resolution | Timestep | Hyperviscosity () |
---|---|---|---|
769 961 | km | s | m4 s-1 |
97 121 | km | s | m4 s-1 |
References
- [1] Arakawa, Akio and Lamb, Vivian R (1981), A potential enstrophy and energy conserving scheme for the shallow water equations. Monthly Weather Review 109:18–36.
- [2] Fox-Kemper, B and Menemenlis, D (2008), Can large eddy simulation techniques improve mesoscale rich ocean models?. Washington DC American Geophysical Union Geophysical Monograph Series 177:319–337.
- [3] Fox-Kemper, B and Bachman, S and Pearson, B and Reckinger, S (2014), Principles and advances in subgrid modelling for eddy-rich simulations. CLIVAR Exchanges No. 65, Vol. 19, No. 2.
- [4] Frisch, Uriel and Kurien, Susan and Pandit, Rahul and Pauls, Walter and Ray, Samriddhi Sankar and Wirth, Achim and Zhu, Jian-Zhou (2008), Hyperviscosity, Galerkin truncation, and bottlenecks in turbulence. Physical review letters 101:144501.
- [5] Griffies, Stephen M and Hallberg, Robert W (2000), Biharmonic friction with a Smagorinsky-like viscosity for use in large-scale eddy-permitting ocean models. Monthly Weather Review 128:2935–2946.
- [6] Hogg, Andrew Mc C and Dewar, William K and Killworth, Peter D and Blundell, Jeffrey R (2003), A quasi-geostrophic coupled model (Q-GCM). Monthly Weather Review 131:2261–2278.
- [7] Hogg, Andrew Mc C and Killworth, Peter D and Blundell, Jeffrey R and Dewar, William K (2005), Mechanisms of decadal variability of the wind-driven ocean circulation. Journal of physical oceanography 35:512–531.
- [8] Hogg, AM and Blundell, JR and Dewar, WK and Killworth, PD (2014), Formulation and users’ guide for Q-GCM, http://q-gcm.org/downloads/q-gcm-v1.5.0.pdf.
- [9] Darryl D. Holm, Vladimir Zeitlin (1998), Hamilton’s principle for quasigeostrophic motion. Physics of fluids 10(4):800–806.
- [10] Jansen, Malte F and Held, Isaac M (2014), Parameterizing subgrid-scale eddy effects using energetically consistent backscatter. Ocean Modelling 80:36–48.
- [11] Leith, CE (1996), Stochastic models of chaotic systems. Physica D: Nonlinear Phenomena 98:481–491.
- [12] Mémin, Etienne (2014), Fluid flow dynamics under location uncertainty. Geophysical & Astrophysical Fluid Dynamics 108:119–146.
- [13] Paszke, Adam and Gross, Sam and Massa, Francisco and Lerer, Adam and Bradbury, James and Chanan, Gregory and Killeen, Trevor and Lin, Zeming and Gimelshein, Natalia and Antiga, Luca and others (2019), Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems 32:8026–8037.
- [14] Ryzhov, EA and Kondrashov, D and Agarwal, N and McWilliams, JC and Berloff, P (2020), On data-driven induction of the low-frequency variability in a coarse-resolution ocean model. Ocean Modelling 153:101664
- [15] Roullet, Guillaume and Gaillard, Tugdual (2021), A Fast Monotone Discretization of the Rotating Shallow Water Equations, ESSOAR/JAMES.
- [16] Shevchenko, IV and Berloff, PS (2015), Multi-layer quasi-geostrophic ocean dynamics in eddy-resolving regimes. Ocean Modelling 94:1–14.
- [17] Smagorinsky J. (1963), General circulation experiments with the primitive equations. Monthly weather review 91.3:99-164.
- [18] Vallis, G. K. (2017), Atmospheric and oceanic fluid dynamics: fundamentals and large-scale circulation. Cambridge University Press.