Skip to content

Commit

Permalink
Merge pull request #109 from cacraigucar/atmos_phys_zm_cleanup3a
Browse files Browse the repository at this point in the history
Remove 0.5*timestep logic from call to zm
  • Loading branch information
cacraigucar authored Aug 15, 2024
2 parents 0985859 + 68dc166 commit 9602e82
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
28 changes: 28 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@

===============================================================

Tag name: atmos_phys0_04_001
Originator(s): cacraig
Date: Aug 15, 2024
One-line Summary: Remove 0.5*timestep logic from call to zm
Github PR URL: https://github.com/ESCOMP/atmospheric_physics/pull/109

This PR fixes the following NCAR/atmospheric_physics Github issues:
none

Code reviewed by: adamrher, peverwhee

List all existing files that have been added (A), modified (M), or deleted (D),
and describe the changes:
M zhang_mcfarlane/zm_conv_convtran.F90
M zhang_mcfarlane/zm_conv_convtran.meta
M zhang_mcfarlane/zm_conv_momtran.F90
M zhang_mcfarlane/zm_convr.F90
- remove all the modifications that were being done because 0.5*timestep was being passed in

List and Describe any test failures: N/A

Summarize any changes to answers:
Adam Herrington ran with these changes and determined they were roundoff (see PR for more details)

===============================================================
===============================================================

Tag name:
Expand Down
5 changes: 1 addition & 4 deletions zhang_mcfarlane/zm_conv_convtran.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, &
doconvtran,q ,ncnst ,mu ,md , &
du ,eu ,ed ,dp ,dsubcld , &
jt ,mx ,ideep ,il1g ,il2g , &
nstep ,fracis ,dqdt ,dpdry ,dt )
nstep ,fracis ,dqdt ,dpdry)
!-----------------------------------------------------------------------
!
! Purpose:
Expand Down Expand Up @@ -68,9 +68,6 @@ subroutine zm_conv_convtran_run(ncol, pver, &

real(kind_phys), intent(in) :: dpdry(:,:) ! Delta pressure between interfaces (ncol,pver)

real(kind_phys), intent(in) :: dt ! 2 delta t (model time increment)


! input/output

real(kind_phys), intent(out) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst)
Expand Down
6 changes: 0 additions & 6 deletions zhang_mcfarlane/zm_conv_convtran.meta
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,3 @@
type = real | kind = kind_phys
dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension)
intent = in
[ dt ]
standard_name = timestep_for_physics
units = s
type = real | kind = kind_phys
dimensions = ()
intent = in
4 changes: 2 additions & 2 deletions zhang_mcfarlane/zm_conv_momtran.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, &
real(kind_phys), intent(in) :: ed(:,:) ! Mass entraining from downdraft (ncol,pver)
real(kind_phys), intent(in) :: dp(:,:) ! Delta pressure between interfaces (ncol,pver)
real(kind_phys), intent(in) :: dsubcld(:) ! Delta pressure from cloud base to sfc (ncol)
real(kind_phys), intent(in) :: dt ! time step in seconds : 2*delta_t
real(kind_phys), intent(in) :: dt ! time step in seconds

integer, intent(in) :: jt(:) ! Index of cloud top for each column (ncol)
integer, intent(in) :: mx(:) ! Index of cloud top for each column (ncol)
Expand Down Expand Up @@ -415,7 +415,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, &
ketend_cons = (fket-fkeb)/dp(i,k)

! tendency in kinetic energy resulting from the momentum transport
ketend = ((windf(i,k,1)**2 + windf(i,k,2)**2) - (wind0(i,k,1)**2 + wind0(i,k,2)**2))*0.5_kind_phys/dt
ketend = ((windf(i,k,1)**2 + windf(i,k,2)**2) - (wind0(i,k,1)**2 + wind0(i,k,2)**2))/dt

! the difference should be the dissipation
gset2 = ketend_cons - ketend
Expand Down
8 changes: 4 additions & 4 deletions zhang_mcfarlane/zm_convr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ subroutine zm_convr_run( ncol ,pver , &

do i=1,lengath
if (mumax(i) > 0._kind_phys) then
mb(i) = min(mb(i),0.5_kind_phys/(delt*mumax(i)))
mb(i) = min(mb(i),1._kind_phys/(delt*mumax(i)))
else
mb(i) = 0._kind_phys
endif
Expand Down Expand Up @@ -770,7 +770,7 @@ subroutine zm_convr_run( ncol ,pver , &
!
! q is updated to compute net precip.
!
q(ideep(i),k) = qh(ideep(i),k) + 2._kind_phys*delt*dqdt(i,k)
q(ideep(i),k) = qh(ideep(i),k) + delt*dqdt(i,k)
qtnd(ideep(i),k) = dqdt (i,k)
cme (ideep(i),k) = cmeg (i,k)
rprd(ideep(i),k) = rprdg(i,k)
Expand All @@ -785,13 +785,13 @@ subroutine zm_convr_run( ncol ,pver , &
! Compute precip by integrating change in water vapor minus detrained cloud water
do k = pver,msg + 1,-1
do i = 1,ncol
prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k)+dif(i,k))*2._kind_phys*delt
prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k)+dif(i,k))*delt
end do
end do

! obtain final precipitation rate in m/s.
do i = 1,ncol
prec(i) = rgrav*max(prec(i),0._kind_phys)/ (2._kind_phys*delt)/1000._kind_phys
prec(i) = rgrav*max(prec(i),0._kind_phys)/ delt/1000._kind_phys
end do

! Compute reserved liquid (not yet in cldliq) for energy integrals.
Expand Down

0 comments on commit 9602e82

Please sign in to comment.