Skip to content

Commit b6ef6af

Browse files
committed
update zeroing logic in m_micro_post after review
1 parent bc08cc3 commit b6ef6af

1 file changed

Lines changed: 10 additions & 20 deletions

File tree

physics/MP/Morrison_Gettelman/m_micro_post.F90

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,14 @@ subroutine m_micro_post_run( &
5555
do i=1,im
5656
new_qr = gq0_rain(i,k) + dtp*ten_qr(i,k)
5757
!zero out qr when tendencies are applied if after-application value is small or negative
58-
if (new_qr < 0) then
59-
ten_qr(i,k) = new_qr/dtp
60-
else if (new_qr < qsmall) then
61-
ten_qr(i,k) = ten_qr(i,k) - new_qr/dtp
58+
if (new_qr < qsmall) then
59+
ten_qr(i,k) = -gq0_rain(i,k)/dtp
6260
end if
6361

6462
new_qs = gq0_snow(i,k) + dtp*ten_qs(i,k)
6563
!zero out qs when tendencies are applied if after-application value is small or negative
66-
if (new_qs < 0) then
67-
ten_qs(i,k) = new_qs/dtp
68-
else if (new_qs < qsmall) then
69-
ten_qs(i,k) = ten_qs(i,k) - new_qs/dtp
64+
if (new_qs < qsmall) then
65+
ten_qs(i,k) = -gq0_snow(i,k)/dtp
7066
end if
7167
enddo
7268
enddo
@@ -81,27 +77,21 @@ subroutine m_micro_post_run( &
8177
do i=1,im
8278
new_qr = gq0_rain(i,k) + dtp*ten_qr(i,k)
8379
!zero out qr when tendencies are applied if after-application value is small or negative
84-
if (new_qr < 0) then
85-
ten_qr(i,k) = new_qr/dtp
86-
else if (new_qr < qsmall) then
87-
ten_qr(i,k) = ten_qr(i,k) - new_qr/dtp
80+
if (new_qr < qsmall) then
81+
ten_qr(i,k) = -gq0_rain(i,k)/dtp
8882
end if
8983

9084
new_qs = gq0_snow(i,k) + dtp*ten_qs(i,k)
9185
!zero out qs when tendencies are applied if after-application value is small or negative
92-
if (new_qs < 0) then
93-
ten_qs(i,k) = new_qs/dtp
94-
else if (new_qs < qsmall) then
95-
ten_qs(i,k) = ten_qs(i,k) - new_qs/dtp
86+
if (new_qs < qsmall) then
87+
ten_qs(i,k) = -gq0_snow(i,k)/dtp
9688
end if
9789

9890

9991
new_qg = gq0_graupel(i,k) + dtp*ten_qg(i,k)
10092
!zero out qg when tendencies are applied if after-application value is small or negative
101-
if (new_qg < 0) then
102-
ten_qg(i,k) = new_qg/dtp
103-
else if (new_qg < qsmall) then
104-
ten_qg(i,k) = ten_qg(i,k) - new_qg/dtp
93+
if (new_qg < qsmall) then
94+
ten_qg(i,k) = -gq0_graupel(i,k)/dtp
10595
end if
10696
enddo
10797
enddo

0 commit comments

Comments
 (0)