Skip to content
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

Move MLD diagnostics out of MOM_diabatic_aux and add the option to use non-surface density in MLD_003 #691

Merged

Conversation

theresa-morrison
Copy link

@theresa-morrison theresa-morrison commented Jul 22, 2024

This PR moves the diagnoseMLDbyEnergy and diagnoseMLDbyDensityDifference out of the MOM_diabatic_aux module and into a newly created MOM_diagnose_mld module which is located in the diagnostics folder. This is to allow the MLD diagnostic codes to be used within the generic tracer routines.

In addition, a new parameter is added to diagnoseMLDbyDensityDifference that allows a user to specify a reference for the "surface" density that is not the top model layer. This feature should make the MLD_003 diagnostic more consistent with the de Boyer Montégut MLD climatology which uses a reference depth of 10m (see deBoyer Montegut et al. 2004 and 2022). In addition, new diagnostics have been added to save the actual depth of the density used and the "surface" density used in the MLD calculation. These options have only been added for the MLD_003 diagnostic.

The new parameter added HREF_FOR_MLD is the target depth for the "surface" density used in the density difference calculation. The default is zero which means the density of the surface layer is used. If HREF_FOR_MLD is not present when diagnoseMLDbyDensityDifference is called, the density of the surface layer is used. Where the ocean is shallower than HREF_FOR_MLD the density in the surface layer is used. The pressure at HREF_FOR_MLD is used as the reference pressure for the potential density.

Two new diagnostics have been added:MLD_003_refZ and MLD_003_refRho. The first is used mainly for debugging and should be equal to HREF_FOR_MLD except where the ocean is shallower. The other diagnostic MLD_003_refRho is the two-diimensional potential density at the "surface" which is used in the density difference. This is saved because a user may want to compare the density difference between HREF_FOR_MLD and the density in the top layer.

These changes do not change the model solution but if HREF_FOR_MLD is not zero, it will change the MLD_003 diagnostic.

A one year (1993) test in the Northeast Pacfic (NEP) regional domain showed deeper MLD when HREF_FOR_MLD=10.0 (h=0 vs. h=10). Overall the MLD is too shallow compared to the de Boyer Montégut 2022 MLD climatology (DBM on the plot below), so a slight deepening is likely to help with the bias. The figure below show the annual average MLD for the NEP domain in meters for 1993.
MLD_comaprison
Thanks to @amoebaliz for this test domain.

@theresa-morrison theresa-morrison marked this pull request as ready for review July 22, 2024 18:21
@theresa-morrison theresa-morrison changed the title Add option to use non-surface density in MLD_003 Move MLD diagnostics out of MOM_diabatic_aux and add the option to use non-surface density in MLD_003 Jul 29, 2024
@@ -3248,6 +3252,15 @@ subroutine diabatic_driver_init(Time, G, GV, US, param_file, useALEalgorithm, di
'Squared buoyancy frequency below mixed layer', units='s-2', conversion=US%s_to_T**2)
CS%id_MLD_user = register_diag_field('ocean_model', 'MLD_user', diag%axesT1, Time, &
'Mixed layer depth (used defined)', units='m', conversion=US%Z_to_m)
if (CS%id_MLD_003 > 0) then
call get_param(param_file, mdl, "HREF_FOR_MLD", CS%ref_h_mld, &
"Refernced depth used to calculate the potential density used to find the mixed layer depth "//&
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note typo

@theresa-morrison theresa-morrison force-pushed the add_DBM_MLD_diagnostic branch 2 times, most recently from 7b73cbc to 64dc13c Compare August 2, 2024 17:22
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.90%. Comparing base (87a0c61) to head (64dc13c).
Report is 4 commits behind head on dev/gfdl.

Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #691      +/-   ##
============================================
+ Coverage     36.99%   40.90%   +3.90%     
============================================
  Files           272       42     -230     
  Lines         82433     5286   -77147     
  Branches      15421     1013   -14408     
============================================
- Hits          30496     2162   -28334     
+ Misses        46246     2939   -43307     
+ Partials       5691      185    -5506     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@theresa-morrison
Copy link
Author

After discussing with Bob, Brandon, and Alistair some changes have been made to this PR incuding fixing typos, whitespace, and line length. The commit history has been cleaned up so that two clean commits can be merged in.

Since the OMIP7 MLD definition was unclear when this PR was created it is possible that more changes to the MLD diagnstcs may be needed for OMIP7.

In addition, the optional arguments that I added to diagnoseMLDbyDensityDifference are now not optional. Where diagnoseMLDbyDensityDifference is called in the diabatic driver for mixed layer depths besides MLD_003 those arguments have be specified to reproduce previous results.

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the purpose of this PR, and after inspecting the code I believe it to be correct. Moreover, I agree that this should be treated via two distinct commits.

Theresa Morrison added 2 commits August 2, 2024 14:42
A new parameter is added to diagnoseMLDbyDensityDifference that
allows a user to specify a reference for the surface density that
is not the top model layer. This feature should make the MLD_003
diagnostic more consistent with the de Boyer Montégut MLD
climatology. In addition, new diagnostics have been added to save
the actual depth of the density used and the "surface" density
used in the MLD calculation. These options have only been added
for the MLD_003 option.
Move the calculation of density difference and energy difference
based MLD diagnostics out of MOM_diabatic_aux and into a new module
MOM_diagnose_MLD.F90. Because this new module includes only the
calculation of mixed layer depths that will be primarily used as
diagnostics, it will be in the diagnostics subfolder.
This change will allow the diagnose MLD routines to be used in
the generic tracers.
@Hallberg-NOAA
Copy link
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/24341 with the expected warnings about new diagnostics and new runtime parameters.

@Hallberg-NOAA Hallberg-NOAA merged commit f1ba822 into NOAA-GFDL:dev/gfdl Aug 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants