Skip to content

Commit

Permalink
move aero_ind_fdb variable in argument list for mp_gt_driver; add che…
Browse files Browse the repository at this point in the history
…ck for optional variable
  • Loading branch information
Grant Firl authored and Grant Firl committed Sep 9, 2022
1 parent 815438c commit 8cfde78
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions physics/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ END SUBROUTINE thompson_init
!> @{
SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
nwfa, nifa, nwfa2d, nifa2d, &
aero_ind_fdb, tt, th, pii, &
tt, th, pii, &
p, w, dz, dt_in, dt_inner, &
sedi_semi, decfl, &
RAINNC, RAINNCV, &
Expand All @@ -982,7 +982,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
vt_dbz_wt, first_time_step, &
re_cloud, re_ice, re_snow, &
has_reqc, has_reqi, has_reqs, &
rand_perturb_on, &
aero_ind_fdb, rand_perturb_on, &
kme_stoch, &
rand_pert, spp_prt_list, spp_var_list, &
spp_stddev_cutoff, n_var_spp, &
Expand Down Expand Up @@ -1025,7 +1025,6 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT):: &
nc, nwfa, nifa
REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(IN):: nwfa2d, nifa2d
LOGICAL, OPTIONAL, INTENT(IN):: aero_ind_fdb
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT):: &
re_cloud, re_ice, re_snow
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: pfils, pflls
Expand Down Expand Up @@ -1059,6 +1058,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
LOGICAL, INTENT (IN) :: reset_dBZ
! Extended diagnostics, array pointers only associated if ext_diag flag is .true.
LOGICAL, INTENT (IN) :: ext_diag
LOGICAL, OPTIONAL, INTENT(IN):: aero_ind_fdb
REAL, DIMENSION(:,:,:), INTENT(INOUT):: &
!vts1, txri, txrc, &
prw_vcdc, &
Expand Down Expand Up @@ -1466,10 +1466,15 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
!.. Changed 13 May 2013 to fake emissions in which nwfa2d is aerosol
!.. number tendency (number per kg per second).
if (is_aerosol_aware) then
if ( .not. aero_ind_fdb) then
nwfa1d(kts) = nwfa1d(kts) + nwfa2d(i,j)*dt
nifa1d(kts) = nifa1d(kts) + nifa2d(i,j)*dt
endif
if ( PRESENT (aero_ind_fdb) ) then
if ( .not. aero_ind_fdb) then
nwfa1d(kts) = nwfa1d(kts) + nwfa2d(i,j)*dt
nifa1d(kts) = nifa1d(kts) + nifa2d(i,j)*dt
endif
else
nwfa1d(kts) = nwfa1d(kts) + nwfa2d(i,j)*dt
nifa1d(kts) = nifa1d(kts) + nifa2d(i,j)*dt
end if

do k = kts, kte
nc(i,k,j) = nc1d(k)
Expand Down
4 changes: 2 additions & 2 deletions physics/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
if (is_aerosol_aware) then
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, &
aero_ind_fdb=aero_ind_fdb, &
tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
sedi_semi=sedi_semi, decfl=decfl, &
rainnc=rain_mp, rainncv=delta_rain_mp, &
Expand All @@ -664,7 +663,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
refl_10cm=refl_10cm, &
diagflag=diagflag, do_radar_ref=do_radar_ref_mp, &
has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, &
rand_perturb_on=spp_mp_opt, kme_stoch=kme_stoch, &
aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, &
kme_stoch=kme_stoch, &
rand_pert=spp_wts_mp, spp_var_list=spp_var_list, &
spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, &
spp_stddev_cutoff=spp_stddev_cutoff, &
Expand Down

0 comments on commit 8cfde78

Please sign in to comment.