-
Notifications
You must be signed in to change notification settings - Fork 72
Machine Learning based vertical diffusivity in EPBL mixing scheme used for ocean surface boundary layer #737
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #737 +/- ##
============================================
- Coverage 38.01% 37.52% -0.49%
============================================
Files 299 305 +6
Lines 88063 91530 +3467
Branches 16547 17424 +877
============================================
+ Hits 33475 34348 +873
- Misses 48513 50757 +2244
- Partials 6075 6425 +350 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't (shouldn't) make the final approval on this since I'm involved in the research, but there are some obvious things that need to be changed before someone else reviews the PR. Once these are cleaned up, my take is it will be smooth sailing.
You added several files that I think should not be included:
.testing/tc4/Makefile
is generated by autoconf using theMakefile.in
template.testing/gen_data.dSYM/Contents.Info.plist
- looks like something leftover from your a mac build process.testing/gen_grid.dSYM/Contents.Info.plist
- ditto
Please remove these files. I believe the only file you meant to submit changes for is MOM_energetic_PBL.F90
. There's also a real variable with missing unit documentation which I added a separate inline comment for.
I've just been discussing with Bob, and we think we need to add a new version of |
I have worked on the comments and updated the code. Please review the changes. |
I have worked on the comments and updated the code. Please review the changes and I will be happy to edit. |
The code has been modified for efficiency. Number of divisions and unnecessary local variables have been removed. The non-dimensional variables p1 and p2 have been replaced with much easier to read variables: Eh and Lh. Eh is boundary layer depth (h) divided by Ekman depth (u_/f) and Lh is (hBflux)/(u_*^3). This makes the subroutines readable and in line with variables names in the upcoming manuscript. |
d051627
to
6b15ff4
Compare
a55e6dc
to
d365109
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting close to ready. I was able to confirm that a squash merge is compatible with the latest dev/gfdl with no conflicts. The documentation of the PR (the PR message) is out-of-date, and will be again when you fix the runtime parameter names to fit the convention.
The necessary changes have been made. |
be6f33b
to
49685c4
Compare
I completed all the necessary edits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @aakashsane, for the substantial revisions to this PR. After inspecting the code again, it is much improved both in terms of clarity and I suspect efficiency. I am finding only a few spelling errors in a comment ("units iof buuyancy flux" on line 2842) that I would correct; I suppose that we can let that little thing slide for now!
These changes enhance the existing vertical diffusivity used in EPBL with machine learned diffusivity that is constrained on a second moment closure. Using symbolic regression and least-squares fitting, a shape function ( g(\sigma) ) responds to changes in the surface forcing (Latitude, wind stress, surface buoyancy flux, boundary layer depth). g(\sigma) goes from zero to 1 and its skewness changes as per surface forcing conditions. There are two options for the turbulent velocity scale: v0 and v0h. The velocity scale, v0, is an approximation that depends on three inputs: Coriolis parameter f, ustar u_*, and surface buoyancy flux BFlux. It agrees with diagnosed velocity scale from GLS scheme given by v0 = < { \kappa } max / h >, where h is boundary layer depth and angled brackets denote averaged data for a given forcing: B, u_*, f. When v0 is multiplied with g(\sigma) and multiplied by the energetics based boundary layer depth h, i.e \nu = . g(\sigma) \cdot v_0 \cdot h, we get a diffusivity which is constrained on a second moment closure. The second velocity scale, v0h, depends on ustar u_*, surface buoyancy flux BFlux, and boundary layer depth. It agrees with diagnosed velocity scale from GLS scheme given by v0^h = { \kappa } max / h , where h is the boundary layer depth. v0^h agrees with convective velocity scaling under pure convection ( v0^h ~ (Bh)^(1/3) ). When v0 or v0^h is multiplied with g(\sigma) and multiplied by the energetics based boundary layer depth h, i.e \nu = . g(\sigma) \cdot v_0 \cdot h, we get a diffusivity which is constrained on a second moment closure. The Machine learned (ML) diffusivity is activated by using the logical flags: 1. EPBL_EQD_DIFFUSIVITY_SHAPE 2. EPBL_EQD_DIFFUSIVITY_VELOCITY 3. EPBL_EQD_DIFFUSIVITY_VELOCITY_H Logical flag 1 activates the new equation for shape function. Logical flag 2 activates velocity scale v0 Logical flag 3 activates velocity scale v0^h To use ML diffusivity, Logical flag 1 has to be set to ‘True’ and either logical flag 2 or 3 should be set to ‘True’. 2 and 3 both cannot be true or false. The subroutines replace the default EPBL mixing coefficients of Reichl and Hallberg (2018). The publications for OSBL machine learned diffusivity are: Sane et al. 2023 ( https://doi.org/10.1029/2023MS003890 ) and Sanę et al. 2025.
49685c4
to
736e0af
Compare
This PR passed pipeline testing with the expected warnings about new runtime parameters at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/27608, and then it passed again with fewer new runtime parameters due to the addition of some appropriate |
This has been merged. @Hallberg-NOAA made one further edit which makes it look like a new conflict which is why this did not close automatically. |
These changes enhance the existing vertical diffusivity used in EPBL with machine learned diffusivity that is constrained on a second moment closure. Using symbolic regression and least-squares fitting, a shape function ( g(\sigma) ) responds to changes in the surface forcing (Latitude, wind stress, surface buoyancy flux, boundary layer depth). g(\sigma) goes from zero to 1 and its skewness changes as per surface forcing conditions.
There are two options for the turbulent velocity scale: v0 and v0h.
The velocity scale, v0, is an approximation that depends on three inputs: Coriolis parameter f, ustar u*, and surface buoyancy flux BFlux. It agrees with diagnosed velocity scale from GLS scheme given by v0 = < { \kappa } max / h >, where h is boundary layer depth and angled brackets denote averaged data for a given forcing: B, u_, f. When v0 is multiplied with g(\sigma) and multiplied by the energetics based boundary layer depth h, i.e \nu = . g(\sigma) \cdot v_0 \cdot h, we get a diffusivity which is constrained on a second moment closure.
The second velocity scale, v0h, depends on ustar u*, surface buoyancy flux BFlux, and boundary layer depth. It agrees with diagnosed velocity scale from GLS scheme given by v0^h = { \kappa } max / h , where h is the boundary layer depth. v0^h agrees with convective velocity scaling under pure convection ( v0^h ~ (Bh)^(1/3) ).
When v0 or v0^h is multiplied with g(\sigma) and multiplied by the energetics based boundary layer depth h, i.e \nu = . g(\sigma) \cdot v_0 \cdot h, we get a diffusivity which is constrained on a second moment closure.
The Machine learned (ML) diffusivity is activated by using the logical flags:
Logical flag 1 activates the new equation for shape function.
Logical flag 2 activates velocity scale v0
Logical flag 3 activates velocity scale v0^h
To use ML diffusivity, Logical flag 1 has to be set to ‘True’ and either logical flag 2 or 3 should be set to ‘True’. 2 and 3 both cannot be true or false.
The subroutines replace the default EPBL mixing coefficients of Reichl and Hallberg (2018).
The publications for OSBL machine learned diffusivity are: Sane et al. 2023 ( https://doi.org/10.1029/2023MS003890 ) and Sanę et al. 2025 (under preparation).