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

cam6_4_061: Fix heating depth for gravity wave scheme #1232

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
One-line Summary: fix heating depth bug for gravity wave parameterization

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

Gravity wave scheme fails to catch the right maximum latent heating rate and convective top from the ZM scheme.
This PR fixes that isuue.
(Github issue #1229)

Expect baseline differences for CAM7 and WACCM tests
===============================================================

Tag name: cam6_4_060
Expand Down
23 changes: 13 additions & 10 deletions src/physics/cam/gw_convect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,28 @@ subroutine gw_beres_src(ncol, band, desc, u, v, &
do k = pver, 1, -1
do i = 1, ncol
if (boti(i) == 0) then
! Detect if we are outside the maximum range (where z = 20 km).
! Detect if we are outside the top of range (where z = 20 km).
if (zm(i,k) >= 20000._r8) then
boti(i) = k
topi(i) = k
else
! First spot where heating rate is positive.
if (netdt(i,k) > 0.0_r8) boti(i) = k
end if
else if (topi(i) == 0) then
! Detect if we are outside the maximum range (z = 20 km).
if (zm(i,k) >= 20000._r8) then
topi(i) = k
else
! First spot where heating rate is no longer positive.
if (.not. (netdt(i,k) > 0.0_r8)) topi(i) = k
end if
end if
end do
! When all done, exit.
! When all done, exit
if (all(boti /= 0)) exit
end do

do k = 1, pver
do i = 1, ncol
if (topi(i) == 0) then
! First spot where heating rate is positive.
if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k
end if
end do
! When all done, exit
if (all(topi /= 0)) exit
end do

Expand Down