-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Salinity drifting when there is no salinity forcing #666
Comments
Can you share more details about your setup? How can I reproduce this? |
neverworld2.zip ds_snap = xr.open_dataset(neverworld2.snapshot.nc)
SA = (ds_snap["salt"].isel(Time=0)-35)
SA.isel(xt=30).plot() |
Some numerical noise is certainly expected. Your reproducer outputs salinity fluctuations on the order of 10^-14 which is well below the noise threshold and should not lead to significant model drift. |
Normal maybe but problematic for salt and heat conservation... |
Say more how that is problematic? Surely the model is running for << than 1e14 steps, so that numerical noise should never reach a scale where it influences results. |
Can you please share a standalone script that reproduces the issue? In that case I'm happy to take a look at the numerical noise introduced by |
What do you mean by a standalone script ? Is the setup file sufficient or do you ask for a script with the plots as well ? |
Ideally both (so I can verify if the issue is fixed or not). |
no_forcing_share.zip |
I see, thanks for sharing. It's not obvious to me whether this is because of finite numerical precision in the tridiagonal solve or because the linear system isn't set up in a way that is conservative or because your cell volume computation is off (either of which is plausible to me). Unfortunately I don't have cycles to do the math on this right now. If someone wants to dive into this, here are some things I would check:
If you want a workaround, I'd disable TKE so this particular mixing scheme becomes a no-op (which doesn't mean that there won't be other sources of slight leakage due to finite precision once you add dynamics to the model). I also still challenge the notion that this is a problem that needs fixing, a drift of O(1e-12) is totally acceptable (perhaps even inevitable) in my book. |
It turns out that I was running my long_time runs in simple precision, float32 and the drifting was then several order of magnitudes higher (~1e-6) but we didn't thought to investigate that sooner |
When there is no salinity forcing, salinity is still drifting.
We believe it happens with the implicit diffusion scheme which produces noise which accumulates over time, but we are not sure exactly why. Because salinity is used in the equation of state, that creates disturbances on the dynamics that will increase over time.
It would be best to enforce/control salinity conservation. Some similar bug might be affecting temperature as well.
The text was updated successfully, but these errors were encountered: