Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 311 additions & 14 deletions physics/MP/Thompson/module_mp_thompson.F90

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions physics/MP/Thompson/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ subroutine mp_thompson_init(ncol, nlev, con_pi, con_t0c, con_rv, &
imp_physics_thompson, convert_dry_rho, &
spechum, qc, qr, qi, qs, qg, ni, nr, &
is_aerosol_aware, merra2_aerosol_aware, &
do_wetrm_thmp, aero_ind_fdb, &
nc, nwfa2d, nifa2d, &
nwfa, nifa, tgrs, prsl, phil, area, &
aerfld, mpicomm, mpirank, mpiroot, &
Expand Down Expand Up @@ -70,6 +71,7 @@ subroutine mp_thompson_init(ncol, nlev, con_pi, con_t0c, con_rv, &
! Aerosols
logical, intent(in ) :: is_aerosol_aware
logical, intent(in ) :: merra2_aerosol_aware
logical, intent(in ) :: do_wetrm_thmp, aero_ind_fdb
real(kind_phys), intent(inout) :: nc(:,:)
real(kind_phys), intent(inout) :: nwfa(:,:)
real(kind_phys), intent(inout) :: nifa(:,:)
Expand Down Expand Up @@ -149,6 +151,8 @@ subroutine mp_thompson_init(ncol, nlev, con_pi, con_t0c, con_rv, &
! Call Thompson init
call thompson_init(is_aerosol_aware_in=is_aerosol_aware, &
merra2_aerosol_aware_in=merra2_aerosol_aware, &
do_wetrm_thmp_in=do_wetrm_thmp, &
aero_ind_fdb_in=aero_ind_fdb, &
mpicomm=mpicomm, mpirank=mpirank, mpiroot=mpiroot, &
threads=threads, errmsg=errmsg, errflg=errflg)
if (errflg /= 0) return
Expand Down Expand Up @@ -342,6 +346,7 @@ end subroutine mp_thompson_init
subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
con_eps, convert_dry_rho, &
spechum, qc, qr, qi, qs, qg, ni, nr, &
ndvel, chem3d, &
is_aerosol_aware, &
merra2_aerosol_aware, nc, nwfa, nifa,&
nwfa2d, nifa2d, aero_ind_fdb, &
Expand All @@ -359,6 +364,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
spp_prt_list, spp_var_list, &
spp_stddev_cutoff, &
cplchm, pfi_lsan, pfl_lsan, &
do_wetrm_thmp, wetdpr_flux, &
errmsg, errflg)

implicit none
Expand All @@ -371,6 +377,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
real(kind_phys), intent(in ) :: con_g
real(kind_phys), intent(in ) :: con_rd
real(kind_phys), intent(in ) :: con_eps
integer, optional, intent(in ) :: ndvel
! Hydrometeors
logical, intent(in ) :: convert_dry_rho
real(kind_phys), intent(inout) :: spechum(:,:)
Expand All @@ -384,13 +391,15 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
! Aerosols
logical, intent(in) :: is_aerosol_aware, fullradar_diag
logical, intent(in) :: merra2_aerosol_aware
logical, intent(in) :: do_wetrm_thmp
real(kind_phys), optional, intent(inout) :: nc(:,:)
real(kind_phys), optional, intent(inout) :: nwfa(:,:)
real(kind_phys), optional, intent(inout) :: nifa(:,:)
real(kind_phys), optional, intent(in ) :: nwfa2d(:)
real(kind_phys), optional, intent(in ) :: nifa2d(:)
real(kind_phys), intent(in) :: aerfld(:,:,:)
logical, optional, intent(in ) :: aero_ind_fdb
real(kind_phys), optional, intent(inout) :: wetdpr_flux(:,:)
! State variables and timestep information
real(kind_phys), intent(inout) :: tgrs(:,:)
real(kind_phys), intent(in ) :: prsl(:,:)
Expand Down Expand Up @@ -440,6 +449,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
! ice and liquid water 3d precipitation fluxes - only allocated if cplchm is .true.
real(kind=kind_phys), intent(inout), dimension(:,:) :: pfi_lsan
real(kind=kind_phys), intent(inout), dimension(:,:) :: pfl_lsan
real(kind=kind_phys), optional, dimension(:,:,:), intent(inout) :: chem3d

! Local variables

Expand Down Expand Up @@ -553,6 +563,15 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
errflg = 1
return
end if
if ( do_wetrm_thmp .and. .not. (present(chem3d) .and. &
present(wetdpr_flux))) then
write(errmsg,fmt='(*(a))') 'Logic error in mp_thompson_run:', &
' aerosol-aware microphysics with wet removal ', &
' requires the following optional arguments: ', &
' chem3d, wetdpr_flux'
errflg = 1
return
endif
! Consistency cheecks - subcycling and inner loop at the same time are not supported
if (nsteps>1 .and. dt_inner < dtp) then
write(errmsg,'(*(a))') "Logic error: Subcycling and inner loop cannot be used at the same time"
Expand Down Expand Up @@ -752,6 +771,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
if (is_aerosol_aware .or. merra2_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, &
ndvel=ndvel,chem3d=chem3d,wetdpr_flux=wetdpr_flux, &
tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, &
sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
rainnc=rain_mp, rainncv=delta_rain_mp, &
Expand Down Expand Up @@ -794,6 +814,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
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=dtstep, dt_inner=dt_inner, &
ndvel=ndvel, &
sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, &
rainnc=rain_mp, rainncv=delta_rain_mp, &
snownc=snow_mp, snowncv=delta_snow_mp, &
Expand Down
44 changes: 44 additions & 0 deletions physics/MP/Thompson/mp_thompson.meta
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,20 @@
dimensions = ()
type = logical
intent = in
[do_wetrm_thmp]
standard_name = do_aerosol_wet_removal_thompson
long_name = flag for wet removal of aerosols in Thompson MP
units = flag
dimensions = ()
type = logical
intent = in
[aero_ind_fdb]
standard_name = do_smoke_aerosol_indirect_feedback
long_name = flag for wfa ifa emission indirect feedback
units = flag
dimensions = ()
type = logical
intent = in
[nc]
standard_name = mass_number_concentration_of_cloud_liquid_water_particles_in_air
long_name = cloud droplet number concentration
Expand Down Expand Up @@ -493,6 +507,21 @@
type = real
kind = kind_phys
intent = inout
[ndvel]
standard_name = number_of_chemical_species_deposited
long_name = number of chemical pbl deposited
units = count
dimensions = ()
type = integer
intent = in
[chem3d]
standard_name = chem3d_mynn_pbl_transport
long_name = mynn pbl transport of smoke and dust
units = various
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_chemical_species_vertically_mixed)
type = real
kind = kind_phys
intent = inout
[is_aerosol_aware]
standard_name = flag_for_aerosol_physics
long_name = flag for aerosol-aware physics
Expand Down Expand Up @@ -848,6 +877,21 @@
type = real
kind = kind_phys
intent = inout
[do_wetrm_thmp]
standard_name = do_aerosol_wet_removal_thompson
long_name = flag for wet removal of aerosols in Thompson MP
units = flag
dimensions = ()
type = logical
intent = in
[wetdpr_flux]
standard_name = mp_wet_deposition_smoke_dust
long_name = large scale wet deposition of smoke and dust
units = kg kg-1
dimensions = (horizontal_loop_extent,number_of_chemical_species_vertically_mixed)
type = real
kind = kind_phys
intent = inout
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
3 changes: 3 additions & 0 deletions physics/smoke_dust/dep_data_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ module dep_data_mod
! starting standard surface temperature [ K ]
REAL(kind_phys), PARAMETER :: tss0=288.15
REAL(kind_phys), PARAMETER :: sigma1 = 1.8
REAL(kind_phys), PARAMETER :: mean_diameter2 = 1.e-6
REAL(kind_phys), PARAMETER :: sigma2 = 1.8
REAL(kind_phys), PARAMETER :: mean_diameter1 = 4.e-8
REAL(kind_phys), PARAMETER :: fact_wfa = 1.e-9*6.0/pirs*exp(4.5*log(sigma1)**2)/mean_diameter1**3
REAL(kind_phys), PARAMETER :: fact_ifa = 1.e-9*6.0/pirs*exp(4.5*log(sigma2)**2)/mean_diameter2**3
REAL(kind_phys), PARAMETER :: sginia=2.00
! initial sigma-G for nucleimode
REAL(kind_phys), PARAMETER :: sginin=1.70
Expand Down
11 changes: 6 additions & 5 deletions physics/smoke_dust/module_wetdep_ls.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module module_wetdep_ls
use rrfs_smoke_config, only : p_smoke, p_dust_1, p_coarse_pm, p_qc, alpha => wetdep_ls_alpha

contains
subroutine wetdep_ls(dt,var,rain,moist, &
subroutine wetdep_ls(dt,var,rain,moist,p_phy, &
rho,nchem,num_moist,ndvel,dz8w,vvel, &
wetdpr_smoke, wetdpr_dust, wetdpr_coarsepm, &
ids,ide, jds,jde, kds,kde, &
Expand All @@ -20,7 +20,7 @@ subroutine wetdep_ls(dt,var,rain,moist,
its,ite, jts,jte, kts,kte
real(kind_phys), intent(in) :: dt
real(kind_phys), dimension( ims:ime, kms:kme, jms:jme, num_moist),intent(in) :: moist
real(kind_phys), dimension( ims:ime, kms:kme, jms:jme),intent(in) :: rho,dz8w,vvel
real(kind_phys), dimension( ims:ime, kms:kme, jms:jme),intent(in) :: rho,dz8w,vvel,p_phy
real(kind_phys), dimension( ims:ime, kms:kme, jms:jme,1:nchem),intent(inout) :: var
real(kind_phys), dimension( ims:ime, jms:jme ), intent(out) :: &
wetdpr_smoke, wetdpr_dust, wetdpr_coarsepm
Expand Down Expand Up @@ -83,11 +83,12 @@ subroutine wetdep_ls(dt,var,rain,moist,
dvar=alpha*factor/(1+factor)*var(i,k,j,nv)
! Accumulate diags
if (nv .eq. p_smoke ) then
wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * rho(i,k,j) / dt
wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * (p_phy(i,k,j) - p_phy(i,k+1,j))*100. / ( 9.8 * dt )
! wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * rho(i,k,j) * dz8w(i,k,j) / dt
elseif (nv .eq. p_dust_1 ) then
wetdpr_dust(i,j) = wetdpr_dust(i,j) + dvar * rho(i,k,j) / dt
wetdpr_dust(i,j) = wetdpr_dust(i,j) + dvar * (p_phy(i,k,j) - p_phy(i,k+1,j))*100. / ( 9.8 * dt )
elseif (nv .eq. p_coarse_pm ) then
wetdpr_coarsepm(i,j) = wetdpr_coarsepm(i,j) + dvar * rho(i,k,j) / dt
wetdpr_coarsepm(i,j) = wetdpr_coarsepm(i,j) + dvar * (p_phy(i,k,j) - p_phy(i,k+1,j))*100. / ( 9.8 * dt )
endif
var(i,k,j,nv)=max(1.e-16,var(i,k,j,nv)-dvar)
endif
Expand Down
10 changes: 5 additions & 5 deletions physics/smoke_dust/rrfs_smoke_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,

!>- large-scale wet deposition
if (wetdep_ls_opt == 1) then
call wetdep_ls(dt,chem,rnav,moist, &
call wetdep_ls(dt,chem,rnav,moist,p_phy, &
rho_phy,num_chem,num_moist,ndvel, dz8w,vvel,&
wetdpr_smoke_local, wetdpr_dust_local, &
wetdpr_coarsepm_local, &
Expand Down Expand Up @@ -933,10 +933,10 @@ subroutine rrfs_smoke_prep( &
windgustpot(i,1) = SFCWIND
uspdavg2d(i,1) = SFCWIND

! SRB - Adding safeguard for kpbl for first timestep
if (ktau==1) then
kpbl(i,1) = kpbl_thetav(i,1)
endif
! SRB - Adding safeguard for kpbl for first timestep
if (ktau==1) then
kpbl(i,1) = kpbl_thetav(i,1)
endif

if (kpbl(i,1)+1 .ge. kts+1 ) then
do k=kts+1,kpbl(i,1)+1 ! Use kpbl from MYNN
Expand Down