Help with outputs of horizontal derivatives of vertically integrated fields #3587
Replies: 5 comments 17 replies
-
Nice example! It looks kinda like a bug. I think @simone-silvestri might be able to help |
Beta Was this translation helpful? Give feedback.
-
There isn't right now --- you have to manually compute |
Beta Was this translation helpful? Give feedback.
-
Interesting, it looks like the |
Beta Was this translation helpful? Give feedback.
-
Oh, I see why this happens. The derivative internally calls |
Beta Was this translation helpful? Give feedback.
-
@scott-conn as a stop gap, I think you can try putting this somewhere in your script: import Oceananigans.Operators: ∂xᶜᶜᶜ
using Oceananigans.ImmersedBoundaries: XYIRF, ImmersedBoundaryGrid
@inline ∂xᶜᶜᶜ(i, j, k, ibg::ImmersedBoundaryGrid, U::XYIRF) = ∂xᶜᶜᶜ(i, j, k, ibg.underlying_grid, U) This will also compute the derivative within the inactive regions. So you'll have to ignore those in output. That said we don't have a great system for masking inactive regions yet anyways, heh. Curious if this works for you. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I'm trying to output horizontal derivatives of vertically integrated fields. For example, something of the form:
$$\frac{\partial}{\partial x}\int_{-L_z}^0 u dz.$$
However, I'm having trouble when I add bathymetry to the simulation. The output is zero wherever the depth of the bathymetry is different to that of the underlying grid. I don't have this problem if I just output the vertically integrated field itself.
Here's an example where I tried adding a gaussian ridge to the baroclinic adjustment example from the docs.
A snapshot of the output looks like:
You can see that the output is masked to zero in the centre region where the ridge is located. Any suggestions?
On a related note, I'd also like to output terms like
$$\frac{\partial}{\partial y}\left[f\int_{-L_z}^0 u dz\right].$$ $f$ in the outputs. Is there a way to do this?
I couldn't figure out how to reconstruct
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions