Skip to content

Commit

Permalink
Merge tag 'sci.1.69.0_api.31.0.0' into luh2
Browse files Browse the repository at this point in the history
Hydraulic failure mortality turned off for frozen soils

Hydraulic failure mortality is turned off when any soil layer is below
-2 degrees C. This should prevent high mortality of vegetation at high
latitudes.
  • Loading branch information
glemieux committed Nov 29, 2023
2 parents cde7e7d + 5551a70 commit ef1c454
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 172 deletions.
12 changes: 7 additions & 5 deletions biogeochem/EDMortalityFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ module EDMortalityFunctionsMod

contains

subroutine mortality_rates( cohort_in,bc_in,btran_ft, mean_temp, &
subroutine mortality_rates( cohort_in,bc_in, btran_ft, mean_temp, &
cmort,hmort,bmort, frmort,smort,asmort,dgmort )

! ============================================================================
! Calculate mortality rates from carbon storage, hydraulic cavitation,
! background and freezing and size and age dependent senescence
! ============================================================================

use FatesConstantsMod, only : tfrz => t_water_freeze_k_1atm
use FatesConstantsMod, only : fates_check_param_set
use DamageMainMod, only : GetDamageMortality
use FatesConstantsMod, only : tfrz => t_water_freeze_k_1atm
use FatesConstantsMod, only : fates_check_param_set
use DamageMainMod, only : GetDamageMortality
use EDParamsmod, only : soil_tfrz_thresh

type (fates_cohort_type), intent(in) :: cohort_in
type (bc_in_type), intent(in) :: bc_in
Expand Down Expand Up @@ -156,7 +157,8 @@ subroutine mortality_rates( cohort_in,bc_in,btran_ft, mean_temp, &
hmort = 0.0_r8
endif
else
if(btran_ft(cohort_in%pft) <= hf_sm_threshold)then
if( ( btran_ft(cohort_in%pft) <= hf_sm_threshold ) .and. &
( ( minval(bc_in%t_soisno_sl) - tfrz ) > soil_tfrz_thresh ) ) then
hmort = EDPftvarcon_inst%mort_scalar_hydrfailure(cohort_in%pft)
else
hmort = 0.0_r8
Expand Down
2 changes: 1 addition & 1 deletion biogeochem/FatesLitterMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ subroutine adjust_SF_CWD_frac(dbh,ncwd,SF_val_CWD_frac,SF_val_CWD_frac_adj)

!ARGUMENTS
real(r8), intent(in) :: dbh !dbh of cohort [cm]
type(integer), intent(in) :: ncwd !number of cwd pools
integer, intent(in) :: ncwd !number of cwd pools
real(r8), intent(in) :: SF_val_CWD_frac(:) !fates parameter specifying the
!fraction of struct + sapw going
!to each CWD class
Expand Down
3 changes: 2 additions & 1 deletion biogeophys/EDBtranMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module EDBtranMod
use EDTypesMod , only : ed_site_type
use FatesPatchMod, only : fates_patch_type
use EDParamsMod, only : maxpft
use EDParamsMod, only : soil_tfrz_thresh
use FatesCohortMod, only : fates_cohort_type
use shr_kind_mod , only : r8 => shr_kind_r8
use FatesInterfaceTypesMod , only : bc_in_type, &
Expand Down Expand Up @@ -48,7 +49,7 @@ logical function check_layer_water(h2o_liq_vol, tempk)
check_layer_water = .false.

if ( h2o_liq_vol .gt. 0._r8 ) then
if ( tempk .gt. tfrz-2._r8) then
if ( tempk .gt. soil_tfrz_thresh + tfrz) then
check_layer_water = .true.
end if
end if
Expand Down
4 changes: 3 additions & 1 deletion main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ module EDParamsMod
integer, public :: n_uptake_mode
integer, public :: p_uptake_mode

real(r8), parameter, public :: soil_tfrz_thresh = -2.0_r8 ! Soil temperature threshold below which hydraulic failure mortality is off (non-hydro only) in degrees C

integer, parameter, public :: nclmax = 2 ! Maximum number of canopy layers

! parameters that govern the VAI (LAI+SAI) bins used in radiative transfer code
integer, parameter, public :: nlevleaf = 30 ! number of leaf+stem layers in each canopy layer

Expand Down
58 changes: 51 additions & 7 deletions main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ module FatesInterfaceMod
use EDParamsMod , only : ED_val_history_ageclass_bin_edges
use EDParamsMod , only : ED_val_history_height_bin_edges
use EDParamsMod , only : ED_val_history_coageclass_bin_edges
use CLMFatesParamInterfaceMod , only : FatesReadParameters
use EDParamsMod , only : p_uptake_mode
use EDParamsMod , only : n_uptake_mode
use FatesParametersInterface , only : fates_param_reader_type
use FatesParametersInterface , only : fates_parameters_type
use EDParamsMod , only : FatesRegisterParams, FatesReceiveParams
use SFParamsMod , only : SpitFireRegisterParams, SpitFireReceiveParams
use PRTInitParamsFATESMod , only : PRTRegisterParams, PRTReceiveParams
use FatesSynchronizedParamsMod, only : FatesSynchronizedParamsInst
use EDParamsMod , only : p_uptake_mode
use EDParamsMod , only : n_uptake_mode
use EDTypesMod , only : ed_site_type
use FatesConstantsMod , only : prescribed_p_uptake
use FatesConstantsMod , only : prescribed_n_uptake
Expand Down Expand Up @@ -173,6 +178,8 @@ module FatesInterfaceMod
public :: set_bcs
public :: UpdateFatesRMeansTStep
public :: InitTimeAveragingGlobals

private :: FatesReadParameters
public :: DetermineGridCellNeighbors

logical :: debug = .false. ! for debugging this module
Expand Down Expand Up @@ -745,7 +752,7 @@ end subroutine set_bcs

! ===================================================================================

subroutine SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft)
subroutine SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft,param_reader)

! --------------------------------------------------------------------------------
!
Expand All @@ -759,13 +766,14 @@ subroutine SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft)
logical, intent(in) :: use_fates ! Is fates turned on?
integer, intent(in) :: surf_numpft ! Number of PFTs in surface dataset
integer, intent(in) :: surf_numcft ! Number of CFTs in surface dataset
class(fates_param_reader_type), intent(in) :: param_reader ! HLM-provided param file reader

integer :: fates_numpft ! Number of PFTs tracked in FATES

if (use_fates) then

! Self explanatory, read the fates parameter file
call FatesReadParameters()
call FatesReadParameters(param_reader)

fates_numpft = size(prt_params%wood_density,dim=1)

Expand Down Expand Up @@ -2436,5 +2444,41 @@ subroutine DetermineGridCellNeighbors(neighbors,seeds,numg)
call t_stopf('fates-seed-init-decomp')

end subroutine DetermineGridCellNeighbors

end module FatesInterfaceMod

! ======================================================================================

!-----------------------------------------------------------------------
! TODO(jpalex): this belongs in FatesParametersInterface.F90, but would require
! untangling the dependencies of the *RegisterParams methods below.
subroutine FatesReadParameters(param_reader)
implicit none

class(fates_param_reader_type), intent(in) :: param_reader ! HLM-provided param file reader

character(len=32) :: subname = 'FatesReadParameters'
class(fates_parameters_type), allocatable :: fates_params

if ( hlm_masterproc == itrue ) then
write(fates_log(), *) 'FatesParametersInterface.F90::'//trim(subname)//' :: CLM reading ED/FATES '//' parameters '
end if

allocate(fates_params)
call fates_params%Init() ! fates_params class, in FatesParameterInterfaceMod
call FatesRegisterParams(fates_params) !EDParamsMod, only operates on fates_params class
call SpitFireRegisterParams(fates_params) !SpitFire Mod, only operates of fates_params class
call PRTRegisterParams(fates_params) ! PRT mod, only operates on fates_params class
call FatesSynchronizedParamsInst%RegisterParams(fates_params) !Synchronized params class in Synchronized params mod, only operates on fates_params class

call param_reader%Read(fates_params)

call FatesReceiveParams(fates_params)
call SpitFireReceiveParams(fates_params)
call PRTReceiveParams(fates_params)
call FatesSynchronizedParamsInst%ReceiveParams(fates_params)

call fates_params%Destroy()
deallocate(fates_params)

end subroutine FatesReadParameters

end module FatesInterfaceMod
Loading

0 comments on commit ef1c454

Please sign in to comment.