Skip to content

Commit adb7af2

Browse files
authored
Merge pull request #347 from rgknox/rgknox-parameter-updates
updates to the parameter file
2 parents 6b02c8d + f969fa4 commit adb7af2

12 files changed

+2456
-186
lines changed

biogeochem/EDCanopyStructureMod.F90

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,6 @@ subroutine canopy_structure( currentSite , bc_in )
148148
enddo
149149

150150

151-
! ------------------------------------------------------------------------------
152-
! Check patch area to prevent numerical weirdness
153-
! ------------------------------------------------------------------------------
154-
155-
if (currentPatch%area .lt. min_patch_area) then
156-
157-
write(fates_log(),*) 'An incredibly small patch exists that should'
158-
write(fates_log(),*) 'had been fused or culled already'
159-
write(fates_log(),*) 'currentPatch%area: ',currentPatch%area
160-
write(fates_log(),*) 'min_patch_area: ',min_patch_area
161-
call endrun(msg=errMsg(sourcefile, __LINE__))
162-
163-
end if
164-
165151
! Does any layer have excess area in it? Keep going until it does not...
166152
patch_area_counter = 0
167153
area_not_balanced = .true.
@@ -1098,6 +1084,13 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
10981084
currentPatch%canopy_area_profile(:,:,:) = 0._r8
10991085
currentPatch%canopy_mask(:,:) = 0
11001086

1087+
! ------------------------------------------------------------------------------
1088+
! It is remotely possible that in deserts we will not have any canopy
1089+
! area, ie not plants at all...
1090+
! ------------------------------------------------------------------------------
1091+
1092+
if (currentPatch%total_canopy_area > tiny(currentPatch%total_canopy_area)) then
1093+
11011094
currentCohort => currentPatch%shortest
11021095
do while(associated(currentCohort))
11031096

@@ -1226,12 +1219,6 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
12261219
! and canopy area to the accumulators.
12271220
! -----------------------------------------------------------------------------
12281221

1229-
! ------------------------------------------------------------------------------
1230-
! It is remotely possible that in deserts we will not have any canopy
1231-
! area, ie not plants at all...
1232-
! ------------------------------------------------------------------------------
1233-
1234-
if (currentPatch%total_canopy_area > tiny(currentPatch%total_canopy_area)) then
12351222

12361223
currentCohort => currentPatch%shortest
12371224
do while(associated(currentCohort))
@@ -1389,7 +1376,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
13891376
do cl = 1,currentPatch%NCL_p
13901377
do iv = 1,currentPatch%ncan(cl,ft)
13911378

1392-
if( sum(currentPatch%canopy_area_profile(cl,:,iv)) > 1.0001_r8 ) then
1379+
if( DEBUG .and. sum(currentPatch%canopy_area_profile(cl,:,iv)) > 1.0001_r8 ) then
13931380

13941381
write(fates_log(), *) 'FATES: A canopy_area_profile exceeded 1.0'
13951382
write(fates_log(), *) 'cl: ',cl

biogeochem/EDLoggingMortalityMod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module EDLoggingMortalityMod
3131
use EDParamsMod , only : logging_direct_frac
3232
use EDParamsMod , only : logging_mechanical_frac
3333
use EDParamsMod , only : logging_coll_under_frac
34+
use EDParamsMod , only : logging_dbhmax_infra
3435
use FatesInterfaceMod , only : hlm_current_year
3536
use FatesInterfaceMod , only : hlm_current_month
3637
use FatesInterfaceMod , only : hlm_current_day
@@ -154,7 +155,6 @@ subroutine LoggingMortality_frac( pft_i, dbh, lmort_direct,lmort_collateral,lmor
154155

155156
! Parameters
156157
real(r8), parameter :: adjustment = 1.0 ! adjustment for mortality rates
157-
real(r8), parameter :: logging_dbhmax_infra = 35 !(cm), based on Feldpaush et al. (2005) and Ferry et al. (2010)
158158

159159
if (logging_time) then
160160
if(EDPftvarcon_inst%woody(pft_i) == 1)then ! only set logging rates for trees

biogeochem/EDMortalityFunctionsMod.F90

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module EDMortalityFunctionsMod
1212
use EDTypesMod , only : ed_patch_type
1313
use FatesConstantsMod , only : itrue,ifalse
1414
use FatesAllometryMod , only : bleaf
15-
use EDParamsMod , only : ED_val_stress_mort
1615
use FatesInterfaceMod , only : bc_in_type
1716
use FatesInterfaceMod , only : hlm_use_ed_prescribed_phys
1817
use FatesInterfaceMod , only : hlm_freq_day
@@ -62,7 +61,6 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
6261
real(r8) :: hf_sm_threshold ! hydraulic failure soil moisture threshold
6362
real(r8) :: temp_dep ! Temp. function (freezing mortality)
6463
real(r8) :: temp_in_C ! Daily averaged temperature in Celcius
65-
real(r8),parameter :: frost_mort_scaler = 3.0_r8 ! Scaling factor for freezing mortality
6664
real(r8),parameter :: frost_mort_buffer = 5.0_r8 ! 5deg buffer for freezing mortality
6765

6866
logical, parameter :: test_zero_mortality = .false. ! Developer test which
@@ -79,7 +77,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
7977
hf_sm_threshold = EDPftvarcon_inst%hf_sm_threshold(cohort_in%pft)
8078

8179
if(cohort_in%patchptr%btran_ft(cohort_in%pft) <= hf_sm_threshold)then
82-
hmort = ED_val_stress_mort
80+
hmort = EDPftvarcon_inst%mort_scalar_hydrfailure(cohort_in%pft)
8381
else
8482
hmort = 0.0_r8
8583
endif
@@ -89,7 +87,8 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
8987
call bleaf(cohort_in%dbh,cohort_in%pft,cohort_in%canopy_trim,b_leaf)
9088
if( b_leaf > 0._r8 .and. cohort_in%bstore <= b_leaf )then
9189
frac = cohort_in%bstore/ b_leaf
92-
cmort = max(0.0_r8,ED_val_stress_mort*(1.0_r8 - frac))
90+
cmort = max(0.0_r8,EDPftvarcon_inst%mort_scalar_cstarvation(cohort_in%pft) * &
91+
(1.0_r8 - frac))
9392
else
9493
cmort = 0.0_r8
9594
endif
@@ -109,7 +108,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
109108
temp_in_C = bc_in%t_veg24_si - tfrz
110109
temp_dep = max(0.0,min(1.0,1.0 - (temp_in_C - &
111110
EDPftvarcon_inst%freezetol(cohort_in%pft))/frost_mort_buffer) )
112-
frmort = frost_mort_scaler * temp_dep
111+
frmort = EDPftvarcon_inst%mort_scalar_coldstress(cohort_in%pft) * temp_dep
113112

114113

115114
!mortality_rates = bmort + hmort + cmort

biogeochem/EDPhysiologyMod.F90

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -872,15 +872,9 @@ subroutine PlantGrowth( currentSite, currentCohort, bc_in )
872872
integer , parameter :: max_substeps = 300
873873
real(r8), parameter :: max_trunc_error = 1.0_r8
874874
integer, parameter :: ODESolve = 2 ! 1=RKF45, 2=Euler
875-
real(r8), parameter :: global_branch_turnover = 0.0_r8 ! Temporary branch turnover setting
876-
! Branch-turnover control will be
877-
! introduced in a later PR
878-
879875

880876
ipft = currentCohort%pft
881877

882-
EDPftvarcon_inst%branch_turnover(ipft) = global_branch_turnover
883-
884878
! Initialize seed production
885879
currentCohort%seed_prod = 0.0_r8
886880

@@ -973,35 +967,6 @@ subroutine PlantGrowth( currentSite, currentCohort, bc_in )
973967
currentCohort%canopy_trim, currentCohort%dbh, currentCohort%hite )
974968
end if
975969

976-
! -----------------------------------------------------------------------------------
977-
! III(a). Calculate the maintenance turnover demands
978-
! Pre-check, make sure phenology is mutually exclusive and at least one chosen
979-
! (MOVE THIS TO THE PARAMETER READ-IN SECTION)
980-
! -----------------------------------------------------------------------------------
981-
982-
if (EDPftvarcon_inst%evergreen(ipft) == 1) then
983-
if (EDPftvarcon_inst%season_decid(ipft) == 1)then
984-
write(fates_log(),*) 'PFT # ',ipft,' was specified as being both evergreen'
985-
write(fates_log(),*) ' and seasonally deciduous, impossible, aborting'
986-
call endrun(msg=errMsg(sourcefile, __LINE__))
987-
end if
988-
if (EDPftvarcon_inst%stress_decid(ipft) == 1)then
989-
write(fates_log(),*) 'PFT # ',ipft,' was specified as being both evergreen'
990-
write(fates_log(),*) ' and stress deciduous, impossible, aborting'
991-
call endrun(msg=errMsg(sourcefile, __LINE__))
992-
end if
993-
end if
994-
if (EDPftvarcon_inst%stress_decid(ipft) /= 1 .and. &
995-
EDPftvarcon_inst%season_decid(ipft) /= 1 .and. &
996-
EDPftvarcon_inst%evergreen(ipft) /= 1) then
997-
write(fates_log(),*) 'PFT # ',ipft,' must be defined as having one of three'
998-
write(fates_log(),*) 'phenology habits, ie == 1'
999-
write(fates_log(),*) 'stress_decid: ',EDPftvarcon_inst%stress_decid(ipft)
1000-
write(fates_log(),*) 'season_decid: ',EDPftvarcon_inst%season_decid(ipft)
1001-
write(fates_log(),*) 'evergreen: ',EDPftvarcon_inst%evergreen(ipft)
1002-
call endrun(msg=errMsg(sourcefile, __LINE__))
1003-
endif
1004-
1005970

1006971
! -----------------------------------------------------------------------------------
1007972
! III(b). Calculate the maintenance turnover demands
@@ -1460,7 +1425,7 @@ function AllomCGrowthDeriv(c_pools,c_mask,cbalance,currentCohort) result(dCdx)
14601425
if (dbh <= EDPftvarcon_inst%dbh_repro_threshold(ipft)) then ! cap on leaf biomass
14611426
repro_fraction = EDPftvarcon_inst%seed_alloc(ipft)
14621427
else
1463-
repro_fraction = EDPftvarcon_inst%seed_alloc(ipft) + EDPftvarcon_inst%clone_alloc(ipft)
1428+
repro_fraction = EDPftvarcon_inst%seed_alloc(ipft) + EDPftvarcon_inst%seed_alloc_mature(ipft)
14641429
end if
14651430

14661431
dCdx = 0.0_r8

biogeophys/FatesPlantRespPhotosynthMod.F90

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
191191
! Ball-Berry minimum leaf conductance, unstressed (umol H2O/m**2/s)
192192
! For C3 and C4 plants
193193
! -----------------------------------------------------------------------------------
194-
real(r8), dimension(2) :: bbbopt
194+
real(r8), dimension(0:1) :: bbbopt
195195

196196
associate( &
197197
c3psn => EDPftvarcon_inst%c3psn , &
@@ -202,9 +202,9 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
202202
frootcn => EDPftvarcon_inst%frootcn, & ! froot C:N (gc/gN) ! slope of BB relationship
203203
q10 => FatesSynchronizedParamsInst%Q10 )
204204

205+
bbbopt(0) = ED_val_bbopt_c4
205206
bbbopt(1) = ED_val_bbopt_c3
206-
bbbopt(2) = ED_val_bbopt_c4
207-
207+
208208
do s = 1,nsites
209209

210210
! Multi-layer parameters scaled by leaf nitrogen profile.
@@ -721,7 +721,8 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
721721

722722
! Locals
723723
! ------------------------------------------------------------------------
724-
integer :: pp_type ! Index for the different photosynthetic pathways C3,C4
724+
integer :: c3c4_path_index ! Index for which photosynthetic pathway
725+
! is active. C4 = 0, C3 = 1
725726
integer :: sunsha ! Index for differentiating sun and shade
726727
real(r8) :: gstoma ! Stomatal Conductance of this leaf layer (m/s)
727728
real(r8) :: agross ! co-limited gross leaf photosynthesis (umol CO2/m**2/s)
@@ -758,22 +759,23 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
758759
real(r8),parameter :: init_a2l_co2_c3 = 0.7_r8
759760
real(r8),parameter :: init_a2l_co2_c4 = 0.4_r8
760761

761-
! quantum efficiency, used only for C4 (mol CO2 / mol photons)
762-
real(r8),parameter,dimension(2) :: quant_eff = [0.0_r8,0.05_r8]
762+
! quantum efficiency, used only for C4 (mol CO2 / mol photons) (index 0)
763+
real(r8),parameter,dimension(0:1) :: quant_eff = [0.05_r8,0.0_r8]
763764

764765
! empirical curvature parameter for ac, aj photosynthesis co-limitation
765-
real(r8),parameter,dimension(2) :: theta_cj = [0.98_r8,0.80_r8]
766+
real(r8),parameter,dimension(0:1) :: theta_cj = [0.80_r8,0.98_r8]
766767

767768
! empirical curvature parameter for ap photosynthesis co-limitation
768769
real(r8),parameter :: theta_ip = 0.95_r8
769770

770-
associate( bb_slope => EDPftvarcon_inst%BB_slope ) ! slope of BB relationship
771+
associate( bb_slope => EDPftvarcon_inst%BB_slope) ! slope of BB relationship
772+
773+
! photosynthetic pathway: 0. = c4, 1. = c3
774+
c3c4_path_index = nint(EDPftvarcon_inst%c3psn(ft))
771775

772-
if (nint(EDPftvarcon_inst%c3psn(ft)) == 1) then! photosynthetic pathway: 0. = c4, 1. = c3
773-
pp_type = 1
776+
if (c3c4_path_index == 1) then
774777
init_co2_intra_c = init_a2l_co2_c3 * can_co2_ppress
775778
else
776-
pp_type = 2
777779
init_co2_intra_c = init_a2l_co2_c4 * can_co2_ppress
778780
end if
779781

@@ -845,7 +847,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
845847
co2_intra_c_old = co2_intra_c
846848

847849
! Photosynthesis limitation rate calculations
848-
if (pp_type == 1)then
850+
if (c3c4_path_index == 1)then
849851

850852
! C3: Rubisco-limited photosynthesis
851853
ac = vcmax * max(co2_intra_c-co2_cpoint, 0._r8) / &
@@ -867,14 +869,14 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
867869
if(sunsha == 1)then !sunlit
868870
!guard against /0's in the night.
869871
if((laisun_lsl * canopy_area_lsl) > 0.0000000001_r8) then
870-
aj = quant_eff(pp_type) * parsun_lsl * 4.6_r8
872+
aj = quant_eff(c3c4_path_index) * parsun_lsl * 4.6_r8
871873
!convert from per cohort to per m2 of leaf)
872874
aj = aj / (laisun_lsl * canopy_area_lsl)
873875
else
874876
aj = 0._r8
875877
end if
876878
else
877-
aj = quant_eff(pp_type) * parsha_lsl * 4.6_r8
879+
aj = quant_eff(c3c4_path_index) * parsha_lsl * 4.6_r8
878880
aj = aj / (laisha_lsl * canopy_area_lsl)
879881
end if
880882

@@ -884,7 +886,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
884886
end if
885887

886888
! Gross photosynthesis smoothing calculations. First co-limit ac and aj. Then co-limit ap
887-
aquad = theta_cj(pp_type)
889+
aquad = theta_cj(c3c4_path_index)
888890
bquad = -(ac + aj)
889891
cquad = ac * aj
890892
call quadratic_f (aquad, bquad, cquad, r1, r2)

0 commit comments

Comments
 (0)