Skip to content

Commit

Permalink
fix bug by adding a comma and add condensation/evap
Browse files Browse the repository at this point in the history
  • Loading branch information
ericaligo-NOAA committed May 25, 2021
1 parent 3932db1 commit 36b6487
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
33 changes: 26 additions & 7 deletions physics/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,8 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
ids,ide, jds,jde, kds,kde, & ! domain dims
ims,ime, jms,jme, kms,kme, & ! memory dims
its,ite, jts,jte, kts,kte, & ! tile dims
errmsg, errflg, reset, vts1)
errmsg, errflg, reset, vts1, prw_vcdc, &
prw_vcde)

implicit none

Expand All @@ -1028,7 +1029,8 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
its,ite, jts,jte, kts,kte
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
qv, qc, qr, qi, qs, qg, ni, nr
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: vts1
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
vts1,prw_vcdc,prw_vcde

REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT):: &
tt, th
Expand Down Expand Up @@ -1069,7 +1071,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
nr1d, nc1d, nwfa1d, nifa1d, &
t1d, p1d, w1d, dz1d, rho, dBZ
REAL, DIMENSION(kts:kte):: vtsk1
REAL, DIMENSION(kts:kte):: vtsk1,prw_vcdc1,prw_vcde1

REAL, DIMENSION(kts:kte):: re_qc1d, re_qi1d, re_qs1d
#if ( WRF_CHEM == 1 )
Expand Down Expand Up @@ -1266,6 +1268,10 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
rho(k) = 0.622*p1d(k)/(R*t1d(k)*(qv1d(k)+0.622))
vtsk1(k) = 0.
vts1(i,k,j) = 0.
prw_vcdc1(k) = 0.
prw_vcdc(i,k,j) = 0.
prw_vcde1(k) = 0.
prw_vcde(i,k,j) = 0.
enddo
if (is_aerosol_aware) then
do k = kts, kte
Expand All @@ -1289,7 +1295,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
rainprod1d, evapprod1d, &
#endif
rand1, rand2, rand3, &
kts, kte, dt, i, j, vtsk1)
kts, kte, dt, i, j, vtsk1, prw_vcdc1, prw_vcde1)

pcp_ra(i,j) = pptrain
pcp_sn(i,j) = pptsnow
Expand Down Expand Up @@ -1343,7 +1349,10 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
qg(i,k,j) = qg1d(k)
ni(i,k,j) = ni1d(k)
nr(i,k,j) = nr1d(k)
vts1(i,k,j) = vtsk1(k)
vts1(i,k,j) = vtsk1(k)
prw_vcdc(i,k,j) = prw_vcdc1(k)
prw_vcde(i,k,j) = prw_vcde1(k)

if (present(tt)) then;
tt(i,k,j) = t1d(k)
else
Expand Down Expand Up @@ -1557,7 +1566,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
rainprod, evapprod, &
#endif
rand1, rand2, rand3, &
kts, kte, dt, ii, jj, vtsk1)
kts, kte, dt, ii, jj, vtsk1, prw_vcdc1, prw_vcde1)
#ifdef MPI
use mpi
#endif
Expand All @@ -1572,7 +1581,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
REAL, INTENT(INOUT):: pptrain, pptsnow, pptgraul, pptice
REAL, INTENT(IN):: dt
REAL, INTENT(IN):: rand1, rand2, rand3
REAL, DIMENSION(kts:kte), INTENT(OUT):: vtsk1
REAL, DIMENSION(kts:kte), INTENT(OUT):: vtsk1,prw_vcdc1,prw_vcde1

#if ( WRF_CHEM == 1 )
REAL, DIMENSION(kts:kte), INTENT(INOUT):: &
Expand Down Expand Up @@ -3371,6 +3380,8 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
vtck(k) = 0.
vtnck(k) = 0.
vtsk1(k) = 0.
prw_vcdc1(k) = 0.
prw_vcde1(k) = 0.
enddo

if (ANY(L_qr .eqv. .true.)) then
Expand Down Expand Up @@ -3790,6 +3801,14 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
qg1d(k) = qg1d(k) + qgten(k)*DT
if (qg1d(k) .le. R1) qg1d(k) = 0.0
enddo
! Diagnostics
do k = kts, kte
if(prw_vcd(k).gt.0)then
prw_vcdc1(k) = prw_vcd(k)*dt
elseif(prw_vcd(k).lt.0)then
prw_vcde1(k) = -1*prw_vcd(k)*dt
endif
enddo

end subroutine mp_thompson
!>@}
Expand Down
17 changes: 12 additions & 5 deletions physics/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
its,ite, jts,jte, kts,kte

!Auxillary fields
real(kind_phys) :: vts1(1:ncol,1:nlev)
real(kind_phys) :: vts1(1:ncol,1:nlev),prw_vcdc(1:ncol,1:nlev),prw_vcde(1:ncol,1:nlev)

! Initialize the CCPP error handling variables
errmsg = ''
Expand Down Expand Up @@ -572,7 +572,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1)
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1, &
prw_vcdc=prw_vcdc, prw_vcde=prw_vcde)
else
call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, &
Expand All @@ -591,7 +592,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1)
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1, &
prw_vcdc=prw_vcdc, prw_vcde=prw_vcde)
end if
else
if (do_effective_radii) then
Expand All @@ -612,7 +614,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1)
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1, &
prw_vcdc=prw_vcdc, prw_vcde=prw_vcde)
else
call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, &
tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, &
Expand All @@ -630,7 +633,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, &
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1)
errmsg=errmsg, errflg=errflg, reset=reset, vts1=vts1, &
prw_vcdc=prw_vcdc, prw_vcde=prw_vcde)
end if
end if
if (errflg/=0) return
Expand Down Expand Up @@ -661,7 +665,10 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ice = ice + max(0.0, delta_ice_mp/1000.0_kind_phys)
snow = snow + max(0.0, delta_snow_mp/1000.0_kind_phys)
rain = rain + max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys)
!Diagnostics
aux3d(:,:,1) = vts1
aux3d(:,:,2) = aux3d(:,:,2) + prw_vcdc
aux3d(:,:,3) = aux3d(:,:,3) + prw_vcde
end subroutine mp_thompson_run
!>@}

Expand Down

0 comments on commit 36b6487

Please sign in to comment.