Skip to content

Commit

Permalink
Merge pull request #9 from adamrher/new_clubb_cam6_3_080.afix
Browse files Browse the repository at this point in the history
implement lower bound on clubbtop=pver
  • Loading branch information
Katetc authored Dec 15, 2022
2 parents 313c4c7 + 70a4076 commit 58db005
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/physics/cam/clubb_intr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3618,7 +3618,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! active for informing where to apply the energy fixer.
do i=1, ncol
clubbtop(i) = top_lev
do while ((rtp2(i,clubbtop(i)) <= 1.e-15_r8 .and. rcm(i,clubbtop(i)) == 0._r8))
do while ((rtp2(i,clubbtop(i)) <= 1.e-15_r8 .and. rcm(i,clubbtop(i)) == 0._r8) .and. clubbtop(i) < pver)
clubbtop(i) = clubbtop(i) + 1
end do
end do
Expand Down Expand Up @@ -3665,11 +3665,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
te_b(i) = te_b(i) + (cam_in%shf(i)+cam_in%cflx(i,1)*(latvap+latice)) * hdtime

! Compute the disbalance of total energy, over depth where CLUBB is active
if(clubbtop(i) .ne. pverp) then
se_dis(i) = (te_a(i) - te_b(i))/(state1%pint(i,pverp)-state1%pint(i,clubbtop(i)))
else
se_dis(i) = 0._r8
endif
se_dis(i) = (te_a(i) - te_b(i))/(state1%pint(i,pverp)-state1%pint(i,clubbtop(i)))
end do

! Fix the total energy coming out of CLUBB so it achieves energy conservation.
Expand Down

0 comments on commit 58db005

Please sign in to comment.