-
Notifications
You must be signed in to change notification settings - Fork 388
bug fixes for the nonlocal source term in KPP #305
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
bug fixes for the nonlocal source term in KPP #305
Conversation
13675f0 to
5c2f90e
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.
@maltrud Please check this:
max(activeTracers(indexTempFlux,1,iCell),0.0_RKIND) &
+ min(activeTracers(indexTempFlux,1,iCell),0.0_RKIND)
is equal to:
activeTracers(indexTempFlux,1,iCell)
so that must not be what you meant.
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.
@mark-petersen , i actually did this on purpose to denote that there are 2 distinct cases depending on whether T>0 or T<0. if T>0, then we need to subtract off the runoff surface T flux because it doesn't change the surface buoyancy. if T<0, then no "effective flux" was needed, but it does change buoyancy so we need to add it in.
but you're right, it is confusing and should probably be in a comment instead.
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.
@mark-petersen , @vanroekel discovered an error. the line with the 'max' needs to be removed:
max(activeTracers(indexTempFlux,1,iCell),0.0_RKIND)
then the code should be ready. can you modify the code, or should i?
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 just did it. It compiles. Check the revised code - is that what you want?
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.
@maltrud check this revised version.
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.
@mark-petersen this looks right to me. thanks.
vanroekel
left a comment
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.
These changes look correct to me.
mark-petersen
left a comment
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.
OK, this PR is ready to merge. It is non-bfb for E3SM, so will need to be a single MPAS update and corresponding non-bfb E3SM merge.
f99fa99 to
86b2314
Compare
|
Rebased and retested. |
…ocean/gm_update_maint1.2 bug fixes for the nonlocal source term in KPP MPAS-Dev#305 This PR fixes several bugs in the calculation of the nonlocal source term in KPP. for temperature, we need to subtract off the contribution from thickness fluxes that don't change buoyancy. for salinity, we need to add virtual salinity fluxes that do change buoyancy. these fixes have been tested in E3SM G-cases and behave as expected.
Update maint1.2: 3D varying GM This update adds the following PRs from ocean/develop: - Adds options for 3d varying GM bolus and 2d varying phase speed #288 - Add GM bolus eddy stats #339 - Fix threading issue in MPAS-O GM routine #376 - compute landIceMask using geometric_features #447 - bug fixes for the nonlocal source term in KPP #305
#3513) Update maint1.2: add 3D varying GM This update brings in a new mpas-source submodule with the following PRs from MPAS ocean/develop: * Adds options for 3d varying GM bolus and 2d varying phase speed (MPAS-Dev/MPAS-Model#288) * Add GM bolus eddy stats (MPAS-Dev/MPAS-Model#339) * Fix threading issue in MPAS-O GM routine (MPAS-Dev/MPAS-Model#376) * Compute landIceMask using geometric_features (MPAS-Dev/MPAS-Model#447) * Bug fixes for the nonlocal source term in KPP (MPAS-Dev/MPAS-Model#305) and from E3SM master: * Change all ocean output files to single precision (E3SM #3360) [non-BFB]
This PR fixes several bugs in the calculation of the nonlocal source term in KPP. for temperature, we need to subtract off the contribution from thickness fluxes that don't change buoyancy. for salinity, we need to add virtual salinity fluxes that do change buoyancy.
these fixes have been tested in E3SM G-cases and behave as expected.