Skip to content

Conversation

@maltrud
Copy link
Contributor

@maltrud maltrud commented Jun 28, 2019

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.

@mark-petersen mark-petersen self-assigned this Jun 28, 2019
@mark-petersen mark-petersen self-requested a review June 28, 2019 15:49
@mark-petersen mark-petersen force-pushed the maltrud/ocean/nonlocalBugfixKPP branch from 13675f0 to 5c2f90e Compare July 2, 2019 15:01
@mark-petersen mark-petersen requested a review from vanroekel July 2, 2019 15:11
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@vanroekel vanroekel left a 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 mark-petersen self-requested a review July 10, 2019 15:52
Copy link
Contributor

@mark-petersen mark-petersen left a 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.

@mark-petersen mark-petersen force-pushed the maltrud/ocean/nonlocalBugfixKPP branch from f99fa99 to 86b2314 Compare August 1, 2019 15:48
@mark-petersen
Copy link
Contributor

Rebased and retested.

@mark-petersen mark-petersen merged commit 86b2314 into MPAS-Dev:ocean/develop Aug 1, 2019
mark-petersen added a commit to mark-petersen/MPAS-Model that referenced this pull request Mar 24, 2020
…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.
mark-petersen added a commit that referenced this pull request Mar 24, 2020
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
jonbob added a commit to E3SM-Project/E3SM that referenced this pull request Mar 27, 2020
#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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants