Skip to content

Commit

Permalink
Merge pull request #351 from grantfirl/ufs-dev-PR10
Browse files Browse the repository at this point in the history
Updates for ccpp-physics ufs-dev PR#10
  • Loading branch information
dustinswales authored Nov 16, 2022
2 parents edf6163 + 673208a commit 354e2fe
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 52 deletions.
77 changes: 44 additions & 33 deletions scm/src/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ module GFS_typedefs
logical :: cplwav2atm !< default no wav->atm coupling
logical :: cplaqm !< default no cplaqm collection
logical :: cplchm !< default no cplchm collection
logical :: cpllnd !< default no cpllnd collection
logical :: rrfs_smoke !< default no rrfs_smoke collection
integer :: dust_smoke_rrtmg_band_number !< band number to affect in rrtmg_pre from smoke and dust
logical :: use_cice_alb !< default .false. - i.e. don't use albedo imported from the ice model
Expand Down Expand Up @@ -2501,7 +2502,7 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%tsfc_radtime = clear_val
endif

if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then
if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global .or. Model%cpllnd) then
allocate (Coupling%rain_cpl (IM))
allocate (Coupling%snow_cpl (IM))
Coupling%rain_cpl = clear_val
Expand All @@ -2517,7 +2518,7 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%v10mi_cpl = clear_val
endif

if (Model%cplflx .or. Model%cplchm) then
if (Model%cplflx .or. Model%cplchm .or. Model%cpllnd) then
!--- instantaneous quantities
allocate (Coupling%tsfci_cpl (IM))
Coupling%tsfci_cpl = clear_val
Expand All @@ -2530,6 +2531,36 @@ subroutine coupling_create (Coupling, IM, Model)
! Coupling%zorlwav_cpl = clear_val
! endif

if (Model%cplflx .or. Model%cpllnd) then
allocate (Coupling%dlwsfc_cpl (IM))
allocate (Coupling%dswsfc_cpl (IM))
allocate (Coupling%psurfi_cpl (IM))
allocate (Coupling%nswsfc_cpl (IM))
allocate (Coupling%nswsfci_cpl (IM))
allocate (Coupling%nnirbmi_cpl (IM))
allocate (Coupling%nnirdfi_cpl (IM))
allocate (Coupling%nvisbmi_cpl (IM))
allocate (Coupling%nvisdfi_cpl (IM))
allocate (Coupling%nnirbm_cpl (IM))
allocate (Coupling%nnirdf_cpl (IM))
allocate (Coupling%nvisbm_cpl (IM))
allocate (Coupling%nvisdf_cpl (IM))

Coupling%dlwsfc_cpl = clear_val
Coupling%dswsfc_cpl = clear_val
Coupling%psurfi_cpl = clear_val
Coupling%nswsfc_cpl = clear_val
Coupling%nswsfci_cpl = clear_val
Coupling%nnirbmi_cpl = clear_val
Coupling%nnirdfi_cpl = clear_val
Coupling%nvisbmi_cpl = clear_val
Coupling%nvisdfi_cpl = clear_val
Coupling%nnirbm_cpl = clear_val
Coupling%nnirdf_cpl = clear_val
Coupling%nvisbm_cpl = clear_val
Coupling%nvisdf_cpl = clear_val
end if

if (Model%cplflx) then
!--- incoming quantities
allocate (Coupling%slimskin_cpl (IM))
Expand Down Expand Up @@ -2584,35 +2615,21 @@ subroutine coupling_create (Coupling, IM, Model)
allocate (Coupling%dvsfc_cpl (IM))
allocate (Coupling%dtsfc_cpl (IM))
allocate (Coupling%dqsfc_cpl (IM))
allocate (Coupling%dlwsfc_cpl (IM))
allocate (Coupling%dswsfc_cpl (IM))
allocate (Coupling%dnirbm_cpl (IM))
allocate (Coupling%dnirdf_cpl (IM))
allocate (Coupling%dvisbm_cpl (IM))
allocate (Coupling%dvisdf_cpl (IM))
allocate (Coupling%nlwsfc_cpl (IM))
allocate (Coupling%nswsfc_cpl (IM))
allocate (Coupling%nnirbm_cpl (IM))
allocate (Coupling%nnirdf_cpl (IM))
allocate (Coupling%nvisbm_cpl (IM))
allocate (Coupling%nvisdf_cpl (IM))

Coupling%dusfc_cpl = clear_val
Coupling%dvsfc_cpl = clear_val
Coupling%dtsfc_cpl = clear_val
Coupling%dqsfc_cpl = clear_val
Coupling%dlwsfc_cpl = clear_val
Coupling%dswsfc_cpl = clear_val
Coupling%dnirbm_cpl = clear_val
Coupling%dnirdf_cpl = clear_val
Coupling%dvisbm_cpl = clear_val
Coupling%dvisdf_cpl = clear_val
Coupling%nlwsfc_cpl = clear_val
Coupling%nswsfc_cpl = clear_val
Coupling%nnirbm_cpl = clear_val
Coupling%nnirdf_cpl = clear_val
Coupling%nvisbm_cpl = clear_val
Coupling%nvisdf_cpl = clear_val

!--- instantaneous quantities
allocate (Coupling%dusfci_cpl (IM))
Expand All @@ -2626,14 +2643,8 @@ subroutine coupling_create (Coupling, IM, Model)
allocate (Coupling%dvisbmi_cpl (IM))
allocate (Coupling%dvisdfi_cpl (IM))
allocate (Coupling%nlwsfci_cpl (IM))
allocate (Coupling%nswsfci_cpl (IM))
allocate (Coupling%nnirbmi_cpl (IM))
allocate (Coupling%nnirdfi_cpl (IM))
allocate (Coupling%nvisbmi_cpl (IM))
allocate (Coupling%nvisdfi_cpl (IM))
allocate (Coupling%t2mi_cpl (IM))
allocate (Coupling%q2mi_cpl (IM))
allocate (Coupling%psurfi_cpl (IM))
allocate (Coupling%oro_cpl (IM))
allocate (Coupling%slmsk_cpl (IM))

Expand All @@ -2648,14 +2659,8 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%dvisbmi_cpl = clear_val
Coupling%dvisdfi_cpl = clear_val
Coupling%nlwsfci_cpl = clear_val
Coupling%nswsfci_cpl = clear_val
Coupling%nnirbmi_cpl = clear_val
Coupling%nnirdfi_cpl = clear_val
Coupling%nvisbmi_cpl = clear_val
Coupling%nvisdfi_cpl = clear_val
Coupling%t2mi_cpl = clear_val
Coupling%q2mi_cpl = clear_val
Coupling%psurfi_cpl = clear_val
Coupling%oro_cpl = clear_val !< pointer to sfcprop%oro
Coupling%slmsk_cpl = clear_val !< pointer to sfcprop%slmsk
endif
Expand Down Expand Up @@ -2686,17 +2691,20 @@ subroutine coupling_create (Coupling, IM, Model)
if (Model%cplchm .or. Model%rrfs_smoke) then
!--- outgoing instantaneous quantities
allocate (Coupling%ushfsfci (IM))
!--- accumulated convective rainfall
allocate (Coupling%rainc_cpl (IM))
! -- instantaneous 3d fluxes of nonconvective ice and liquid precipitations
allocate (Coupling%pfi_lsan (IM,Model%levs))
allocate (Coupling%pfl_lsan (IM,Model%levs))
Coupling%rainc_cpl = clear_val
Coupling%ushfsfci = clear_val
Coupling%pfi_lsan = clear_val
Coupling%pfl_lsan = clear_val
endif

if (Model%cplchm .or. Model%rrfs_smoke .or. Model%cplflx .or. Model%cpllnd) then
!--- accumulated convective rainfall
allocate (Coupling%rainc_cpl (IM))
Coupling%rainc_cpl = clear_val
end if

! -- additional coupling options for air quality
if (Model%cplaqm .and. .not.Model%cplflx) then
!--- outgoing instantaneous quantities
Expand Down Expand Up @@ -2905,6 +2913,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: cplwav2atm = .false. !< default no cplwav2atm coupling
logical :: cplaqm = .false. !< default no cplaqm collection
logical :: cplchm = .false. !< default no cplchm collection
logical :: cpllnd = .false. !< default no cpllnd collection
logical :: rrfs_smoke = .false. !< default no rrfs_smoke collection
integer :: dust_smoke_rrtmg_band_number = 10!< band number to affect in rrtmg_pre from smoke and dust
logical :: use_cice_alb = .false. !< default no cice albedo
Expand Down Expand Up @@ -3432,7 +3441,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
thermodyn_id, sfcpress_id, &
!--- coupling parameters
cplflx, cplice, cplocn2atm, cplwav, cplwav2atm, cplaqm, &
cplchm, cpl_imp_mrg, cpl_imp_dbg, rrfs_smoke, &
cplchm, cpllnd, cpl_imp_mrg, cpl_imp_dbg, rrfs_smoke, &
use_cice_alb, dust_smoke_rrtmg_band_number, &
#ifdef IDEA_PHYS
lsidea, weimer_model, f107_kp_size, f107_kp_interval, &
Expand Down Expand Up @@ -3770,6 +3779,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%cplwav2atm = cplwav2atm
Model%cplaqm = cplaqm
Model%cplchm = cplchm .or. cplaqm
Model%cpllnd = cpllnd
Model%use_cice_alb = use_cice_alb
Model%cpl_imp_mrg = cpl_imp_mrg
Model%cpl_imp_dbg = cpl_imp_dbg
Expand Down Expand Up @@ -5697,6 +5707,7 @@ subroutine control_print(Model)
print *, ' cplwav2atm : ', Model%cplwav2atm
print *, ' cplaqm : ', Model%cplaqm
print *, ' cplchm : ', Model%cplchm
print *, ' cpllnd : ', Model%cpllnd
print *, ' rrfs_smoke : ', Model%rrfs_smoke
print *, ' use_cice_alb : ', Model%use_cice_alb
print *, ' cpl_imp_mrg : ', Model%cpl_imp_mrg
Expand Down Expand Up @@ -6319,7 +6330,7 @@ subroutine tbd_create (Tbd, IM, Model)
Tbd%acvb = clear_val
Tbd%acvt = clear_val

if (Model%cplflx .or. Model%cplchm) then
if (Model%cplflx .or. Model%cplchm .or. Model%cpllnd) then
allocate (Tbd%drain_cpl (IM))
allocate (Tbd%dsnow_cpl (IM))
Tbd%drain_cpl = clear_val
Expand Down
42 changes: 24 additions & 18 deletions scm/src/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1984,23 +1984,23 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_stochastic_physics_perturbations .or. flag_for_chemistry_coupling .or. flag_for_global_cellular_automata)
active = (flag_for_surface_flux_coupling .or. flag_for_stochastic_physics_perturbations .or. flag_for_chemistry_coupling .or. flag_for_global_cellular_automata .or. flag_for_land_coupling)
[rainc_cpl]
standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_for_coupling
long_name = total convective precipitation
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_chemistry_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_chemistry_coupling .or. flag_for_land_coupling)
[snow_cpl]
standard_name = cumulative_lwe_thickness_of_snow_amount_for_coupling
long_name = total snow precipitation
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_stochastic_physics_perturbations .or. flag_for_chemistry_coupling .or. flag_for_global_cellular_automata)
active = (flag_for_surface_flux_coupling .or. flag_for_stochastic_physics_perturbations .or. flag_for_chemistry_coupling .or. flag_for_global_cellular_automata .or. flag_for_land_coupling)
[dusfc_cpl]
standard_name = cumulative_surface_x_momentum_flux_for_coupling_multiplied_by_timestep
long_name = cumulative sfc x momentum flux multiplied by timestep
Expand Down Expand Up @@ -2040,15 +2040,15 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[dswsfc_cpl]
standard_name = cumulative_surface_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative sfc downward sw flux multiplied by timestep
units = W m-2 s
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[dnirbm_cpl]
standard_name = cumulative_surface_downwelling_direct_nir_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative sfc nir beam downward sw flux multiplied by timestep
Expand Down Expand Up @@ -2096,39 +2096,39 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nnirbm_cpl]
standard_name = cumulative_surface_net_downwelling_direct_nir_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative net nir beam downward sw flux multiplied by timestep
units = W m-2 s
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nnirdf_cpl]
standard_name = cumulative_surface_net_downwellling_diffuse_nir_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative net nir diff downward sw flux multiplied by timestep
units = W m-2 s
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nvisbm_cpl]
standard_name = cumulative_surface_net_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative net uv+vis beam downward sw rad flux multiplied by timestep
units = W m-2 s
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nvisdf_cpl]
standard_name = cumulative_surface_net_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep
long_name = cumulative net uv+vis diff downward sw rad flux multiplied by timestep
units = W m-2 s
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[dusfci_cpl]
standard_name = surface_x_momentum_flux_for_coupling
long_name = instantaneous sfc x momentum flux
Expand Down Expand Up @@ -2224,39 +2224,39 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_air_quality_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_air_quality_coupling .or. flag_for_land_coupling)
[nnirbmi_cpl]
standard_name = surface_net_downwelling_direct_nir_shortwave_flux_for_coupling
long_name = instantaneous net nir beam sfc downward sw flux
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nnirdfi_cpl]
standard_name = surface_net_downwelling_diffuse_nir_shortwave_flux_for_coupling
long_name = instantaneous net nir diff sfc downward sw flux
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nvisbmi_cpl]
standard_name = surface_net_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling
long_name = instantaneous net uv+vis beam downward sw flux
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[nvisdfi_cpl]
standard_name = surface_net_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling
long_name = instantaneous net uv+vis diff downward sw flux
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_land_coupling)
[t2mi_cpl]
standard_name = temperature_at_2m_for_coupling
long_name = instantaneous T2m
Expand Down Expand Up @@ -2304,7 +2304,7 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_air_quality_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_air_quality_coupling .or. flag_for_land_coupling)
[ulwsfcin_cpl]
standard_name = surface_upwelling_longwave_flux_from_coupled_process
long_name = surface upwelling LW flux for coupling
Expand Down Expand Up @@ -3019,6 +3019,12 @@
units = flag
dimensions = ()
type = logical
[cpllnd]
standard_name = flag_for_land_coupling
long_name = flag controlling cpllnd collection (default off)
units = flag
dimensions = ()
type = logical
[rrfs_smoke]
standard_name = do_smoke_coupling
long_name = flag controlling rrfs_smoke collection (default off)
Expand Down Expand Up @@ -6783,15 +6789,15 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_chemistry_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_chemistry_coupling .or. flag_for_land_coupling)
[dsnow_cpl]
standard_name = tendency_of_lwe_thickness_of_snowfall_amount_on_dynamics_timestep_for_coupling
long_name = change in show_cpl (coupling_type)
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_surface_flux_coupling .or. flag_for_chemistry_coupling)
active = (flag_for_surface_flux_coupling .or. flag_for_chemistry_coupling .or. flag_for_land_coupling)
[phy_fctd]
standard_name = atmosphere_updraft_convective_mass_flux_at_cloud_base_by_cloud_type
long_name = cloud base mass flux for CS convection
Expand Down

0 comments on commit 354e2fe

Please sign in to comment.