Skip to content

Commit ae22dce

Browse files
gsl/develop RRFS-Smoke (#141)
* "add for smoke" * "update to pass GNU compiler" * "following Joe's comments to add nchem,ndvel as input to MYNN" * "update fv3atm to point to gsl/develop-smoke" * "to point to physics branch of gsl/develop-smoke" * Point to gsl/develop-smoke for ccpp-physics * "point ot gsl/develop-smoke branch" * "update GFS_typedefs.meta with rrfs_smoke active flag" * "update the 3rd dimension readin of GBBEPx for smoke" * Remove an extra read that went out of bounds * Point to NOAA-GSL gsl/develop for ccpp-physics Co-authored-by: samuel.trahan <Samuel.Trahan@noaa.gov>
1 parent 6f60c52 commit ae22dce

6 files changed

+854
-3
lines changed

ccpp/config/ccpp_prebuild_config.py

+4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@
187187
'physics/physics/sfc_sice.f',
188188
# HAFS FER_HIRES
189189
'physics/physics/mp_fer_hires.F90',
190+
# SMOKE
191+
'physics/smoke/rrfs_smoke_wrapper.F90',
192+
'physics/smoke/rrfs_smoke_postpbl.F90',
193+
'physics/smoke/rrfs_smoke_lsdep_wrapper.F90',
190194
# RRTMGP
191195
'physics/physics/rrtmgp_lw_gas_optics.F90',
192196
'physics/physics/rrtmgp_lw_cloud_optics.F90',

ccpp/data/GFS_typedefs.F90

+151-2
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ module GFS_typedefs
247247
real (kind=kind_phys), pointer :: snodi (:) => null() !< snow depth over ice
248248
real (kind=kind_phys), pointer :: weasdi (:) => null() !< weasd over ice
249249
real (kind=kind_phys), pointer :: hprime (:,:) => null() !< orographic metrics
250+
real (kind=kind_phys), pointer :: dust12m_in (:,:,:) => null() !< fengsha dust input
251+
real (kind=kind_phys), pointer :: emi_in (:,:) => null() !< anthropogenic background input
252+
real (kind=kind_phys), pointer :: smoke_GBBEPx(:,:,:) => null() !< GBBEPx fire input
250253
real (kind=kind_phys), pointer :: z0base (:) => null() !< background or baseline surface roughness length in m
251254
real (kind=kind_phys), pointer :: semisbase(:) => null() !< background surface emissivity
252255
real (kind=kind_phys), pointer :: sfalb_lnd (:) => null() !< surface albedo over land for LSM
@@ -551,12 +554,42 @@ module GFS_typedefs
551554
real (kind=kind_phys), pointer :: nwfa2d (:) => null() !< instantaneous water-friendly sfc aerosol source
552555
real (kind=kind_phys), pointer :: nifa2d (:) => null() !< instantaneous ice-friendly sfc aerosol source
553556

557+
!--- aerosol surface emissions for Thompson microphysics & smoke
558+
real (kind=kind_phys), pointer :: emdust (:) => null() !< instantaneous dust emission
559+
real (kind=kind_phys), pointer :: emseas (:) => null() !< instantaneous sea salt emission
560+
real (kind=kind_phys), pointer :: emanoc (:) => null() !< instantaneous anthro. oc emission
561+
562+
!--- These 3 arrays are hourly, so their dimension is imx24 (output is hourly)
563+
real (kind=kind_phys), pointer :: ebb_smoke_hr(:) => null() !< hourly smoke emission
564+
real (kind=kind_phys), pointer :: frp_hr (:) => null() !< hourly FRP
565+
real (kind=kind_phys), pointer :: frp_std_hr (:) => null() !< hourly std. FRP
566+
567+
!--- For fire diurnal cycle
568+
real (kind=kind_phys), pointer :: fhist (:) => null() !< instantaneous fire coef_bb
569+
real (kind=kind_phys), pointer :: coef_bb_dc (:) => null() !< instantaneous fire coef_bb
570+
real (kind=kind_phys), pointer :: ebu_smoke (:,:) => null() !< 3D ebu array
571+
572+
!--- For smoke and dust optical extinction
573+
real (kind=kind_phys), pointer :: smoke_ext (:,:) => null() !< 3D aod array
574+
real (kind=kind_phys), pointer :: dust_ext (:,:) => null() !< 3D aod array
575+
!--- For MYNN PBL transport of smoke and dust
576+
real (kind=kind_phys), pointer :: chem3d (:,:,:) => null() !< 3D aod array
577+
578+
!--- Fire plume rise diagnostics
579+
real (kind=kind_phys), pointer :: min_fplume (:) => null() !< minimum plume rise level
580+
real (kind=kind_phys), pointer :: max_fplume (:) => null() !< maximum plume rise level
581+
!--- hourly fire potential index
582+
real (kind=kind_phys), pointer :: rrfs_hwp (:) => null() !< hourly fire potential index
583+
554584
!--- instantaneous quantities for chemistry coupling
555585
real (kind=kind_phys), pointer :: ushfsfci(:) => null() !< instantaneous upward sensible heat flux (w/m**2)
556586
real (kind=kind_phys), pointer :: qci_conv(:,:) => null() !< convective cloud condesate after rainout
557587
real (kind=kind_phys), pointer :: pfi_lsan(:,:) => null() !< instantaneous 3D flux of ice nonconvective precipitation (kg m-2 s-1)
558588
real (kind=kind_phys), pointer :: pfl_lsan(:,:) => null() !< instantaneous 3D flux of liquid nonconvective precipitation (kg m-2 s-1)
559589

590+
!--- instantaneous total moisture tendency for smoke coupling:
591+
real (kind=kind_phys), pointer :: dqdti (:,:) => null() !< rrfs_smoke=true only; instantaneous total moisture tendency (kg/kg/s)
592+
560593
contains
561594
procedure :: create => coupling_create !< allocate array data
562595
end type GFS_coupling_type
@@ -648,6 +681,7 @@ module GFS_typedefs
648681
logical :: cplwav !< default no cplwav collection
649682
logical :: cplwav2atm !< default no wav->atm coupling
650683
logical :: cplchm !< default no cplchm collection
684+
logical :: rrfs_smoke !< default no rrfs_smoke collection
651685
logical :: use_cice_alb !< default .false. - i.e. don't use albedo imported from the ice model
652686
logical :: cpl_imp_mrg !< default no merge import with internal forcings
653687
logical :: cpl_imp_dbg !< default no write import data to file post merge
@@ -1246,6 +1280,10 @@ module GFS_typedefs
12461280
integer :: nto2 !< tracer index for oxygen
12471281
integer :: ntwa !< tracer index for water friendly aerosol
12481282
integer :: ntia !< tracer index for ice friendly aerosol
1283+
integer :: ntsmoke !< tracer index for smoke
1284+
integer :: ntdust !< tracer index for dust
1285+
integer :: nchem !< number of prognostic chemical species (vertically mixied)
1286+
integer :: ndvel !< number of prognostic chemical species (which are deposited, usually =nchem)
12491287
integer :: ntchm !< number of prognostic chemical tracers (advected)
12501288
integer :: ntchs !< tracer index for first prognostic chemical tracer
12511289
integer :: ntche !< tracer index for last prognostic chemical tracer
@@ -1284,6 +1322,22 @@ module GFS_typedefs
12841322
integer :: npsdelt !< the index of surface air pressure at the previous timestep for Z-C MP in phy_f2d
12851323
integer :: ncnvwind !< the index of surface wind enhancement due to convection for MYNN SFC and RAS CNV in phy f2d
12861324

1325+
!-- chem nml variables for RRFS-Smoke
1326+
integer :: seas_opt
1327+
integer :: dust_opt
1328+
integer :: biomass_burn_opt
1329+
integer :: drydep_opt
1330+
integer :: wetdep_ls_opt
1331+
logical :: do_plumerise
1332+
integer :: addsmoke_flag
1333+
integer :: plumerisefire_frq
1334+
logical :: smoke_forecast
1335+
logical :: aero_ind_fdb ! WFA/IFA indirect
1336+
logical :: aero_dir_fdb ! smoke/dust direct
1337+
logical :: rrfs_smoke_debug
1338+
logical :: mix_chem
1339+
logical :: fire_turb
1340+
12871341
!--- debug flags
12881342
logical :: debug
12891343
logical :: pre_rad !< flag for testing purpose
@@ -2379,6 +2433,9 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
23792433
allocate (Sfcprop%snodi (IM))
23802434
allocate (Sfcprop%weasdi (IM))
23812435
allocate (Sfcprop%hprime (IM,Model%nmtvr))
2436+
allocate (Sfcprop%dust12m_in (IM,12,5))
2437+
allocate (Sfcprop%smoke_GBBEPx(IM,24,3))
2438+
allocate (Sfcprop%emi_in (IM,1))
23822439
allocate(Sfcprop%albdirvis_lnd (IM))
23832440
allocate(Sfcprop%albdirnir_lnd (IM))
23842441
allocate(Sfcprop%albdifvis_lnd (IM))
@@ -2409,6 +2466,9 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
24092466
Sfcprop%snodi = clear_val
24102467
Sfcprop%weasdi = clear_val
24112468
Sfcprop%hprime = clear_val
2469+
Sfcprop%dust12m_in= clear_val
2470+
Sfcprop%emi_in = clear_val
2471+
Sfcprop%smoke_GBBEPx = clear_val
24122472
Sfcprop%albdirvis_lnd = clear_val
24132473
Sfcprop%albdirnir_lnd = clear_val
24142474
Sfcprop%albdifvis_lnd = clear_val
@@ -2976,7 +3036,7 @@ subroutine coupling_create (Coupling, IM, Model)
29763036
endif
29773037

29783038
! -- Aerosols coupling options
2979-
if (Model%cplchm) then
3039+
if (Model%cplchm .or. Model%rrfs_smoke) then
29803040
!--- outgoing instantaneous quantities
29813041
allocate (Coupling%ushfsfci (IM))
29823042
!--- accumulated convective rainfall
@@ -3039,6 +3099,42 @@ subroutine coupling_create (Coupling, IM, Model)
30393099
Coupling%nifa2d = clear_val
30403100
endif
30413101

3102+
if(Model%rrfs_smoke) then
3103+
!--- needed for smoke aerosol option
3104+
allocate (Coupling%emdust (IM))
3105+
allocate (Coupling%emseas (IM))
3106+
allocate (Coupling%emanoc (IM))
3107+
allocate (Coupling%ebb_smoke_hr (IM))
3108+
allocate (Coupling%frp_hr (IM))
3109+
allocate (Coupling%frp_std_hr(IM))
3110+
allocate (Coupling%fhist (IM))
3111+
allocate (Coupling%coef_bb_dc(IM))
3112+
allocate (Coupling%ebu_smoke (IM,Model%levs))
3113+
allocate (Coupling%smoke_ext (IM,Model%levs))
3114+
allocate (Coupling%dust_ext (IM,Model%levs))
3115+
allocate (Coupling%chem3d (IM,Model%levs,2))
3116+
allocate (Coupling%min_fplume(IM))
3117+
allocate (Coupling%max_fplume(IM))
3118+
allocate (Coupling%rrfs_hwp (IM))
3119+
allocate (Coupling%dqdti (IM,Model%levs))
3120+
Coupling%emdust = clear_val
3121+
Coupling%emseas = clear_val
3122+
Coupling%emanoc = clear_val
3123+
Coupling%ebb_smoke_hr = clear_val
3124+
Coupling%frp_hr = clear_val
3125+
Coupling%frp_std_hr = clear_val
3126+
Coupling%fhist = 1.
3127+
Coupling%coef_bb_dc = clear_val
3128+
Coupling%ebu_smoke = clear_val
3129+
Coupling%smoke_ext = clear_val
3130+
Coupling%dust_ext = clear_val
3131+
Coupling%chem3d = clear_val
3132+
Coupling%min_fplume = clear_val
3133+
Coupling%max_fplume = clear_val
3134+
Coupling%rrfs_hwp = clear_val
3135+
Coupling%dqdti = clear_val
3136+
endif
3137+
30423138
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
30433139
allocate (Coupling%qci_conv (IM,Model%levs))
30443140
Coupling%qci_conv = clear_val
@@ -3134,6 +3230,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
31343230
logical :: cplwav = .false. !< default no cplwav collection
31353231
logical :: cplwav2atm = .false. !< default no cplwav2atm coupling
31363232
logical :: cplchm = .false. !< default no cplchm collection
3233+
logical :: rrfs_smoke = .false. !< default no rrfs_smoke collection
31373234
logical :: use_cice_alb = .false. !< default no cice albedo
31383235
logical :: cpl_imp_mrg = .false. !< default no merge import with internal forcings
31393236
logical :: cpl_imp_dbg = .false. !< default no write import data to file post merge
@@ -3601,6 +3698,22 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
36013698
integer :: spp_gwd = 0
36023699
logical :: do_spp = .false.
36033700

3701+
!-- chem nml variables for RRFS-Smoke
3702+
integer :: seas_opt = 2
3703+
integer :: dust_opt = 5
3704+
integer :: biomass_burn_opt = 1
3705+
integer :: drydep_opt = 1
3706+
integer :: wetdep_ls_opt = 1
3707+
logical :: do_plumerise = .false.
3708+
integer :: addsmoke_flag = 1
3709+
integer :: plumerisefire_frq = 60
3710+
logical :: smoke_forecast = .false. ! RRFS-smoke diurnal
3711+
logical :: aero_ind_fdb = .false. ! RRFS-smoke wfa/ifa emission
3712+
logical :: aero_dir_fdb = .false. ! RRFS-smoke smoke/dust radiation feedback
3713+
logical :: rrfs_smoke_debug = .false. ! RRFS-smoke plumerise debug
3714+
logical :: mix_chem = .false. ! tracer mixing option by MYNN PBL
3715+
logical :: fire_turb = .false. ! enh vertmix option by MYNN PBL
3716+
36043717
!--- aerosol scavenging factors
36053718
integer, parameter :: max_scav_factors = 25
36063719
character(len=40) :: fscav_aero(max_scav_factors)
@@ -3617,7 +3730,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
36173730
thermodyn_id, sfcpress_id, &
36183731
!--- coupling parameters
36193732
cplflx, cplice, cplocn2atm, cplwav, cplwav2atm, cplchm, &
3620-
cpl_imp_mrg, cpl_imp_dbg, &
3733+
cpl_imp_mrg, cpl_imp_dbg, rrfs_smoke, &
36213734
use_cice_alb, &
36223735
#ifdef IDEA_PHYS
36233736
lsidea, weimer_model, f107_kp_size, f107_kp_interval, &
@@ -3731,6 +3844,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
37313844
phys_version, &
37323845
!--- aerosol scavenging factors ('name:value' string array)
37333846
fscav_aero, &
3847+
!--- RRFS smoke namelist
3848+
seas_opt, dust_opt, biomass_burn_opt, drydep_opt, &
3849+
wetdep_ls_opt, smoke_forecast, aero_ind_fdb, aero_dir_fdb, &
3850+
rrfs_smoke_debug, do_plumerise, plumerisefire_frq, &
3851+
addsmoke_flag, fire_turb, mix_chem, &
37343852
!--- (DFI) time ranges with radar-prescribed microphysics tendencies
37353853
! and (maybe) convection suppression
37363854
fh_dfi_radar, radar_tten_limits, do_cap_suppress
@@ -3933,6 +4051,23 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
39334051
Model%cpl_imp_mrg = cpl_imp_mrg
39344052
Model%cpl_imp_dbg = cpl_imp_dbg
39354053

4054+
!--- RRFS Smoke
4055+
Model%rrfs_smoke = rrfs_smoke
4056+
Model%seas_opt = seas_opt
4057+
Model%dust_opt = dust_opt
4058+
Model%biomass_burn_opt = biomass_burn_opt
4059+
Model%drydep_opt = drydep_opt
4060+
Model%wetdep_ls_opt = wetdep_ls_opt
4061+
Model%do_plumerise = do_plumerise
4062+
Model%plumerisefire_frq = plumerisefire_frq
4063+
Model%addsmoke_flag = addsmoke_flag
4064+
Model%smoke_forecast = smoke_forecast
4065+
Model%aero_ind_fdb = aero_ind_fdb
4066+
Model%aero_dir_fdb = aero_dir_fdb
4067+
Model%rrfs_smoke_debug = rrfs_smoke_debug
4068+
Model%mix_chem = mix_chem
4069+
Model%fire_turb = fire_turb
4070+
39364071
!--- integrated dynamics through earth's atmosphere
39374072
Model%lsidea = lsidea
39384073
if (Model%lsidea) then
@@ -4572,6 +4707,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
45724707
Model%nqrimef = get_tracer_index(Model%tracer_names, 'q_rimef', Model%me, Model%master, Model%debug)
45734708
Model%ntwa = get_tracer_index(Model%tracer_names, 'liq_aero', Model%me, Model%master, Model%debug)
45744709
Model%ntia = get_tracer_index(Model%tracer_names, 'ice_aero', Model%me, Model%master, Model%debug)
4710+
Model%ntsmoke = get_tracer_index(Model%tracer_names, 'smoke', Model%me, Model%master, Model%debug)
4711+
Model%ntdust = get_tracer_index(Model%tracer_names, 'dust', Model%me, Model%master, Model%debug)
45754712

45764713
!--- initialize parameters for atmospheric chemistry tracers
45774714
call Model%init_chemistry(tracer_types)
@@ -5471,13 +5608,20 @@ subroutine control_chemistry_initialize(Model, tracer_types)
54715608
integer :: n
54725609

54735610
!--- begin
5611+
Model%nchem = 0
5612+
Model%ndvel = 0
54745613
Model%ntchm = 0
54755614
Model%ntchs = NO_TRACER
54765615
Model%ntche = NO_TRACER
54775616
Model%ndchm = 0
54785617
Model%ndchs = NO_TRACER
54795618
Model%ndche = NO_TRACER
54805619

5620+
if (Model%rrfs_smoke) then
5621+
Model%nchem = 2
5622+
Model%ndvel = 2
5623+
endif
5624+
54815625
do n = 1, size(tracer_types)
54825626
select case (tracer_types(n))
54835627
case (1)
@@ -5608,6 +5752,7 @@ subroutine control_print(Model)
56085752
print *, ' cplwav : ', Model%cplwav
56095753
print *, ' cplwav2atm : ', Model%cplwav2atm
56105754
print *, ' cplchm : ', Model%cplchm
5755+
print *, ' rrfs_smoke : ', Model%rrfs_smoke
56115756
print *, ' use_cice_alb : ', Model%use_cice_alb
56125757
print *, ' cpl_imp_mrg : ', Model%cpl_imp_mrg
56135758
print *, ' cpl_imp_dbg : ', Model%cpl_imp_dbg
@@ -5976,6 +6121,10 @@ subroutine control_print(Model)
59766121
print *, ' nto2 : ', Model%nto2
59776122
print *, ' ntwa : ', Model%ntwa
59786123
print *, ' ntia : ', Model%ntia
6124+
print *, ' ntsmoke : ', Model%ntsmoke
6125+
print *, ' ntdust : ', Model%ntdust
6126+
print *, ' nchem : ', Model%nchem
6127+
print *, ' ndvel : ', Model%ndvel
59796128
print *, ' ntchm : ', Model%ntchm
59806129
print *, ' ntchs : ', Model%ntchs
59816130
print *, ' ntche : ', Model%ntche

0 commit comments

Comments
 (0)