stiffness number for rx0 and rx1

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

stiffness number for rx0 and rx1

#1 Post by tony1230 » Tue Feb 26, 2013 6:56 am

After i searched in this forum on "rx0" and "rx1", i can not understand how they affect the roms run.

As Kate said viewtopic.php?f=1&t=2421&hilit=rx1#p9011, the rx1 is bigger than 14, but want the rx0 approaching 0.4. And Mark may want rx0 to ~ 0.2 viewtopic.php?f=14&t=2796&hilit=rx1#p10492. So what info i can get is that it would be better if the rx0 fall into the range of 0.2~0.5. When i back-checked my application,wow :o , rx0 = 0.93. I did not run into any blow up, but do not comfirm if there any irrational exists.

As Mark said viewtopic.php?f=14&t=2819&p=10632&hilit=rx1#p10632, rx1 should be in the vicinity of 5~8. But in this thread, the author still faild with rx1 = 7.32 and figured out with tuning the bottom stresses. In one of my application, i use rx1 ~ 50.0.

And in some other threads, e.g. viewtopic.php?f=1&t=2731&hilit=rx1#p10200 rx0 = 1.0 and rx1 = 39.0, no one paid attention to them.

So, as mentioned above, it seems to me that the rx0 and rx1 can use a much bigger range of values as we were told in the forum. Acturally, i can not tell how they influence the model results and what values be used under kind of situations. If someone expert who can clearify this question, i would be no more than happy.

- Shou

User avatar
kate
Posts: 3780
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: stiffness number for rx0 and rx1

#2 Post by kate » Tue Feb 26, 2013 5:35 pm

I have looked more consistently at the rx0 numbers than the rx1 numbers. According to Sasha, I am routinely running with "insane" values of rx1. As for rx0, in the old days, the pre-ROMS version of the model would blow up with values I can now comfortably run at. There is much literature on the pressure gradient problem, so I suggest you look there for your answers as to the kinds of troubles that crop up with too-steep bathymetry, notably:
Shchepetkin, A. F., and J. C. McWilliams, 2003: A method for computing horizontal pressure-gradient force in an oceanic model with a nonaligned vertical coordinate, J. Geophys. Res., 108 (C3), 3090, doi:10.1029/2001JC001047.
PDF Also, the papers it refers to.

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: stiffness number for rx0 and rx1

#3 Post by jivica » Wed Feb 27, 2013 9:23 am

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

uranoscopus
Posts: 26
Joined: Sat Mar 17, 2012 4:54 pm
Location: CNR - IAMC
Contact:

Re: stiffness number for rx0 and rx1

#4 Post by uranoscopus » Thu Feb 28, 2013 1:44 pm

Dear Ivica and all.
I have some trouble with my rx0. I smoothed the grid as initially I've got 0.9 of rx0. It now fall to 0.3. But, without changing grid or vertical levels, but only the configuration (ana forcing, boundaries etc) I saw my rx0 coming back to somthing like 0.9. Is this possible?
What is z_w in the computation of rx0?
Thanks in advance,
Antonio

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: stiffness number for rx0 and rx1

#5 Post by jivica » Thu Feb 28, 2013 2:41 pm

I am afraid I do not follow you;
If you for example copy your original roms grid to say new_grid.nc (in order to have original to compare with) and than smooth variable h and put it back inside that new file.
Than in ocean.in you have to change GRDNAME to point to the new_grid.nc;
run roms and check for rx0 and is it using right grid file.
z_w are depths of model layers or thickness of your layers, should read roms wiki there you have all info you need

https://www.myroms.org/wiki/index.php/N ... retization
https://www.myroms.org/wiki/index.php/V ... coordinate

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: stiffness number for rx0 and rx1

#6 Post by tony1230 » Fri Mar 01, 2013 6:39 am

Thank you for all the replies.

Yes, as Ivica pointed out, these two variables are much important because they not only affect the model stablity, but also related with HPGE which may induce tricky/incredible current velocities.
You want to have as real as possible bathy (tides sensitive) so smooth as less as possible.
In one of my real applications, there are many big and small passages for tides and currents to in and out which usually with big slope on depth. The problem is i can not smooth these deep-narrow patches as they are the main ways for flow movements. But if this is the case, i may not comfirm what magnitude of velocity would be produced by HPGE.
Another example is when doing long simulations and getting residual circulation, than you have to be veeerrrrryyy careful,...
How should i do if i want to get more reality residual flow? I know the HPGE would produce velocities though they are small in magnitude, they will affect the residual currents on a notable level.

With regard to Ivica's recommendation, i can see a benefit on how to check the influence caused by HPGE, i.e. big slope bathymetry with big rx1.
..., 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.
You meant you would have to smooth the regions until the changing/irrational HPGE-currents gets stable state? I may not agree on this point of view. As i said, i have many deep slope waterways and they influence the currents/tides pattern in this region to a great degree, if i hell-bent smoothing the depth in order to reduce the HPGE currents, i may get a results beyond recognition.

- Shou

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: stiffness number for rx0 and rx1

#7 Post by jivica » Fri Mar 01, 2013 7:48 am

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

In one of my real applications, there are many big and small passages for tides and currents to in and out which usually with big slope on depth. The problem is i can not smooth these deep-narrow patches as they are the main ways for flow movements. But if this is the case, i may not comfirm what magnitude of velocity would be produced by HPGE.
As I said, run the model without any forcing from stable stratification and let it develop for a week or so, then check bottom velocities.
Another example is when doing long simulations and getting residual circulation, than you have to be veeerrrrryyy careful,...
How should i do if i want to get more reality residual flow? I know the HPGE would produce velocities though they are small in magnitude, they will affect the residual currents on a notable level.
Well it is tricky, at least you will know what is the noise introduced in the result simply because of HPGE,
you can try to use different bend/density of points in the narrow channels, use nested grids *(this was one of the solutions to for me)*.
With regard to Ivica's recommendation, i can see a benefit on how to check the influence caused by HPGE, i.e. big slope bathymetry with big rx1.
..., 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.

You meant you would have to smooth the regions until the changing/irrational HPGE-currents gets stable state? I may not agree on this point of view. As i said, i have many deep slope waterways and they influence the currents/tides pattern in this region to a great degree, if i hell-bent smoothing the depth in order to reduce the HPGE currents, i may get a results beyond recognition.
No, you should smooth ONLY :!: the regions where those HPGE currents are too big for you, in that case you'll reduce sigma level tilt, hence HPGE. In some applications I am happy with HPGE ~ 7cm/s, however in some cases I try to get them down to 1cm/s.

Be aware that roms is using the whole grid, even on the land, but then on every time step it zero it out, so if you have channel one grid point (or 2) wide that you can extrapolate depth over the land (if not using wet-dry) just to make life easier for roms ;) try to use smaller number of vertical levels, try to put them more in the surface, there are many tricks/tips that user is left to try. Afraid there is no easy answer, except to use finite element model like SELFE, FVCOM, getting small scale resolutions nested inside ROMS wider model, something like hybrid model approach for which I have feeling is a future. Some time ago I read about generalized vertical coordinate like in GOTM that could help a bit, but it is not available in the ROMS, hope yet.


Ivica

uranoscopus
Posts: 26
Joined: Sat Mar 17, 2012 4:54 pm
Location: CNR - IAMC
Contact:

Re: stiffness number for rx0 and rx1

#8 Post by uranoscopus » Fri Mar 01, 2013 9:04 am

jivica wrote:I am afraid I do not follow you;
If you for example copy your original roms grid to say new_grid.nc (in order to have original to compare with) and than smooth variable h and put it back inside that new file.
Than in ocean.in you have to change GRDNAME to point to the new_grid.nc;
run roms and check for rx0 and is it using right grid file.
z_w are depths of model layers or thickness of your layers, should read roms wiki there you have all info you need

https://www.myroms.org/wiki/index.php/N ... retization
https://www.myroms.org/wiki/index.php/V ... coordinate
Sorry Ivica,
I just realized how much was confused my previous message.
I was just wondering why, ONCE I smoothed my h in grid and obtained rx0 of about 0.3 it assumes values of 0.9 JUST changing BC (Closed to Periodic) in my test application (whithout ANY other change). This is weird to me. Maybe a bug?
Cheers,
Antonio

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: stiffness number for rx0 and rx1

#9 Post by tony1230 » Sat Mar 02, 2013 4:10 am

In some applications I am happy with HPGE ~ 7cm/s, however in some cases I try to get them down to 1cm/s.
Here is a question: how do i know that at what magnitude of velocity introduced by HPGE may satisfactory for a region :?: How to judge? Is there thumb rules?

Regards,
- Shou

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: stiffness number for rx0 and rx1

#10 Post by tony1230 » Thu Mar 07, 2013 1:11 am

I think this topic is still unsolved. Hope some of you to participate in. Thanks.

User avatar
kate
Posts: 3780
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: stiffness number for rx0 and rx1

#11 Post by kate » Thu Mar 07, 2013 1:46 pm

My unscientific method:

* smooth the bathymetry to rx0 of 0.4 or less.
* setup all the other components and if things don't look too weird, don't worry about the pressure gradients.

There are a lot of other things that can make the model results look weird or blow up or whatever and those are usually more dominant in my concerns.

rduran
Posts: 139
Joined: Fri Jan 08, 2010 7:22 pm
Location: Theiss Research

Re: stiffness number for rx0 and rx1

#12 Post by rduran » Fri Mar 08, 2013 1:52 am

depends on your application, if you want to do momentum balances for a current with typical velocities of 10 cm/s then 7 cm/s of PGE doesn't sound good.

A few 2 cent points to keep in mind:
  • less vertical levels means less convergence although it will help with PGE, there are a few parameters that affect PGE: search for hyrostatic consistency to learn more, in summery they are: total depth, bathymetry slope, sigma, dx and dsigma.

    less levels near bottom means less representation of what happens in bottom including BBL although that also helps with PGE (again see hydrostatic consistency).

    In my experience, realistic slopes are just too steep and deep for current models to represent well, and that is the way it is. current research by Robert Higdon at OSU suggests that discontinuous Galerkin method will make PGE disappear regardless of vertical coordinates, but in his words: "my work is largely theoretical at this point" (or something to that extent) ... so we have to wait and see (or contribute) until a satisfactory solution is found.

    there is a paper by Ezer, Arango and Shchepetkin comparing ROMS and POM, POM has a smaller PGE so that is also an option.

    if you run the PGE test with horizontally-constant vertically-stable stratification for more than a few days you also have to start asking things like: are there waves moving the signal around and coming back (specially with closed boundaries) to increase the error? is diffusion or advection coming into play? in other words: is it PGE error or PGE + stuff? how mush is stuff?
so in summary there is no way around asking yourself: what do I want and how can I achieve it?

best
Rodrigo

Post Reply