Skip to content

Commit

Permalink
complete code for mraerosol
Browse files Browse the repository at this point in the history
  • Loading branch information
AnningCheng-NOAA committed Sep 17, 2021
1 parent ab47e49 commit 8427992
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 12 deletions.
4 changes: 2 additions & 2 deletions physics/GFS_PBL_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module GFS_PBL_generic_common
contains

subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
imp_physics_thompson, ltaerosol,mraeorosol, &
imp_physics_thompson, ltaerosol,mraerosol, &
imp_physics_mg, ntgl, imp_physics_gfdl, &
imp_physics_zhao_carr, kk, &
errmsg, errflg)
Expand Down Expand Up @@ -176,7 +176,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
enddo
enddo
rtg_ozone_index = 10
elseif(ltaerosol) then
elseif(mraerosol) then
do k=1,levs
do i=1,im
vdftra(i,k,1) = qgrs(i,k,ntqv)
Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
enddo
enddo
else if (imp_physics == imp_physics_thompson .and. mraerosol) then
do k=1,LMK
do k=1,LMK
do i=1,IM
qvs = qlyr(i,k)
qv_mp (i,k) = qvs/(1.-qvs)
Expand Down Expand Up @@ -779,7 +779,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
! Update number concentration, consistent with sub-grid clouds (GF, MYNN) or without (all others)
do k=1,lm
do i=1,im
if (ltaerosol .and. qc_mp(i,k)>1.e-12 .and. nc_mp(i,k)<100.) then
if ((ltaerosol .or. mraerosol) .and. qc_mp(i,k)>1.e-12 .and. nc_mp(i,k)<100.) then
nc_mp(i,k) = make_DropletNumber(qc_mp(i,k)*rho(i,k), nwfa(i,k)*rho(i,k)) * orho(i,k)
endif
if (qi_mp(i,k)>1.e-12 .and. ni_mp(i,k)<100.) then
Expand Down
8 changes: 8 additions & 0 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@
type = logical
intent = in
optional = F
[mraerosol]
standard_name = flag_for_merra2_aerosol_aware_for_thompson
long_name = flag for merra2 aerosol-aware physics for thompson microphysics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[lgfdlmprad]
standard_name = flag_for_GFDL_microphysics_radiation_interaction
long_name = flag for GFDL microphysics-radiation interaction
Expand Down
8 changes: 7 additions & 1 deletion physics/GFS_rrtmgp_thompsonmp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ subroutine GFS_rrtmgp_thompsonmp_pre_run(nCol, nLev, nTracers, ncnd, doSWrad, do
i_cldliq, i_cldice, i_cldrain, i_cldsnow, i_cldgrpl, i_cldtot, i_cldliq_nc, &
i_cldice_nc, i_twa, effr_in, p_lev, p_lay, tv_lay, t_lay, effrin_cldliq, &
effrin_cldice, effrin_cldsnow, tracer, qs_lay, q_lay, relhum, con_g, con_rd, &
con_eps, lmfshal, ltaerosol, do_mynnedmf, imfdeepcnv, imfdeepcnv_gf, &
con_eps, lmfshal, ltaerosol, mraerosol, do_mynnedmf, imfdeepcnv, imfdeepcnv_gf, &
doGP_cldoptics_PADE, doGP_cldoptics_LUT, &
cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, &
cld_rerain, precip_frac, errmsg, errflg)
Expand Down Expand Up @@ -69,6 +69,7 @@ subroutine GFS_rrtmgp_thompsonmp_pre_run(nCol, nLev, nTracers, ncnd, doSWrad, do
effr_in, & ! Use cloud effective radii provided by model?
lmfshal, & ! Flag for mass-flux shallow convection scheme used by Xu-Randall
ltaerosol, & ! Flag for aerosol option
mraerosol, & ! Flag for merra2 aerosol option
do_mynnedmf, & ! Flag to activate MYNN-EDMF
doGP_cldoptics_LUT,& ! Flag to do GP cloud-optics (LUTs)
doGP_cldoptics_PADE ! (PADE approximation)
Expand Down Expand Up @@ -165,6 +166,11 @@ subroutine GFS_rrtmgp_thompsonmp_pre_run(nCol, nLev, nTracers, ncnd, doSWrad, do
if (qc_mp(iCol,iLay) > 1.e-12 .and. nc_mp(iCol,iLay) < 100.) then
nc_mp(iCol,iLay) = make_DropletNumber(qc_mp(iCol,iLay)*rho, nwfa(iCol,iLay)*rho) * orho
endif
elseif (mraerosol) then
nc_mp(iCol,iLay) = tracer(iCol,iLay,i_cldliq_nc) / (1.-q_lay(iCol,iLay))
if (qc_mp(iCol,iLay) > 1.e-12 .and. nc_mp(iCol,iLay) < 100.) then
nc_mp(iCol,iLay) = make_DropletNumber(qc_mp(iCol,iLay)*rho, nwfa(iCol,iLay)*rho) * orho
endif
else
nc_mp(iCol,iLay) = nt_c*orho
endif
Expand Down
8 changes: 8 additions & 0 deletions physics/GFS_rrtmgp_thompsonmp_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@
type = logical
intent = in
optional = F
[mraerosol]
standard_name = flag_for_merra2_aerosol_aware_for_thompson
long_name = flag for merra2 aerosol-aware physics for thompson microphysics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[do_mynnedmf]
standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme
long_name = flag to activate MYNN-EDMF
Expand Down
10 changes: 6 additions & 4 deletions physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ end subroutine GFS_suite_interstitial_3_finalize
!! \htmlinclude GFS_suite_interstitial_3_run.html
!!
subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, &
satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, &
satmedmf, trans_trac, do_shoc, &
ltaerosol, mraerosol, ntrac, ntcw, &
ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, &
xlon, xlat, gt0, gq0, imp_physics, imp_physics_mg, &
imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, &
Expand All @@ -536,6 +537,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, &
imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me, index_of_process_conv_trans
integer, intent(in ), dimension(:) :: islmsk, kpbl, kinver
logical, intent(in ) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras
logical, intent(in ) :: mraerosol

integer, intent(in) :: ntinc, ntlnc
logical, intent(in) :: ldiag3d, qdiag3d
Expand Down Expand Up @@ -658,7 +660,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, &
save_tcp(i,k) = gt0(i,k)
enddo
enddo
if(ltaerosol) then
if(ltaerosol .or. mraerosol) then
save_qi(:,:) = clw(:,:,1)
save_qc(:,:) = clw(:,:,2)
else
Expand Down Expand Up @@ -699,7 +701,7 @@ end subroutine GFS_suite_interstitial_4_finalize
!> \section arg_table_GFS_suite_interstitial_4_run Argument Table
!! \htmlinclude GFS_suite_interstitial_4_run.html
!!
subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntrac, ntcw, ntiw, ntclamt, &
subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, mraerosol, tracers_total, ntrac, ntcw, ntiw, ntclamt, &
ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, &
imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, convert_dry_rho, dtf, save_qc, save_qi, con_pi, dtidx, dtend,&
index_of_process_conv_trans, gq0, clw, prsl, save_tcp, con_rd, con_eps, nwfa, spechum, ldiag3d, &
Expand All @@ -716,7 +718,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, &
imp_physics_zhao_carr, imp_physics_zhao_carr_pdf

logical, intent(in) :: ltaerosol, convert_dry_rho
logical, intent(in) :: ltaerosol, convert_dry_rho, mraerosol

real(kind=kind_phys), intent(in ) :: con_pi, dtf
real(kind=kind_phys), intent(in ), dimension(:,:) :: save_qc
Expand Down
16 changes: 16 additions & 0 deletions physics/GFS_suite_interstitial.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,14 @@
type = logical
intent = in
optional = F
[mraerosol]
standard_name = flag_for_merra2_aerosol_aware_for_thompson
long_name = flag for merra2 aerosol-aware physics for thompson microphysics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[ntrac]
standard_name = number_of_tracers
long_name = number of tracers
Expand Down Expand Up @@ -1695,6 +1703,14 @@
type = logical
intent = in
optional = F
[mraerosol]
standard_name = flag_for_merra2_aerosol_aware_for_thompson
long_name = flag for merra2 aerosol-aware physics for thompson microphysics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[tracers_total]
standard_name = number_of_total_tracers
long_name = total number of tracers
Expand Down
46 changes: 44 additions & 2 deletions physics/module_MYNNPBL_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
& icloud_bl, do_mynnsfclay, &
& imp_physics, imp_physics_gfdl, &
& imp_physics_thompson, imp_physics_wsm6, &
& ltaerosol, lprnt, errmsg, errflg )
& ltaerosol, mraerosol, lprnt, errmsg, errflg )

! should be moved to inside the mynn:
use machine , only : kind_phys
Expand Down Expand Up @@ -195,7 +195,8 @@ SUBROUTINE mynnedmf_wrapper_run( &
! NAMELIST OPTIONS (INPUT):
LOGICAL, INTENT(IN) :: bl_mynn_tkeadvect, ltaerosol, &
lprnt, do_mynnsfclay, &
flag_for_pbl_generic_tend
flag_for_pbl_generic_tend, &
mraerosol
INTEGER, INTENT(IN) :: &
& bl_mynn_cloudpdf, &
& bl_mynn_mixlength, &
Expand Down Expand Up @@ -426,6 +427,30 @@ SUBROUTINE mynnedmf_wrapper_run( &
qnifa(i,k) = qgrs_ice_aer_num_conc(i,k)
enddo
enddo
else if(mraerosol) then
FLAG_QI = .true.
FLAG_QNI= .true.
FLAG_QC = .true.
FLAG_QNC= .true.
FLAG_QNWFA= .false.
FLAG_QNIFA= .false.
p_qc = 2
p_qr = 0
p_qi = 2
p_qs = 0
p_qg = 0
p_qnc= 0
p_qni= 0
do k=1,levs
do i=1,im
sqv(i,k) = qgrs_water_vapor(i,k)
sqc(i,k) = qgrs_liquid_cloud(i,k)
sqi(i,k) = qgrs_ice_cloud(i,k)
qnc(i,k) = qgrs_cloud_droplet_num_conc(i,k)
qni(i,k) = qgrs_cloud_ice_num_conc(i,k)
ozone(i,k) = qgrs_ozone(i,k)
enddo
enddo
else
FLAG_QI = .true.
FLAG_QNI= .true.
Expand Down Expand Up @@ -816,6 +841,23 @@ SUBROUTINE mynnedmf_wrapper_run( &
! !qgrs_ice_aer_num_conc(i,k) = qgrs_ice_aer_num_conc(i,k) + RQNIFABLTEN(i,k)*delt
! enddo
!enddo
else if(mraerosol) then
do k=1,levs
do i=1,im
dqdt_water_vapor(i,k) = RQVBLTEN(i,k) !/(1.0 + qv(i,k))
dqdt_liquid_cloud(i,k) = RQCBLTEN(i,k) !/(1.0 + qv(i,k))
dqdt_cloud_droplet_num_conc(i,k) = RQNCBLTEN(i,k)
dqdt_ice_cloud(i,k) = RQIBLTEN(i,k) !/(1.0 + qv(i,k))
dqdt_ice_num_conc(i,k) = RQNIBLTEN(i,k)
enddo
enddo
if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then
call dtend_helper(100+ntqv,RQVBLTEN)
call dtend_helper(100+ntcw,RQCBLTEN)
call dtend_helper(100+ntlnc,RQNCBLTEN)
call dtend_helper(100+ntiw,RQIBLTEN)
call dtend_helper(100+ntinc,RQNIBLTEN)
endif
else
!Thompson (2008)
do k=1,levs
Expand Down
8 changes: 8 additions & 0 deletions physics/module_MYNNPBL_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,14 @@
type = logical
intent = in
optional = F
[mraerosol]
standard_name = flag_for_merra2_aerosol_aware_for_thompson
long_name = flag for merra2 aerosol-aware physics for thompson microphysics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[lprnt]
standard_name = flag_print
long_name = control flag for diagnostic print out
Expand Down

0 comments on commit 8427992

Please sign in to comment.