Well it is really important topic, so here is my 2c.

All is your grid, problem to solve related question. For example if you want to do internal tides or tides only

than you will look at the some spectral lines and currents that are generated because of HPGE (horizontal pressure gradient errors) are filtered out.

You want to have as real as possible bathy (tides sensitive) so smooth as less as possible.

Another example is when doing long simulations and getting residual circulation, than you have to be veeerrrrryyy careful, because HPGE currents are low mode (adding a lot to the mean circulation).

For strict definition use the source Luke;

src/ROMS/Utility/stiffness.F

there you will find out really nicely commented

what it is.

You can think of rx0 as "only the bottom slope measure"

Code: Select all

```
my_rx0=MAX(my_rx0,ABS((z_w(i,j,0)-z_w(i-1,j,0))/ &
& (z_w(i,j,0)+z_w(i-1,j,0))))
```

However,

rx1 is the real one, playing when your model crash, it is 3D:

Code: Select all

```
DO k=1,N(ng)
my_rx1=MAX(my_rx1,ABS((z_w(i,j,k )-z_w(i-1,j,k )+ &
& z_w(i,j,k-1)-z_w(i-1,j,k-1))/ &
& (z_w(i,j,k )+z_w(i-1,j,k )- &
& z_w(i,j,k-1)-z_w(i-1,j,k-1))))
END DO
```

So, what I mean is, if you use many vertical levels, really bounded to say surface or bottom (even more effect on HPGE) than you'll get different stiffness --

rx1, you can play with that (use say 30 levels and see what it is, then use 20 levels and see how

rx1 decreased). As Kate said, pressure gradients on the sigma, you can increase it with strong density gradients as well.

What I do, and would recommend to everyone, is to setup grid and check it before:

1) compute vertically stable

profile of temp and salt for the domain you are running, horizontally homogeneous

, hence not producing any density gradients. In other words, create ana vertical profile for temp and salt in a similar way as is done for many examples in ana_initial.h . In that way if you start your simulation WITHOUT any forcing

the ocean should stay (not exactly, diffusion etc, but lets pretend it does, with big confidence) in stable state, you have only vertically stable stratified density, not producing any velocity (because there are no density gradients). However we are not on z grid and there is a sigma slope so you will have effects of *HPGE*, which are direct consequence of "bad"

rx1.

In that way you can see what is the effect of "bad bathymetry and big

rx1" and where it is introducing artificial currents because of HPGE.

Usually look at the bottom, where pressure builds up.

2) I identify those regions (i.e. using magnitude of velocity) and create weight factor for smoothing, big magnitude big weight. You want to smooth only there where you have big errors from HPGE, and keep as close as possible to real bathy. After smoothing you get new bathy, run the same case again and compute magnitude again, do that in a iterative way until you are happy. In my case I have to run model for a week to get to steady state with "HPGE" currents that are not changing any more.

There are many papers dealing with smoothing bathy in the "s" coordinate models, Mathieu wrote one with some examples and LP technique;

Sikirić, M.D., Janeković, I. and Kuzmić, M., 2009. A new approach to bathymetry smoothing in sigma-coordinate ocean models. Ocean Modelling, doi:10.1016/j.ocemod.2009.03.009

Good luck!

Ivica