Skip to content

Commit

Permalink
Merge pull request #432 from grantfirl/ufs-dev-PR94
Browse files Browse the repository at this point in the history
UFS-dev PR#94
  • Loading branch information
grantfirl authored Mar 15, 2024
2 parents 481086f + 2da256f commit 1a8c988
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 29 deletions.
1 change: 1 addition & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
'ccpp/physics/physics/SFC_Layer/UFS/sfc_nst_post.f90',
'ccpp/physics/physics/SFC_Models/Land/RUC/lsm_ruc.F90',
'ccpp/physics/physics/SFC_Models/SeaIce/CICE/sfc_cice.f',
'ccpp/physics/physics/SFC_Models/Land/sfc_land.F90',
'ccpp/physics/physics/SFC_Models/Land/Noah/lsm_noah.f',
'ccpp/physics/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90',
'ccpp/physics/physics/SFC_Models/Lake/Flake/flake_driver.F90',
Expand Down
111 changes: 86 additions & 25 deletions scm/src/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,18 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: emanoc (:) => null() !< instantaneous anthro. oc emission

!--- Smoke. These 2 arrays are input smoke emission and frp
real (kind=kind_phys), pointer :: ebb_smoke_in(:) => null() !< input smoke emission
real (kind=kind_phys), pointer :: frp_input (:) => null() !< input FRP

real (kind=kind_phys), pointer :: ebb_smoke_in(:) => null() !< input smoke emission
real (kind=kind_phys), pointer :: frp_output (:) => null() !< output FRP
!--- For fire diurnal cycle
real (kind=kind_phys), pointer :: fhist (:) => null() !< instantaneous fire coef_bb
real (kind=kind_phys), pointer :: coef_bb_dc (:) => null() !< instantaneous fire coef_bb
integer, pointer :: fire_type (:) => null() !< fire type
real (kind=kind_phys), pointer :: peak_hr (:) => null() !< peak hour of fire emissions
real (kind=kind_phys), pointer :: lu_nofire (:) => null() !<lu_nofire pixels
real (kind=kind_phys), pointer :: lu_qfire (:) => null() !<lu_qfire pixels
!--- wildfire heat flux
real (kind=kind_phys), pointer :: fire_heat_flux_out (:) => null() !< heat flux from wildfire
real (kind=kind_phys), pointer :: frac_grid_burned_out (:) => null() !< fraction of grid cell burning
real (kind=kind_phys), pointer :: fire_heat_flux (:) => null() !< heat flux from wildfire
real (kind=kind_phys), pointer :: frac_grid_burned (:) => null() !< fraction of grid cell burning

!--- For smoke and dust auxiliary inputs
real (kind=kind_phys), pointer :: fire_in (:,:) => null() !< fire auxiliary inputs
Expand Down Expand Up @@ -529,6 +532,20 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: dtsfcin_med(:) => null() !< sfc latent heat flux over ocean
real (kind=kind_phys), pointer :: dqsfcin_med(:) => null() !< sfc sensible heat flux over ocean
real (kind=kind_phys), pointer :: ulwsfcin_med(:) => null() !< sfc upward lw flux over ocean
!--- variables needed for cpllnd = .TRUE. and cpllnd2atm=.TRUE.
real (kind=kind_phys), pointer :: sncovr1_lnd(:) => null() !< sfc snow area fraction over land
real (kind=kind_phys), pointer :: qsurf_lnd(:) => null() !< sfc specific humidity
real (kind=kind_phys), pointer :: evap_lnd(:) => null() !< sfc latent heat flux over land, converted to evaporative flux
real (kind=kind_phys), pointer :: hflx_lnd(:) => null() !< sfc sensible heat flux over land
real (kind=kind_phys), pointer :: ep_lnd(:) => null() !< sfc up pot latent heat flux over land
real (kind=kind_phys), pointer :: t2mmp_lnd(:) => null() !< 2 meter temperature over land
real (kind=kind_phys), pointer :: q2mp_lnd(:) => null() !< 2 meter spec humidity over land
real (kind=kind_phys), pointer :: gflux_lnd(:) => null() !< soil heat flux over land
real (kind=kind_phys), pointer :: runoff_lnd(:) => null() !< surface runoff over land
real (kind=kind_phys), pointer :: drain_lnd(:) => null() !< subsurface runoff over land
real (kind=kind_phys), pointer :: cmm_lnd(:) => null() !< surface drag wind speed for momentum
real (kind=kind_phys), pointer :: chh_lnd(:) => null() !< surface drag mass flux for heat and moisture
real (kind=kind_phys), pointer :: zvfun_lnd(:) => null() !< function of surface roughness length and green vegetation fraction

!--- outgoing accumulated quantities
real (kind=kind_phys), pointer :: rain_cpl (:) => null() !< total rain precipitation
Expand Down Expand Up @@ -609,10 +626,6 @@ module GFS_typedefs
!--- For fire diurnal cycle
real (kind=kind_phys), pointer :: ebu_smoke (:,:) => null() !< 3D ebu array

!--- For smoke and dust optical extinction
real (kind=kind_phys), pointer :: smoke_ext (:,:) => null() !< 3D aod array
real (kind=kind_phys), pointer :: dust_ext (:,:) => null() !< 3D aod array

!--- For MYNN PBL transport of smoke and dust
real (kind=kind_phys), pointer :: chem3d (:,:,:) => null() !< 3D aod array
real (kind=kind_phys), pointer :: ddvel (:,: ) => null() !< 2D dry deposition velocity
Expand All @@ -626,6 +639,8 @@ module GFS_typedefs
!--- Fire plume rise diagnostics
real (kind=kind_phys), pointer :: min_fplume (:) => null() !< minimum plume rise level
real (kind=kind_phys), pointer :: max_fplume (:) => null() !< maximum plume rise level
real (kind=kind_phys), pointer :: uspdavg (:) => null() !< BL average wind speed
real (kind=kind_phys), pointer :: hpbl_thetav (:) => null() !< BL depth parcel method
!--- hourly fire potential index
real (kind=kind_phys), pointer :: rrfs_hwp (:) => null() !< hourly fire potential index
real (kind=kind_phys), pointer :: rrfs_hwp_ave (:) => null() !< *Average* hourly fire potential index
Expand Down Expand Up @@ -734,6 +749,7 @@ module GFS_typedefs
logical :: cplaqm !< default no cplaqm collection
logical :: cplchm !< default no cplchm collection
logical :: cpllnd !< default no cpllnd collection
logical :: cpllnd2atm !< default no lnd->atm coupling
logical :: rrfs_sd !< default no rrfs_sd collection
logical :: use_cice_alb !< default .false. - i.e. don't use albedo imported from the ice model
logical :: cpl_imp_mrg !< default no merge import with internal forcings
Expand Down Expand Up @@ -1522,6 +1538,7 @@ module GFS_typedefs
logical :: do_plumerise
integer :: addsmoke_flag
integer :: plumerisefire_frq
integer :: n_dbg_lines
integer :: smoke_forecast
logical :: aero_ind_fdb ! WFA/IFA indirect
logical :: aero_dir_fdb ! smoke/dust direct
Expand Down Expand Up @@ -2678,8 +2695,8 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%acsnow_land (IM))
allocate (Sfcprop%acsnow_ice (IM))
allocate (Sfcprop%xlaixy (IM))
allocate (Sfcprop%fire_heat_flux_out (IM))
allocate (Sfcprop%frac_grid_burned_out (IM))
allocate (Sfcprop%fire_heat_flux (IM))
allocate (Sfcprop%frac_grid_burned(IM))

!
Sfcprop%wetness = clear_val
Expand All @@ -2700,8 +2717,8 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
Sfcprop%acsnow_land = clear_val
Sfcprop%acsnow_ice = clear_val
Sfcprop%xlaixy = clear_val
Sfcprop%fire_heat_flux_out = clear_val
Sfcprop%frac_grid_burned_out = clear_val
Sfcprop%fire_heat_flux = clear_val
Sfcprop%frac_grid_burned= clear_val
!
end if

Expand Down Expand Up @@ -2795,20 +2812,28 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%emseas (IM))
allocate (Sfcprop%emanoc (IM))
allocate (Sfcprop%ebb_smoke_in (IM))
allocate (Sfcprop%frp_input (IM))
allocate (Sfcprop%frp_output (IM))
allocate (Sfcprop%fhist (IM))
allocate (Sfcprop%coef_bb_dc(IM))
allocate (Sfcprop%fire_type (IM))
allocate (Sfcprop%peak_hr (IM))
allocate (Sfcprop%lu_nofire (IM))
allocate (Sfcprop%lu_qfire (IM))
allocate (Sfcprop%fire_in (IM,Model%fire_aux_data_levels))

! IMPORTANT: This initialization must match rrfs_sd_fill_data
Sfcprop%emdust = clear_val
Sfcprop%emseas = clear_val
Sfcprop%emanoc = clear_val
Sfcprop%ebb_smoke_in = clear_val
Sfcprop%frp_input = clear_val
Sfcprop%frp_output = clear_val
Sfcprop%fhist = 1.
Sfcprop%coef_bb_dc = clear_val
Sfcprop%fire_type = 0
Sfcprop%fire_in = clear_val
Sfcprop%peak_hr = clear_val
Sfcprop%lu_nofire = clear_val
Sfcprop%lu_qfire = clear_val
endif

end subroutine sfcprop_create
Expand Down Expand Up @@ -3031,7 +3056,38 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%slmsk_cpl = clear_val !< pointer to sfcprop%slmsk
endif

!-- cellular automata
! -- Coupling options to retrive land fluxes from external land component
if (Model%cpllnd .and. Model%cpllnd2atm) then
allocate (Coupling%sncovr1_lnd (IM))
allocate (Coupling%qsurf_lnd (IM))
allocate (Coupling%evap_lnd (IM))
allocate (Coupling%hflx_lnd (IM))
allocate (Coupling%ep_lnd (IM))
allocate (Coupling%t2mmp_lnd (IM))
allocate (Coupling%q2mp_lnd (IM))
allocate (Coupling%gflux_lnd (IM))
allocate (Coupling%runoff_lnd (IM))
allocate (Coupling%drain_lnd (IM))
allocate (Coupling%cmm_lnd (IM))
allocate (Coupling%chh_lnd (IM))
allocate (Coupling%zvfun_lnd (IM))

Coupling%sncovr1_lnd = clear_val
Coupling%qsurf_lnd = clear_val
Coupling%evap_lnd = clear_val
Coupling%hflx_lnd = clear_val
Coupling%ep_lnd = clear_val
Coupling%t2mmp_lnd = clear_val
Coupling%q2mp_lnd = clear_val
Coupling%gflux_lnd = clear_val
Coupling%runoff_lnd = clear_val
Coupling%drain_lnd = clear_val
Coupling%cmm_lnd = clear_val
Coupling%chh_lnd = clear_val
Coupling%zvfun_lnd = clear_val
end if

!-- cellular automata
allocate (Coupling%condition(IM))
if (Model%do_ca) then
allocate (Coupling%ca1 (IM))
Expand Down Expand Up @@ -3147,27 +3203,27 @@ subroutine coupling_create (Coupling, IM, Model)
if(Model%rrfs_sd) then
!--- needed for smoke aerosol option
allocate (Coupling%ebu_smoke (IM,Model%levs))
allocate (Coupling%smoke_ext (IM,Model%levs))
allocate (Coupling%dust_ext (IM,Model%levs))
allocate (Coupling%chem3d (IM,Model%levs,Model%nchem))
allocate (Coupling%ddvel (IM,Model%ndvel))
allocate (Coupling%wetdpc_flux(IM,Model%nchem))
allocate (Coupling%wetdpr_flux(IM,Model%nchem))
allocate (Coupling%drydep_flux(IM,Model%ndvel))
allocate (Coupling%min_fplume(IM))
allocate (Coupling%max_fplume(IM))
allocate (Coupling%uspdavg(IM))
allocate (Coupling%hpbl_thetav(IM))
allocate (Coupling%rrfs_hwp (IM))
allocate (Coupling%rrfs_hwp_ave (IM))
Coupling%ebu_smoke = clear_val
Coupling%smoke_ext = clear_val
Coupling%dust_ext = clear_val
Coupling%chem3d = clear_val
Coupling%ddvel = clear_val
Coupling%wetdpc_flux = clear_val
Coupling%wetdpr_flux = clear_val
Coupling%drydep_flux = clear_val
Coupling%min_fplume = clear_val
Coupling%max_fplume = clear_val
Coupling%uspdavg = clear_val
Coupling%hpbl_thetav = clear_val
Coupling%rrfs_hwp = clear_val
Coupling%rrfs_hwp_ave = clear_val
endif
Expand Down Expand Up @@ -3272,6 +3328,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: cplaqm = .false. !< default no cplaqm collection
logical :: cplchm = .false. !< default no cplchm collection
logical :: cpllnd = .false. !< default no cpllnd collection
logical :: cpllnd2atm = .false. !< default no cpllnd2atm coupling
logical :: rrfs_sd = .false. !< default no rrfs_sd collection
logical :: use_cice_alb = .false. !< default no cice albedo
logical :: cpl_imp_mrg = .false. !< default no merge import with internal forcings
Expand Down Expand Up @@ -3857,11 +3914,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
real(kind=kind_phys) :: dust_moist_correction = 1.0
real(kind=kind_phys) :: dust_alpha = 0.
real(kind=kind_phys) :: dust_gamma = 0.
real(kind=kind_phys) :: wetdep_ls_alpha = 0.
real(kind=kind_phys) :: wetdep_ls_alpha = 0.5
integer :: dust_moist_opt = 1 ! fecan :1 else shao
integer :: ebb_dcycle = 1 ! 1:retro; 2:forecast
integer :: seas_opt = 2
integer :: dust_opt = 5
integer :: dust_opt = 1
integer :: drydep_opt = 1
integer :: coarsepm_settling = 1
integer :: plume_wind_eff = 1
Expand All @@ -3870,6 +3927,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: do_plumerise = .false.
integer :: addsmoke_flag = 1
integer :: plumerisefire_frq = 60
integer :: n_dbg_lines = 3
integer :: smoke_forecast = 0 ! RRFS-sd read in ebb_smoke
logical :: aero_ind_fdb = .false. ! RRFS-sd wfa/ifa emission
logical :: aero_dir_fdb = .false. ! RRFS-sd smoke/dust radiation feedback
Expand Down Expand Up @@ -3919,8 +3977,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
thermodyn_id, sfcpress_id, &
!--- coupling parameters
cplflx, cplice, cplocn2atm, cplwav, cplwav2atm, cplaqm, &
cplchm, cpllnd, cpl_imp_mrg, cpl_imp_dbg, rrfs_sd, &
use_cice_alb, &
cplchm, cpllnd, cpllnd2atm, cpl_imp_mrg, cpl_imp_dbg, &
rrfs_sd, use_cice_alb, &
#ifdef IDEA_PHYS
lsidea, weimer_model, f107_kp_size, f107_kp_interval, &
f107_kp_skip_size, f107_kp_data_size, f107_kp_read_in_start, &
Expand Down Expand Up @@ -4054,7 +4112,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
wetdep_ls_opt, smoke_forecast, aero_ind_fdb, aero_dir_fdb, &
rrfs_smoke_debug, do_plumerise, plumerisefire_frq, &
addsmoke_flag, enh_mix, mix_chem, smoke_dir_fdb_coef, &
do_smoke_transport,smoke_conv_wet_coef, &
do_smoke_transport,smoke_conv_wet_coef,n_dbg_lines, &
!--- C3/GF closures
ichoice,ichoicem,ichoice_s, &
!--- (DFI) time ranges with radar-prescribed microphysics tendencies
Expand Down Expand Up @@ -4314,6 +4372,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%cplaqm = cplaqm
Model%cplchm = cplchm .or. cplaqm
Model%cpllnd = cpllnd
Model%cpllnd2atm = cpllnd2atm
Model%use_cice_alb = use_cice_alb
Model%cpl_imp_mrg = cpl_imp_mrg
Model%cpl_imp_dbg = cpl_imp_dbg
Expand All @@ -4336,6 +4395,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%extended_sd_diags = extended_sd_diags
Model%wetdep_ls_opt = wetdep_ls_opt
Model%do_plumerise = do_plumerise
Model%n_dbg_lines = n_dbg_lines
Model%plumerisefire_frq = plumerisefire_frq
Model%addsmoke_flag = addsmoke_flag
Model%smoke_forecast = smoke_forecast
Expand Down Expand Up @@ -6443,6 +6503,7 @@ subroutine control_print(Model)
print *, ' cplaqm : ', Model%cplaqm
print *, ' cplchm : ', Model%cplchm
print *, ' cpllnd : ', Model%cpllnd
print *, ' cpllnd2atm : ', Model%cpllnd2atm
print *, ' rrfs_sd : ', Model%rrfs_sd
print *, ' use_cice_alb : ', Model%use_cice_alb
print *, ' cpl_imp_mrg : ', Model%cpl_imp_mrg
Expand Down
Loading

0 comments on commit 1a8c988

Please sign in to comment.