-
Notifications
You must be signed in to change notification settings - Fork 150
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
cam6_4_061: Fix heating depth for gravity wave scheme #1232
cam6_4_061: Fix heating depth for gravity wave scheme #1232
Conversation
Preserve constant dry mixing ratios in gw_drap and vertical diffusion code
For WACCM runs - get the following traceback:
The code with the divide by zero is:
It appears that tend_level(i) is equal to pver with these new code modifications I spoke with @JulioTBacmeister and while we could modify the gw_common.F90 code, he believes that the proposed code modifications should not be returning tend_level(i) equal to pver. |
If the revisions for #1117 get completed before the above issue is resolved, I will swap the CAM tags for these two PRs |
Hi everyone, I checked the subroutine gw_beres_src and found that the situation that tend_level(i) = pver could happen when topi =pver,which means in the heating profile, the only netdt(pver) at lowest level is positive, other level are negative or zero. This situation should be very rare so that in most running cases, I guess we won't meet this bug. To fix this bug, I think we can replace 'if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k' with 'if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k-1' This change will make the code exactly output the same result as the old scheme. |
Rerunning the tests now. I have asked for reapproval by reviewers. |
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.
Looks good to me!
Merge pull request ESCOMP#1232 from PeterHjortLauritzen/issue1229_heating_depth_bugfix cam6_4_061: Fix heating depth for gravity wave scheme ESCOMP commit: 5a1fbc8
The gravity wave scheme fails to catch the right maximum latent heating rate and convective top from the ZM scheme. Code provided by @liyptardis
closes #1229