MITgcm
MITgcm copied to clipboard
[ENH] add eta to rbcs for nonlinear free surface
What changes does this PR introduce?
Draft for comment: obcs
allows setting etaH
, but I wanted an rbcs-type sponge, so I added this to rbcs.
This is potentially valuable for fjords and other embayments where we want to force the tide via sea surface height in a large receiving basin. I do this by adjusting the sponge in the receiving basin so that the surface wave is free in the fjord itself.
Does this PR introduce a breaking change?
No
Other information:
I have a simple version of a toy model that works with this at https://github.com/jklymak/FjordForce. That example could be simplified, its just a simulation I had that had a reasonable fjord with large receiving basin set up.
- [ ] Needs documentation
- [ ] Needs tests?
One thing I'm not clear on - for obcs they have a calculation for OBCS_APPLY_SURF_DR
. I wasn't clear if this was needed here, or because I was directly manipulating etaH
it would get calculated in CALC_SURF_DR
.
Thanks @mjlosch for taking a look. For my testing, did you run exp4.nlfs
as-is, or did you modify at all?
I just checked out the branch and ran ./testreport -t 'exp4.nlfs tutorial_reentrant_channel
with and without the -devel
option. I did this on my MacBook with gfortran. If you cannot reproduce that, I'll have a closer look.
Thanks - I can have a look in a few days.
Here's the problem: in rbcs_update_etah.F
there's a division by tauRelaxEta
without checking if it is zero or if useRBCeta
is true or not. I suggest to add an IF ( useRBCeta ) THEN
in that routine (or set rec_tauRlx=0.
if tauRelaxEta==0.
)
Thanks @mjlosch this passes that test report. I added an if statement to rbc_apply_eta.F
.
Happy to write a test for this setup.
@jklymak thanks for sharing your code.
I was supposed to look at this PR a long time ago but a little busy these days.
There are several things that I would need to check (including how this fit into time-stepping with various options) as it affects the continuity equation and might affect tracer conservation. This would not be an issue if the relaxation was only used near Open-Boundary (part of a "sponge layer") but might not always be the case.
The other thing is that we are considering an alternative implementation of Open-Boundary Conditions that would allow naturally to prescribe the SSH at the OB and account for the pressure gradient across the OB. If this was available and working, it might be used instead of this Eta relaxation, at least in some cases.
So I would suggest we keep this PR open and keep it up-to-date (will merge latest master branch in) and decide later which direction to take.
Thanks @jm-c - I use this in an a-physical sponge part of the domain where I would also sponge active and passive tracers, so I don't consider tracer conservation important in my use cases. I'm not sure use cases where a-physically forcing eta could conserve anything (definitely not mass!) but perhaps there are such use cases...