-
Notifications
You must be signed in to change notification settings - Fork 1
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
GLwork is not sign-definite #25
Comments
I bet @Hallberg-NOAA has some ideas too! |
@adcroft and @Hallberg-NOAA, sorry for pinging you again. I am still interested in whether you have ideas for how to fix the problem described above! |
My suggestion was that the line https://github.com/NoraLoose/MOM6/blob/10b4ecd715ba8ec7d5e4dbf4a68a3efc1d7ce513/src/diagnostics/MOM_diagnostics.F90#L1119 is using |
@adcroft and I think that the problem has to do with the way that the barotropic solver and the vertical viscosity handle their velocities. The velocities in uh and vh are adjusted to give the time-mean barotropic transport, whereas u and v themselves are instantaneous velocities at the end of the timestep. One way to test this would be to run the model with SPLIT=False. This would require the use of a very short dynamic timestep (to resolve the external gravity waves that are usually captured by the barotropic solver), but in this case the transports and velocities are associated with the same instantaneous velocities at the end of the timestep. The corrections are subject to a viscous correction, so it should be possible to reconstruct the full energetic consequences of the GL viscosity, but first let's try to confirm that this is what is going on. For a thorough description of these aspects of the split baroclinic-barotropic timestepping scheme, see Hallberg, R., and A. Adcroft, 2009: Reconciling estimates of the free surface height in Lagrangian vertical coordinate ocean models with mode-split time stepping. Ocean Modelling, 29(1), DOI:10.1016/j.ocemod.2009.02.008. Another possibility is that this is arising because the time-step-averaged thicknesses at velocity points as used by the continuity solver are not exactly the same as those used by the vertical viscosity code. If this is the problem, changing to an unsplit time stepping scheme could still lead to negative work terms. If this is the case, solutions would require an extensive revision to parts of the dynamic core (which we are already contemplating as an option), but they might be a good idea for a variety of other reasons. |
@adcroft @Hallberg-NOAA thanks so much for your input! I tested your first idea and set cc @iangrooms |
I still think we're on the right track. We had two possibilities for why the |
@adcroft thanks for this suggestion! I moved the This commit reflects the changes I made to arrive at the new Unfortunately, I don't really understand why... |
😕 How big are the negatives now? Double checking we agree on the math. If the vertical viscosity update is summarized as If we split I don't see anywhere in the code the boundary values of Let's (sanity) check that I am unsure what the "underflow" block does to the sign. Hopefully no damage but "to find out, comment out". I ask at the top about the magnitude because the code is making me wonder about roundoff. Both the math and code rely on the rearranging of differences and in both cases the residual of the differences is potentially inaccurate when difference large coherent quantities. The term we are indirectly obtaining and that you are plotting is Aside: I suggest moving block L660-L666 to above block L634-L658 so that |
@adcroft thanks so much for taking a deep dive into my code! I agree with the math (I just corrected some obvious typos):
Correct 👍 Dumb question: Using your notation from above, aren't we computing Would it make sense to switch the order? |
@adcroft I will now perform the other sanity checks that you suggested, including
|
@adcroft @Hallberg-NOAA @iangrooms good news: I finally figured out how to make the
where I am using Alistair's notation from above. But what we actually need is
which uses the original velocity Thanks everyone for your help with fixing this issue! |
New diagnostics: * GLwork: Kinetic Energy Source from GL90 Vertical Viscosity The energetics of the GL90 parameterization (named "GLwork") are intentionally computed in MOM_vert_friction, rather than in MOM_diagnostics, where the reamining kinetic energy budget terms are computed. We have to do the computation in MOM_vert_friction to ensure sign- definiteness when GLwork is summed in the vertical. Indeed, MOM_diagnostics does not have access to the velocities and thicknesses used in the vertical solver, but rather uses a time-mean barotropic transport [uv]h to compute the energy budget diagnostics. A detailed discussion and exploration of this issue can be found in ocean-eddy-cpt#25. As a result of not computing the energetics in MOM_diagnostics, GLwork is not exactly contained in KE_visc. KE_visc represents the energetics of all vertical viscosity contributions, including the GL90 vertical viscosity. We could implement a term "KE_visc_gl90" that can be 1-to-1 compared to KE_visc; that is, KE_visc - KE_visc_gl90 would represent exactly the energetics of all viscosity contributions EXCEPT the GL90 viscosity. If we implemented KE_visc_gl90, this term would in practice be very similar as GLwork, but sign-definiteness is not ensured, see above.
New diagnostics: * GLwork: Kinetic Energy Source from GL90 Vertical Viscosity The energetics of the GL90 parameterization (named "GLwork") are intentionally computed in MOM_vert_friction, rather than in MOM_diagnostics, where the reamining kinetic energy budget terms are computed. We have to do the computation in MOM_vert_friction to ensure sign- definiteness when GLwork is summed in the vertical. Indeed, MOM_diagnostics does not have access to the velocities and thicknesses used in the vertical solver, but rather uses a time-mean barotropic transport [uv]h to compute the energy budget diagnostics. A detailed discussion and exploration of this issue can be found in ocean-eddy-cpt#25. As a result of not computing the energetics in MOM_diagnostics, GLwork is not exactly contained in KE_visc. KE_visc represents the energetics of all vertical viscosity contributions, including the GL90 vertical viscosity. We could implement a term "KE_visc_gl90" that can be 1-to-1 compared to KE_visc; that is, KE_visc - KE_visc_gl90 would represent exactly the energetics of all viscosity contributions EXCEPT the GL90 viscosity. If we implemented KE_visc_gl90, this term would in practice be very similar as GLwork, but sign-definiteness is not ensured, see above.
New diagnostics: * GLwork: Kinetic Energy Source from GL90 Vertical Viscosity The energetics of the GL90 parameterization (named "GLwork") are intentionally computed in MOM_vert_friction, rather than in MOM_diagnostics, where the reamining kinetic energy budget terms are computed. We have to do the computation in MOM_vert_friction to ensure sign- definiteness when GLwork is summed in the vertical. Indeed, MOM_diagnostics does not have access to the velocities and thicknesses used in the vertical solver, but rather uses a time-mean barotropic transport [uv]h to compute the energy budget diagnostics. A detailed discussion and exploration of this issue can be found in ocean-eddy-cpt#25. As a result of not computing the energetics in MOM_diagnostics, GLwork is not exactly contained in KE_visc. KE_visc represents the energetics of all vertical viscosity contributions, including the GL90 vertical viscosity. We could implement a term "KE_visc_gl90" that can be 1-to-1 compared to KE_visc; that is, KE_visc - KE_visc_gl90 would represent exactly the energetics of all viscosity contributions EXCEPT the GL90 viscosity. If we implemented KE_visc_gl90, this term would in practice be very similar as GLwork, but sign-definiteness is not ensured, see above.
New diagnostics: * GLwork: Kinetic Energy Source from GL90 Vertical Viscosity The energetics of the GL90 parameterization (named "GLwork") are intentionally computed in MOM_vert_friction, rather than in MOM_diagnostics, where the reamining kinetic energy budget terms are computed. We have to do the computation in MOM_vert_friction to ensure sign- definiteness when GLwork is summed in the vertical. Indeed, MOM_diagnostics does not have access to the velocities and thicknesses used in the vertical solver, but rather uses a time-mean barotropic transport [uv]h to compute the energy budget diagnostics. A detailed discussion and exploration of this issue can be found in ocean-eddy-cpt#25. As a result of not computing the energetics in MOM_diagnostics, GLwork is not exactly contained in KE_visc. KE_visc represents the energetics of all vertical viscosity contributions, including the GL90 vertical viscosity. We could implement a term "KE_visc_gl90" that can be 1-to-1 compared to KE_visc; that is, KE_visc - KE_visc_gl90 would represent exactly the energetics of all viscosity contributions EXCEPT the GL90 viscosity. If we implemented KE_visc_gl90, this term would in practice be very similar as GLwork, but sign-definiteness is not ensured, see above.
* Add GL90 parameterization in stacked shallow water This adds a new vertical viscosity parameterization as in Greatbatch and Lamb (1990), Ferreira & Marshall (2006) and Zhao & Vallis (2008), hereafter referred to as the GL90 vertical viscosity parameterization. This vertical viscosity scheme redistributes momentum in the vertical, and is the equivalent of the Gent & McWilliams (1990) parameterization, but in a TWA (thickness-weighted averaged) set of equations. The vertical viscosity coefficient nu is computed from kappa_GM via thermal wind balance, and the following relation: nu = kappa_GM * f^2 / N^2. The vertical viscosity del_z ( nu del_z u) is applied to the momentum equation with stress-free boundary conditions at the top and bottom. In the current implementation, kappa_GM is assumed either (a) constant or as (b) having an EBT structure. A third possible formulation of nu is depth-independent: nu = f^2 * alpha The latter formulation would be equivalent to a kappa_GM that varies as N^2 with depth. Currently, the GL90 parameterization is only implemented in stacked shallow water (SSW) mode, in which case we have 1/N^2 = h/g'. More specifically, this commit adds a new subroutine that computes the couping coefficient associated with GL90 via a_cpl_gl90 = nu / h = kappa_GM * f^2 / g' or a_cpl_gl90 = nu / h = f^2 * alpha / h. Further, a_cpl_gl90 is multiplied by a function (botfn), which is 0 within the GL90 bottom boundary layer, whose depth is set by Hbbl_gl90, and 1 otherwise. This modification is necessary to avlid fluxing momentum into vanished layers that ride over steep topography. Finally, a_cpl_gl90 is added to a_cpl, where the latter is the coupling coefficient associated with the remaining vertical stresses, used in the vertical viscosity solver. More information can be found in Loose et al. (https://www.essoar.org/doi/abs/10.1002/essoar.10512867.1), Appendix B. New diagnostics: * au_gl90_visc: zonal viscous coupling coefficient associated with GL90, is contained in au_visc * av_gl90_visc: meridional viscous coupling coefficient associated with GL90, is contained in av_visc * Kv_gl90_u: GL90 vertical viscosity at u-points, is contained in Kv_u * Kv_gl90_v: GL90 vertical viscosity at v-points, is contained in Kv_v * du_dt_visc_gl90: zonal acceleration due to GL90 vertical viscosity, included in du_dt_visc * dv_dt_visc_gl90: meridional acceleration due to GL90 vertical viscosity, included in dv_dt_visc * GLwork: Kinetic Energy Source from GL90 Vertical Viscosity The energetics of the GL90 parameterization (named "GLwork") are intentionally computed in MOM_vert_friction, rather than in MOM_diagnostics, where the reamining kinetic energy budget terms are computed. We have to do the computation in MOM_vert_friction to ensure sign- definiteness when GLwork is summed in the vertical. Indeed, MOM_diagnostics does not have access to the velocities and thicknesses used in the vertical solver, but rather uses a time-mean barotropic transport [uv]h to compute the energy budget diagnostics. A detailed discussion and exploration of this issue can be found in ocean-eddy-cpt#25. As a result of not computing the energetics in MOM_diagnostics, GLwork is not exactly contained in KE_visc. KE_visc represents the energetics of all vertical viscosity contributions, including the GL90 vertical viscosity. We could implement a term "KE_visc_gl90" that can be 1-to-1 compared to KE_visc; that is, KE_visc - KE_visc_gl90 would represent exactly the energetics of all viscosity contributions EXCEPT the GL90 viscosity. If we implemented KE_visc_gl90, this term would in practice be very similar as GLwork, but sign-definiteness is not ensured, see above.
Issue
I find locations along the continental shelf where the GLwork diagnostic (coded up as
KE_visc_gl90
) is positive (red shading). This is contrary to the expectation that the GLwork should be strictly negative, both in the continuous and discretized world: it describes the energetics of a vertical viscosity. The figure shows the 5-day averaged diagnostic for a 1/2 degree simulation. The problem gets worse with coarser resolution.Most of these positive values we are seeing are O(10^-13) and smaller, but the largest value of GLwork is O(10^-5). A distribution is shown here:
How to fix it?
The GLwork diagnostic
KE_visc_gl90
(together with the GL90 parameterization) are currently part of this branch. The most complex part of computingKE_visc_gl90
is to track the vertical velocity tendencyd[uv]_dt_visc_gl90
that arises from the GL90 viscosity through the tridiagonal solver. I followed what is done ford[uv]_dt_visc
. Here is the meat of it:https://github.com/NoraLoose/MOM6/blob/10b4ecd715ba8ec7d5e4dbf4a68a3efc1d7ce513/src/parameterizations/vertical/MOM_vert_friction.F90#L480-L504
@adcroft you mentioned that the problem of indefiniteness could have to do with the barotropic solver. Do you have an idea for what I could try to fix the issue?
The text was updated successfully, but these errors were encountered: