Repository navigation
Conversation
When SeaIceFreshWaterFlux > 0 and SeaIceSaltFlux < 0, a negative salinity can get passed to the TEOS 10 freezing calculation. This adds a new check to ensure positive salinities are passed to TEOS 10. This fixes failures in G-cases in E3SM.
Collaborator
Author
|
@andrewdnolan could you test this to see if your cases pass now? |
Coupled TestingTesting on both machines was rebased onto #601.
|
andrewdnolan
approved these changes
Oct 13, 2026
andrewdnolan
left a comment
There was a problem hiding this comment.
Approving based on a quick visual inspection and the coupled testing I did.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KPP requires the direct heat fluxes only for the computation of the surface buoyancy flux. The SeaIceHeatFlux term includes the direct contribution and the liquid enthalpy. The current code estimates this contribution using the SeaIceFreshWaterFlux and the SeaIceSaltFlux. When the ice is melting it estimates the salinity as
SeaIceSaltFlux / SeaIceFreshWaterFlux * conversion_to_ppt
When ice is forming, SaTop is used for the freezing temperature calculation. However for mixed sign cases (e.g. SeaIceSaltFlux < 0 and SeaIceFreshWaterFlux > 0) it gave a negative salinity from the formula, which caused a crash when CalcCTFreezing was called. The key change here is to check if both the salt and freshwater fluxes are positive before using the formula.
The mixed sign cases are assumed to use SaTop for the freezing temperature. This may not be completely correct, but I expect the error from this assumption to be very small. I've had co pilot add a count of the mixed sign cases.
I've removed the cTests from all the machines as they previously passed, this only emerged in E3SM simulations. cTests still pass on pm-cpu I will test on pm-gpu soon and can test further if desired.
I've confirmed my failing G case works with this fix.
Checklist
fixes #602