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

do not correct zqsn in condensation step when ktherm=2 #3

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

zhaobin74
Copy link
Collaborator

@zhaobin74 zhaobin74 commented Oct 5, 2023

This PR fixed a bug of correcting snow enthalpyzqsn(1) prematurely when ktherm=2.

In 1440x1080 configuration, snow layer sometimes could get above freezing when mushy layer scheme is used. There is no check for such condition in the thermo solver. Instead, thickness_change subroutine handles such case in an energy and mass conserving manner

! Remove internal snow melt
!--------------------------------------------------------------
! more efficient formulation using Ts, dhs > 0 (not BFB)
! Ts = (Lfresh + zqsn(k)/rhos) / cp_ice
! if (ktherm == 2 .and. Ts > c0) then
! dhs = -dzs(k) * cp_ice*Ts/Lfresh ! dhs < 0
if (ktherm == 2 .and. zqsn(k) > -rhos * Lfresh) then
dhs = max(-dzs(k), &
-((zqsn(k) + rhos*Lfresh) / (rhos*Lfresh)) * dzs(k))
mass = massice(k) + massliq(k)
massi = c0
if (dzs(k) > puny) massi = max(c0, c1 + dhs/dzs(k))
massice(k) = massice(k) * massi
massliq(k) = mass - massice(k) ! conserve mass
dzs(k) = dzs(k) + dhs ! dhs < 0
zqsn(k) = -rhos * Lfresh
melts = melts - dhs
! delta E = zqsn(k) + rhos * Lfresh
endif

In GEOS coupling, when condensation happens over snow, there is a line to correct round-off error of updated top snow layer enthalpy zqsn(1)

! avoid roundoff errors
zqsn(1) = min(zqsn(1), -rhos*Lfresh)

This correction is supposed to be for round-off, not for the above freezing case as seen in mushy layer scheme. Note: for BL99, snow layer temperature never gets above freezing so the correction is valid here. If mushy layer scheme applies this correction, energy is not conserved and the model will crash in conservation check. So an if condition is added here to only apply correction for BL99 scheme. In mushy layer, the correction is done as above ⬆️.

Zero-diff for AMIP and coupled runs using CICE4 sea ice model

@zhaobin74 zhaobin74 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Oct 5, 2023
@zhaobin74 zhaobin74 requested a review from mathomp4 October 5, 2023 15:16
@zhaobin74 zhaobin74 merged commit 9e8f134 into geos/develop Oct 5, 2023
@zhaobin74 zhaobin74 deleted the bugfix/zhaobin74/not-correcting-zqsn-mushy branch October 5, 2023 16:29
@zhaobin74
Copy link
Collaborator Author

Thanks @mathomp4. Sorry to bother you in your vacation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants