Skip to content

Commit

Permalink
avoid double staggering of ww in vertical advection of geopotential
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Göbel committed Jan 14, 2021
1 parent a271d9a commit 1566939
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions dyn_em/module_big_step_utilities_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,7 @@ SUBROUTINE rhs_ph( ph_tend, u, v, ww, &
DO k = 2, kte
DO i = its, itf
wdwn(i,k) = .5*(ww(i,k,j)+ww(i,k-1,j))*rdnw(k-1) &
*(ph(i,k,j)-ph(i,k-1,j)+phb(i,k,j)-phb(i,k-1,j))
wdwn(i,k) = rdnw(k-1)*(ph(i,k,j)-ph(i,k-1,j)+phb(i,k,j)-phb(i,k-1,j))
ENDDO
ENDDO
Expand All @@ -1468,7 +1467,7 @@ SUBROUTINE rhs_ph( ph_tend, u, v, ww, &
DO k = 2, kte-1
DO i = its, itf
ph_tend(i,k,j) = ph_tend(i,k,j) &
- (fnm(k)*wdwn(i,k+1)+fnp(k)*wdwn(i,k))
- ww(i,k,j)*(fnm(k)*wdwn(i,k+1)+fnp(k)*wdwn(i,k))
ENDDO
ENDDO
Expand Down
7 changes: 3 additions & 4 deletions dyn_em/module_small_step_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,7 @@ SUBROUTINE advance_w( w, rw_tend, ww, w_save, u, v, &
+(1.-epssm)*t_2ave(i,k,j))
t_2ave(i,k,j)=(t_2ave(i,k,j) + (c1h(k)*Muave(i,j))*t0) &
/((c1h(k)*Muts(i,j)+c2h(k))*(t0+t_1(i,k,j)))
wdwn(i,k+1)=.5*(ww(i,k+1,j)+ww(i,k,j))*rdnw(k) &
*(ph_1(i,k+1,j)-ph_1(i,k,j)+phb(i,k+1,j)-phb(i,k,j))
wdwn(i,k+1)=rdnw(k)*(ph_1(i,k+1,j)-ph_1(i,k,j)+phb(i,k+1,j)-phb(i,k,j))
rhs(i,k+1) = dts*(ph_tend(i,k+1,j) + .5*g*(1.-epssm)*w(i,k+1,j))
ENDDO
ENDDO
Expand All @@ -1325,8 +1324,8 @@ SUBROUTINE advance_w( w, rw_tend, ww, w_save, u, v, &
! here rhs = delta t [ph_tend + ~g*w/2 - ~ww * partial d phi/dz]
DO k=2,k_end
DO i=i_start, i_end
rhs(i,k) = rhs(i,k)-dts*( fnm(k)*wdwn(i,k+1) &
+fnp(k)*wdwn(i,k ) )
rhs(i,k) = rhs(i,k)-dts*ww(i,k,j)*( fnm(k)*wdwn(i,k+1) &
+fnp(k)*wdwn(i,k ) )
ENDDO
ENDDO
! NOTE: phi'' is not coupled with the map-scale factor (1/m),
Expand Down

0 comments on commit 1566939

Please sign in to comment.