Skip to content

Commit 0f2ea16

Browse files
authored
Merge pull request #2 from glemieux/fates_sp-deconflict-8abef14
Deconflict PR 632 with FATES master (commit 8abef14)
2 parents 347270b + 0ffab8b commit 0f2ea16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9250
-6455
lines changed

.zenodo.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"title": "The Functionally Assembled Terrestrial Ecosystem Simulator (FATES)",
3+
"creators": [
4+
{
5+
"name": "FATES Development Team"
6+
}
7+
],
8+
"license":"BSD-3-Clause"
9+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# FATES
22
------------------------------
3+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3825473.svg)](https://doi.org/10.5281/zenodo.3825473)
34

45
This repository holds the Functionally Assembled Terrestrial Ecosystem Simulator (FATES). FATES is a numerical terrestrial ecosystem model. Its development and support is primarily supported by the Department of Energy's Office of Science, through the Next Generation Ecosystem Experiment - Tropics ([NGEE-T](https://ngee-tropics.lbl.gov/)) project.
56

biogeochem/EDCanopyStructureMod.F90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ module EDCanopyStructureMod
2424
use EDTypesMod , only : nlevleaf
2525
use EDtypesMod , only : AREA
2626
use FatesGlobals , only : endrun => fates_endrun
27-
use FatesInterfaceMod , only : hlm_days_per_year
28-
use FatesInterfaceMod , only : hlm_use_planthydro
29-
use FatesInterfaceMod , only : hlm_use_cohort_age_tracking
30-
use FatesInterfaceMod , only : numpft
27+
use FatesInterfaceTypesMod , only : hlm_days_per_year
28+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
29+
use FatesInterfaceTypesMod , only : hlm_use_cohort_age_tracking
30+
use FatesInterfaceTypesMod , only : numpft
3131
use FatesPlantHydraulicsMod, only : UpdateH2OVeg,InitHydrCohort, RecruitWaterStorage
3232
use EDTypesMod , only : maxCohortsPerPatch
3333

@@ -121,7 +121,7 @@ subroutine canopy_structure( currentSite , bc_in )
121121

122122
use EDParamsMod, only : ED_val_comp_excln
123123
use EDTypesMod , only : min_patch_area
124-
use FatesInterfaceMod, only : bc_in_type
124+
use FatesInterfaceTypesMod, only : bc_in_type
125125
!
126126
! !ARGUMENTS
127127
type(ed_site_type) , intent(inout), target :: currentSite
@@ -1256,8 +1256,8 @@ subroutine canopy_summarization( nsites, sites, bc_in )
12561256
! Much of this routine was once ed_clm_link minus all the IO and history stuff
12571257
! ---------------------------------------------------------------------------------
12581258

1259-
use FatesInterfaceMod , only : bc_in_type
1260-
use FatesInterfaceMod , only : hlm_use_cohort_age_tracking
1259+
use FatesInterfaceTypesMod , only : bc_in_type
1260+
use FatesInterfaceTypesMod , only : hlm_use_cohort_age_tracking
12611261
use EDPatchDynamicsMod , only : set_patchno
12621262
use FatesSizeAgeTypeIndicesMod, only : sizetype_class_index
12631263
use FatesSizeAgeTypeIndicesMod, only : coagetype_class_index
@@ -1874,7 +1874,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
18741874

18751875
use EDTypesMod , only : ed_patch_type, ed_cohort_type, &
18761876
ed_site_type, AREA
1877-
use FatesInterfaceMod , only : bc_out_type
1877+
use FatesInterfaceTypesMod , only : bc_out_type
18781878
use EDPftvarcon , only : EDPftvarcon_inst
18791879

18801880

biogeochem/EDCohortDynamicsMod.F90

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ module EDCohortDynamicsMod
66
! !USES:
77
use FatesGlobals , only : endrun => fates_endrun
88
use FatesGlobals , only : fates_log
9-
use FatesInterfaceMod , only : hlm_freq_day
10-
use FatesInterfaceMod , only : bc_in_type
11-
use FatesInterfaceMod , only : hlm_use_planthydro
12-
use FatesInterfaceMod , only : hlm_use_cohort_age_tracking
9+
use FatesInterfaceTypesMod , only : hlm_freq_day
10+
use FatesInterfaceTypesMod , only : bc_in_type
11+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
12+
use FatesInterfaceTypesMod , only : hlm_use_cohort_age_tracking
1313
use FatesConstantsMod , only : r8 => fates_r8
1414
use FatesConstantsMod , only : fates_unset_int
1515
use FatesConstantsMod , only : itrue,ifalse
1616
use FatesConstantsMod , only : fates_unset_r8
1717
use FatesConstantsMod , only : nearzero
1818
use FatesConstantsMod , only : calloc_abs_error
19-
use FatesInterfaceMod , only : hlm_days_per_year
20-
use FatesInterfaceMod , only : nleafage
19+
use FatesInterfaceTypesMod , only : hlm_days_per_year
20+
use FatesInterfaceTypesMod , only : nleafage
2121
use SFParamsMod , only : SF_val_CWD_frac
2222
use EDPftvarcon , only : EDPftvarcon_inst
2323
use EDPftvarcon , only : GetDecompyFrac
@@ -38,17 +38,18 @@ module EDCohortDynamicsMod
3838
use EDTypesMod , only : site_fluxdiags_type
3939
use EDTypesMod , only : num_elements
4040
use EDParamsMod , only : ED_val_cohort_age_fusion_tol
41-
use FatesInterfaceMod , only : hlm_use_planthydro
42-
use FatesInterfaceMod , only : hlm_parteh_mode
41+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
42+
use FatesInterfaceTypesMod , only : hlm_parteh_mode
4343
use FatesPlantHydraulicsMod, only : FuseCohortHydraulics
4444
use FatesPlantHydraulicsMod, only : CopyCohortHydraulics
45-
use FatesPlantHydraulicsMod, only : updateSizeDepTreeHydProps
46-
use FatesPlantHydraulicsMod, only : initTreeHydStates
45+
use FatesPlantHydraulicsMod, only : UpdateSizeDepPlantHydProps
46+
use FatesPlantHydraulicsMod, only : InitPlantHydStates
4747
use FatesPlantHydraulicsMod, only : InitHydrCohort
4848
use FatesPlantHydraulicsMod, only : DeallocateHydrCohort
4949
use FatesPlantHydraulicsMod, only : AccumulateMortalityWaterStorage
50-
use FatesPlantHydraulicsMod, only : UpdateTreeHydrNodes
51-
use FatesPlantHydraulicsMod, only : UpdateTreeHydrLenVolCond
50+
use FatesPlantHydraulicsMod, only : UpdatePlantHydrNodes
51+
use FatesPlantHydraulicsMod, only : UpdatePlantHydrLenVol
52+
use FatesPlantHydraulicsMod, only : UpdatePlantKmax
5253
use FatesPlantHydraulicsMod, only : SavePreviousCompartmentVolumes
5354
use FatesPlantHydraulicsMod, only : ConstrainRecruitNumber
5455
use FatesSizeAgeTypeIndicesMod, only : sizetype_class_index
@@ -188,7 +189,7 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
188189
integer :: iage ! loop counter for leaf age classes
189190
real(r8) :: leaf_c ! total leaf carbon
190191
integer :: tnull,snull ! are the tallest and shortest cohorts allocate
191-
integer :: nlevsoi_hyd ! number of hydraulically active soil layers
192+
integer :: nlevrhiz ! number of rhizosphere layers
192193

193194
!----------------------------------------------------------------------
194195

@@ -300,25 +301,28 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
300301

301302
if( hlm_use_planthydro.eq.itrue ) then
302303

303-
nlevsoi_hyd = currentSite%si_hydr%nlevsoi_hyd
304+
nlevrhiz = currentSite%si_hydr%nlevrhiz
304305

305306
! This allocates array spaces
306307
call InitHydrCohort(currentSite,new_cohort)
307308

308309
! This calculates node heights
309-
call UpdateTreeHydrNodes(new_cohort%co_hydr,new_cohort%pft, &
310-
new_cohort%hite,nlevsoi_hyd,bc_in)
310+
call UpdatePlantHydrNodes(new_cohort%co_hydr,new_cohort%pft, &
311+
new_cohort%hite,currentSite%si_hydr)
311312

312-
! This calculates volumes, lengths and max conductances
313-
call UpdateTreeHydrLenVolCond(new_cohort,nlevsoi_hyd,bc_in)
313+
! This calculates volumes and lengths
314+
call UpdatePlantHydrLenVol(new_cohort,currentSite%si_hydr)
314315

316+
! This updates the Kmax's of the plant's compartments
317+
call UpdatePlantKmax(new_cohort%co_hydr,new_cohort,currentSite%si_hydr)
318+
315319
! Since this is a newly initialized plant, we set the previous compartment-size
316320
! equal to the ones we just calculated.
317321
call SavePreviousCompartmentVolumes(new_cohort%co_hydr)
318322

319323
! This comes up with starter suctions and then water contents
320324
! based on the soil values
321-
call initTreeHydStates(currentSite,new_cohort, bc_in)
325+
call InitPlantHydStates(currentSite,new_cohort)
322326

323327
if(recruitstatus==1)then
324328

@@ -949,7 +953,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
949953
! !USES:
950954
use EDParamsMod , only : ED_val_cohort_size_fusion_tol
951955
use EDParamsMod , only : ED_val_cohort_age_fusion_tol
952-
use FatesInterfaceMod , only : hlm_use_cohort_age_tracking
956+
use FatesInterfaceTypesMod , only : hlm_use_cohort_age_tracking
953957
use FatesConstantsMod , only : itrue
954958
use FatesConstantsMod, only : days_per_year
955959
use EDTypesMod , only : maxCohortsPerPatch
@@ -981,7 +985,6 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
981985
real(r8) :: leaf_c_target
982986
real(r8) :: dynamic_size_fusion_tolerance
983987
real(r8) :: dynamic_age_fusion_tolerance
984-
integer :: maxCohortsPerPatch_age_tracking
985988
real(r8) :: dbh
986989
real(r8) :: leaf_c ! leaf carbon [kg]
987990

@@ -1000,11 +1003,6 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
10001003
! set the cohort age fusion tolerance (in fraction of years)
10011004
dynamic_age_fusion_tolerance = ED_val_cohort_age_fusion_tol
10021005

1003-
if ( hlm_use_cohort_age_tracking .eq. itrue) then
1004-
maxCohortsPerPatch_age_tracking = 300
1005-
end if
1006-
1007-
10081006

10091007
!This needs to be a function of the canopy layer, because otherwise, at canopy closure
10101008
!the number of cohorts doubles and very dissimilar cohorts are fused together
@@ -1386,12 +1384,13 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
13861384
currentCohort%pft, currentCohort%c_area, currentCohort%n, &
13871385
currentCohort%canopy_layer, currentPatch%canopy_layer_tlai, &
13881386
currentCohort%vcmax25top )
1389-
call updateSizeDepTreeHydProps(currentSite,currentCohort, bc_in)
1387+
call UpdateSizeDepPlantHydProps(currentSite,currentCohort, bc_in)
13901388
endif
1391-
1389+
13921390
call DeallocateCohort(nextc)
13931391
deallocate(nextc)
13941392
nullify(nextc)
1393+
13951394

13961395
endif ! if( currentCohort%isnew.eqv.nextc%isnew ) then
13971396
endif !canopy layer
@@ -1429,7 +1428,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
14291428

14301429

14311430
if ( hlm_use_cohort_age_tracking .eq.itrue) then
1432-
if ( nocohorts > maxCohortsPerPatch_age_tracking ) then
1431+
if ( nocohorts > maxCohortsPerPatch ) then
14331432
iterate = 1
14341433
!---------------------------------------------------------------------!
14351434
! Making profile tolerance larger means that more fusion will happen !

biogeochem/EDLoggingMortalityMod.F90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ module EDLoggingMortalityMod
3838
use EDParamsMod , only : logging_mechanical_frac
3939
use EDParamsMod , only : logging_coll_under_frac
4040
use EDParamsMod , only : logging_dbhmax_infra
41-
use FatesInterfaceMod , only : hlm_current_year
42-
use FatesInterfaceMod , only : hlm_current_month
43-
use FatesInterfaceMod , only : hlm_current_day
44-
use FatesInterfaceMod , only : hlm_model_day
45-
use FatesInterfaceMod , only : hlm_day_of_year
46-
use FatesInterfaceMod , only : hlm_days_per_year
47-
use FatesInterfaceMod , only : hlm_use_logging
48-
use FatesInterfaceMod , only : hlm_use_planthydro
41+
use FatesInterfaceTypesMod , only : hlm_current_year
42+
use FatesInterfaceTypesMod , only : hlm_current_month
43+
use FatesInterfaceTypesMod , only : hlm_current_day
44+
use FatesInterfaceTypesMod , only : hlm_model_day
45+
use FatesInterfaceTypesMod , only : hlm_day_of_year
46+
use FatesInterfaceTypesMod , only : hlm_days_per_year
47+
use FatesInterfaceTypesMod , only : hlm_use_logging
48+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
4949
use FatesConstantsMod , only : itrue,ifalse
5050
use FatesGlobals , only : endrun => fates_endrun
5151
use FatesGlobals , only : fates_log

biogeochem/EDMortalityFunctionsMod.F90

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ module EDMortalityFunctionsMod
1313
use FatesConstantsMod , only : itrue,ifalse
1414
use FatesAllometryMod , only : bleaf
1515
use FatesAllometryMod , only : storage_fraction_of_target
16-
use FatesInterfaceMod , only : bc_in_type
17-
use FatesInterfaceMod , only : hlm_use_ed_prescribed_phys
18-
use FatesInterfaceMod , only : hlm_freq_day
19-
use FatesInterfaceMod , only : hlm_use_planthydro
16+
use FatesInterfaceTypesMod , only : bc_in_type
17+
use FatesInterfaceTypesMod , only : hlm_use_ed_prescribed_phys
18+
use FatesInterfaceTypesMod , only : hlm_freq_day
19+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
2020
use EDLoggingMortalityMod , only : LoggingMortality_frac
2121
use EDParamsMod , only : fates_mortality_disturbance_fraction
22-
use FatesInterfaceMod , only : bc_in_type
22+
use FatesInterfaceTypesMod , only : bc_in_type
2323

2424
use PRTGenericMod, only : all_carbon_elements
2525
use PRTGenericMod, only : store_organ
@@ -50,7 +50,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
5050
! ============================================================================
5151

5252
use FatesConstantsMod, only : tfrz => t_water_freeze_k_1atm
53-
use FatesInterfaceMod , only : hlm_hio_ignore_val
53+
use FatesInterfaceTypesMod , only : hlm_hio_ignore_val
5454
use FatesConstantsMod, only : fates_check_param_set
5555

5656
type (ed_cohort_type), intent(in) :: cohort_in
@@ -62,7 +62,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
6262
real(r8),intent(out) :: smort ! size dependent senescence term
6363
real(r8),intent(out) :: asmort ! age dependent senescence term
6464

65-
65+
integer :: ifp
6666
real(r8) :: frac ! relativised stored carbohydrate
6767
real(r8) :: leaf_c_target ! target leaf biomass kgC
6868
real(r8) :: store_c
@@ -128,9 +128,9 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
128128
hf_flc_threshold = EDPftvarcon_inst%hf_flc_threshold(cohort_in%pft)
129129
if(hlm_use_planthydro.eq.itrue)then
130130
!note the flc is set as the fraction of max conductivity in hydro
131-
min_fmc_ag = minval(cohort_in%co_hydr%flc_ag(:))
132-
min_fmc_tr = minval(cohort_in%co_hydr%flc_troot(:))
133-
min_fmc_ar = minval(cohort_in%co_hydr%flc_aroot(:))
131+
min_fmc_ag = minval(cohort_in%co_hydr%ftc_ag(:))
132+
min_fmc_tr = cohort_in%co_hydr%ftc_troot
133+
min_fmc_ar = minval(cohort_in%co_hydr%ftc_aroot(:))
134134
min_fmc = min(min_fmc_ag, min_fmc_tr)
135135
min_fmc = min(min_fmc, min_fmc_ar)
136136
flc = 1.0_r8-min_fmc
@@ -173,7 +173,8 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
173173
! Eastern US carbon sink. Glob. Change Biol., 12, 2370-2390,
174174
! doi: 10.1111/j.1365-2486.2006.01254.x
175175

176-
temp_in_C = bc_in%t_veg24_si - tfrz
176+
ifp = cohort_in%patchptr%patchno
177+
temp_in_C = bc_in%t_veg24_pa(ifp) - tfrz
177178
temp_dep_fraction = max(0.0_r8, min(1.0_r8, 1.0_r8 - (temp_in_C - &
178179
EDPftvarcon_inst%freezetol(cohort_in%pft))/frost_mort_buffer) )
179180
frmort = EDPftvarcon_inst%mort_scalar_coldstress(cohort_in%pft) * temp_dep_fraction
@@ -217,7 +218,7 @@ subroutine Mortality_Derivative( currentSite, currentCohort, bc_in)
217218
!
218219
! !USES:
219220

220-
use FatesInterfaceMod, only : hlm_freq_day
221+
use FatesInterfaceTypesMod, only : hlm_freq_day
221222
!
222223
! !ARGUMENTS
223224
type(ed_site_type), intent(inout), target :: currentSite

biogeochem/EDPatchDynamicsMod.F90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module EDPatchDynamicsMod
44
! Controls formation, creation, fusing and termination of patch level processes.
55
! ============================================================================
66
use FatesGlobals , only : fates_log
7-
use FatesInterfaceMod , only : hlm_freq_day
7+
use FatesInterfaceTypesMod , only : hlm_freq_day
88
use EDPftvarcon , only : EDPftvarcon_inst
99
use EDPftvarcon , only : GetDecompyFrac
1010
use EDCohortDynamicsMod , only : fuse_cohorts, sort_cohorts, insert_cohort
@@ -37,11 +37,11 @@ module EDPatchDynamicsMod
3737
use EDTypesMod , only : dl_sf
3838
use EDTypesMod , only : dump_patch
3939
use FatesConstantsMod , only : rsnbl_math_prec
40-
use FatesInterfaceMod , only : hlm_use_planthydro
41-
use FatesInterfaceMod , only : hlm_numSWb
42-
use FatesInterfaceMod , only : bc_in_type
43-
use FatesInterfaceMod , only : hlm_days_per_year
44-
use FatesInterfaceMod , only : numpft
40+
use FatesInterfaceTypesMod , only : hlm_use_planthydro
41+
use FatesInterfaceTypesMod , only : hlm_numSWb
42+
use FatesInterfaceTypesMod , only : bc_in_type
43+
use FatesInterfaceTypesMod , only : hlm_days_per_year
44+
use FatesInterfaceTypesMod , only : numpft
4545
use FatesGlobals , only : endrun => fates_endrun
4646
use FatesConstantsMod , only : r8 => fates_r8
4747
use FatesConstantsMod , only : itrue, ifalse
@@ -75,7 +75,7 @@ module EDPatchDynamicsMod
7575
use PRTGenericMod, only : repro_organ
7676
use PRTGenericMod, only : struct_organ
7777
use PRTLossFluxesMod, only : PRTBurnLosses
78-
use FatesInterfaceMod, only : hlm_parteh_mode
78+
use FatesInterfaceTypesMod, only : hlm_parteh_mode
7979
use PRTGenericMod, only : prt_carbon_allom_hyp
8080
use PRTGenericMod, only : prt_cnp_flex_allom_hyp
8181

0 commit comments

Comments
 (0)