Skip to content

Commit 57cf6c5

Browse files
committed
Merge branch 'master' into ncar-ngeet-release-3
2 parents e0249ae + c8e6da5 commit 57cf6c5

28 files changed

+2826
-1977
lines changed

biogeochem/EDCanopyStructureMod.F90

Lines changed: 854 additions & 657 deletions
Large diffs are not rendered by default.

biogeochem/EDCohortDynamicsMod.F90

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ module EDCohortDynamicsMod
1010
use FatesInterfaceMod , only : bc_in_type
1111
use FatesConstantsMod , only : r8 => fates_r8
1212
use FatesConstantsMod , only : fates_unset_int
13+
use FatesConstantsMod , only : itrue
1314
use FatesInterfaceMod , only : hlm_days_per_year
1415
use EDPftvarcon , only : EDPftvarcon_inst
15-
use EDEcophysContype , only : EDecophyscon
1616
use EDGrowthFunctionsMod , only : c_area, tree_lai
1717
use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type
1818
use EDTypesMod , only : nclmax
@@ -21,7 +21,7 @@ module EDCohortDynamicsMod
2121
use EDTypesMod , only : sclass_ed,nlevsclass_ed,AREA
2222
use EDTypesMod , only : min_npm2, min_nppatch
2323
use EDTypesMod , only : min_n_safemath
24-
use EDTypesMod , only : use_fates_plant_hydro
24+
use FatesInterfaceMod , only : hlm_use_planthydro
2525
use FatesPlantHydraulicsMod, only : FuseCohortHydraulics
2626
use FatesPlantHydraulicsMod, only : CopyCohortHydraulics
2727
use FatesPlantHydraulicsMod, only : updateSizeDepTreeHydProps
@@ -172,7 +172,7 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, &
172172
! growth, disturbance and mortality.
173173
new_cohort%isnew = .true.
174174

175-
if( use_fates_plant_hydro ) then
175+
if( hlm_use_planthydro.eq.itrue ) then
176176
call InitHydrCohort(new_cohort)
177177
call updateSizeDepTreeHydProps(new_cohort, bc_in)
178178
call initTreeHydStates(new_cohort, bc_in)
@@ -216,7 +216,7 @@ subroutine allocate_live_biomass(cc_p,mode)
216216

217217
currentCohort => cc_p
218218
ft = currentcohort%pft
219-
leaf_frac = 1.0_r8/(1.0_r8 + EDecophyscon%sapwood_ratio(ft) * currentcohort%hite + EDPftvarcon_inst%froot_leaf(ft))
219+
leaf_frac = 1.0_r8/(1.0_r8 + EDpftvarcon_inst%allom_latosa_int(ft) * currentcohort%hite + EDPftvarcon_inst%allom_l2fr(ft))
220220

221221
!currentcohort%bl = currentcohort%balive*leaf_frac
222222
!for deciduous trees, there are no leaves
@@ -228,8 +228,8 @@ subroutine allocate_live_biomass(cc_p,mode)
228228

229229
! iagnore the root and stem biomass from the functional balance hypothesis. This is used when the leaves are
230230
!fully on.
231-
!currentcohort%br = EDPftvarcon_inst%froot_leaf(ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
232-
!currentcohort%bsw = EDecophyscon%sapwood_ratio(ft) * currentcohort%hite *(currentcohort%balive + &
231+
!currentcohort%br = EDPftvarcon_inst%allom_l2fr(ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
232+
!currentcohort%bsw = EDpftvarcon_inst%allom_latosa_int(ft) * currentcohort%hite *(currentcohort%balive + &
233233
! currentcohort%laimemory)*leaf_frac
234234

235235
leaves_off_switch = 0
@@ -245,9 +245,9 @@ subroutine allocate_live_biomass(cc_p,mode)
245245

246246
new_bl = currentcohort%balive*leaf_frac
247247

248-
new_br = EDpftvarcon_inst%froot_leaf(ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
248+
new_br = EDpftvarcon_inst%allom_l2fr(ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
249249

250-
new_bsw = EDecophyscon%sapwood_ratio(ft) * currentcohort%hite *(currentcohort%balive + &
250+
new_bsw = EDpftvarcon_inst%allom_latosa_int(ft) * currentcohort%hite *(currentcohort%balive + &
251251
currentcohort%laimemory)*leaf_frac
252252

253253
!diagnose the root and stem biomass from the functional balance hypothesis. This is used when the leaves are
@@ -279,13 +279,13 @@ subroutine allocate_live_biomass(cc_p,mode)
279279
!not have enough live biomass to support the hypothesized root mass
280280
!thus, we use 'ratio_balive' to adjust br and bsw. Apologies that this is so complicated! RF
281281

282-
ideal_balive = currentcohort%laimemory * EDPftvarcon_inst%froot_leaf(ft) + &
283-
currentcohort%laimemory* EDecophyscon%sapwood_ratio(ft) * currentcohort%hite
282+
ideal_balive = currentcohort%laimemory * EDPftvarcon_inst%allom_l2fr(ft) + &
283+
currentcohort%laimemory* EDpftvarcon_inst%allom_latosa_int(ft) * currentcohort%hite
284284
ratio_balive = currentcohort%balive / ideal_balive
285285

286-
new_br = EDpftvarcon_inst%froot_leaf(ft) * (ideal_balive + currentcohort%laimemory) * &
286+
new_br = EDpftvarcon_inst%allom_l2fr(ft) * (ideal_balive + currentcohort%laimemory) * &
287287
leaf_frac * ratio_balive
288-
new_bsw = EDecophyscon%sapwood_ratio(ft) * currentcohort%hite * &
288+
new_bsw = EDpftvarcon_inst%allom_latosa_int(ft) * currentcohort%hite * &
289289
(ideal_balive + currentcohort%laimemory) * leaf_frac * ratio_balive
290290

291291
! Diagnostics
@@ -505,7 +505,6 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
505505
! terminates cohorts when they get too small
506506
!
507507
! !USES:
508-
use EDParamsMod, only : ED_val_ag_biomass
509508
use SFParamsMod, only : SF_val_CWD_frac
510509
!
511510
! !ARGUMENTS
@@ -618,10 +617,10 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
618617

619618
currentPatch%CWD_AG(c) = currentPatch%CWD_AG(c) + currentCohort%n*(currentCohort%bdead+currentCohort%bsw) / &
620619
currentPatch%area &
621-
* SF_val_CWD_frac(c) * ED_val_ag_biomass
620+
* SF_val_CWD_frac(c) * EDPftvarcon_inst%allom_agb_frac(currentCohort%pft)
622621
currentPatch%CWD_BG(c) = currentPatch%CWD_BG(c) + currentCohort%n*(currentCohort%bdead+currentCohort%bsw) / &
623622
currentPatch%area &
624-
* SF_val_CWD_frac(c) * (1.0_r8 - ED_val_ag_biomass)
623+
* SF_val_CWD_frac(c) * (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(currentCohort%pft))
625624
enddo
626625

627626
currentPatch%leaf_litter(currentCohort%pft) = currentPatch%leaf_litter(currentCohort%pft) + currentCohort%n* &
@@ -633,10 +632,10 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
633632
do c=1,ncwd
634633
currentSite%CWD_AG_diagnostic_input_carbonflux(c) = currentSite%CWD_AG_diagnostic_input_carbonflux(c) &
635634
+ currentCohort%n*(currentCohort%bdead+currentCohort%bsw) * &
636-
SF_val_CWD_frac(c) * ED_val_ag_biomass * hlm_days_per_year / AREA
635+
SF_val_CWD_frac(c) * EDPftvarcon_inst%allom_agb_frac(currentCohort%pft) * hlm_days_per_year / AREA
637636
currentSite%CWD_BG_diagnostic_input_carbonflux(c) = currentSite%CWD_BG_diagnostic_input_carbonflux(c) &
638637
+ currentCohort%n*(currentCohort%bdead+currentCohort%bsw) * &
639-
SF_val_CWD_frac(c) * (1.0_r8 - ED_val_ag_biomass) * hlm_days_per_year / AREA
638+
SF_val_CWD_frac(c) * (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(currentCohort%pft)) * hlm_days_per_year / AREA
640639
enddo
641640

642641
currentSite%leaf_litter_diagnostic_input_carbonflux(currentCohort%pft) = &
@@ -646,7 +645,7 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
646645
currentSite%root_litter_diagnostic_input_carbonflux(currentCohort%pft) + &
647646
currentCohort%n * (currentCohort%br+currentCohort%bstore) * hlm_days_per_year / AREA
648647

649-
if (use_fates_plant_hydro) call DeallocateHydrCohort(currentCohort)
648+
if (hlm_use_planthydro.eq.itrue) call DeallocateHydrCohort(currentCohort)
650649

651650
deallocate(currentCohort)
652651
endif
@@ -676,8 +675,8 @@ subroutine fuse_cohorts(patchptr, bc_in)
676675
type (ed_cohort_type) , pointer :: currentCohort, nextc, nextnextc
677676
integer :: i
678677
integer :: fusion_took_place
679-
integer :: maxcohorts !maximum total no of cohorts. Needs to be >numpft_edx2
680-
integer :: iterate !do we need to keep fusing to get below maxcohorts?
678+
integer :: maxcohorts ! maximum total no of cohorts.
679+
integer :: iterate ! do we need to keep fusing to get below maxcohorts?
681680
integer :: nocohorts
682681
real(r8) :: newn
683682
real(r8) :: diff
@@ -799,7 +798,7 @@ subroutine fuse_cohorts(patchptr, bc_in)
799798
call sizetype_class_index(currentCohort%dbh,currentCohort%pft, &
800799
currentCohort%size_class,currentCohort%size_by_pft_class)
801800

802-
if(use_fates_plant_hydro) call FuseCohortHydraulics(currentCohort,nextc,bc_in,newn)
801+
if(hlm_use_planthydro.eq.itrue) call FuseCohortHydraulics(currentCohort,nextc,bc_in,newn)
803802

804803
! recent canopy history
805804
currentCohort%canopy_layer_yesterday = (currentCohort%n*currentCohort%canopy_layer_yesterday + &
@@ -888,7 +887,7 @@ subroutine fuse_cohorts(patchptr, bc_in)
888887
endif
889888

890889
if (associated(nextc)) then
891-
if(use_fates_plant_hydro) call DeallocateHydrCohort(nextc)
890+
if(hlm_use_planthydro.eq.itrue) call DeallocateHydrCohort(nextc)
892891
deallocate(nextc)
893892
endif
894893

@@ -1246,7 +1245,7 @@ subroutine copy_cohort( currentCohort,copyc )
12461245

12471246
! Plant Hydraulics
12481247

1249-
if( use_fates_plant_hydro ) call CopyCohortHydraulics(n,o)
1248+
if( hlm_use_planthydro.eq.itrue ) call CopyCohortHydraulics(n,o)
12501249

12511250
! indices for binning
12521251
n%size_class = o%size_class

biogeochem/EDGrowthFunctionsMod.F90

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ real(r8) function Dbh( cohort_in )
4444
type(ed_cohort_type), intent(in) :: cohort_in
4545

4646
!FIX(SPM,040214) - move to param file
47-
real(r8) :: m !parameter of allometric equation (needs to not be hardwired...
48-
real(r8) :: c !parameter of allometric equation (needs to not be hardwired...
47+
real(r8) :: m ! parameter of allometric equation
48+
real(r8) :: c ! parameter of allometric equation
4949

50-
m = EDPftvarcon_inst%dbh2h_m(cohort_in%pft)
51-
c = EDPftvarcon_inst%dbh2h_c(cohort_in%pft)
50+
m = EDPftvarcon_inst%allom_d2h1(cohort_in%pft)
51+
c = EDPftvarcon_inst%allom_d2h2(cohort_in%pft)
5252

5353
dbh = (10.0_r8**((log10(cohort_in%hite) - c)/m))
5454

@@ -71,8 +71,8 @@ real(r8) function Hite( cohort_in )
7171
real(r8) :: c
7272
real(r8) :: h
7373

74-
m = EDPftvarcon_inst%dbh2h_m(cohort_in%pft)
75-
c = EDPftvarcon_inst%dbh2h_c(cohort_in%pft)
74+
m = EDPftvarcon_inst%allom_d2h1(cohort_in%pft)
75+
c = EDPftvarcon_inst%allom_d2h2(cohort_in%pft)
7676

7777
if(cohort_in%dbh <= 0._r8)then
7878
write(fates_log(),*) 'ED: dbh less than zero problem!'
@@ -107,11 +107,11 @@ real(r8) function Bleaf( cohort_in )
107107
real(r8) :: dbh2bl_b
108108
real(r8) :: dbh2bl_c
109109
real(r8) :: slascaler ! changes the target biomass according to the SLA
110-
111-
dbh2bl_a = EDPftvarcon_inst%dbh2bl_a(cohort_in%pft)
112-
dbh2bl_b = EDPftvarcon_inst%dbh2bl_b(cohort_in%pft)
113-
dbh2bl_c = EDPftvarcon_inst%dbh2bl_c(cohort_in%pft)
114-
slascaler = EDPftvarcon_inst%dbh2bl_slascaler(cohort_in%pft)/EDPftvarcon_inst%slatop(cohort_in%pft)
110+
111+
dbh2bl_a = EDPftvarcon_inst%allom_d2bl1(cohort_in%pft)
112+
dbh2bl_b = EDPftvarcon_inst%allom_d2bl2(cohort_in%pft)
113+
dbh2bl_c = EDPftvarcon_inst%allom_d2bl3(cohort_in%pft)
114+
slascaler = EDPftvarcon_inst%allom_d2bl_slascaler(cohort_in%pft)/EDPftvarcon_inst%slatop(cohort_in%pft)
115115

116116
if(cohort_in%dbh < 0._r8.or.cohort_in%pft == 0.or.cohort_in%dbh > 1000.0_r8)then
117117
write(fates_log(),*) 'problems in bleaf',cohort_in%dbh,cohort_in%pft
@@ -191,7 +191,7 @@ real(r8) function tree_sai( cohort_in )
191191
real(r8) :: bdead_per_unitarea ! KgC of leaf per m2 area of ground.
192192
real(r8) :: sai_scaler
193193

194-
sai_scaler = EDPftvarcon_inst%sai_scaler(cohort_in%pft)
194+
sai_scaler = EDPftvarcon_inst%allom_sai_scaler(cohort_in%pft)
195195

196196
if( cohort_in%bdead < 0._r8 .or. cohort_in%pft == 0 ) then
197197
write(fates_log(),*) 'problem in treesai',cohort_in%bdead,cohort_in%pft
@@ -234,10 +234,10 @@ real(r8) function c_area( cohort_in )
234234
integer :: can_layer_index
235235

236236
! default is to use the same exponent as the dbh to bleaf exponent so that per-plant canopy depth remains invariant during growth,
237-
! but allowed to vary via the dbh2bl_dbh2carea_expnt_diff term (which has default value of zero)
238-
crown_area_to_dbh_exponent = EDPftvarcon_inst%dbh2bl_b(cohort_in%pft) + &
239-
EDPftvarcon_inst%dbh2bl_dbh2carea_expnt_diff(cohort_in%pft)
240-
237+
! but allowed to vary via the allom_blca_expnt_diff term (which has default value of zero)
238+
crown_area_to_dbh_exponent = EDPftvarcon_inst%allom_d2bl2(cohort_in%pft) + &
239+
EDPftvarcon_inst%allom_blca_expnt_diff(cohort_in%pft)
240+
241241
if (DEBUG_growth) then
242242
write(fates_log(),*) 'z_area 1',cohort_in%dbh,cohort_in%pft
243243
write(fates_log(),*) 'z_area 2',EDPftvarcon_inst%max_dbh
@@ -247,7 +247,7 @@ real(r8) function c_area( cohort_in )
247247
write(fates_log(),*) 'z_area 6',cohort_in%canopy_layer
248248
write(fates_log(),*) 'z_area 7',ED_val_grass_spread
249249
end if
250-
250+
251251
dbh = min(cohort_in%dbh,EDPftvarcon_inst%max_dbh(cohort_in%pft))
252252

253253
! ----------------------------------------------------------------------------------
@@ -278,7 +278,12 @@ real(r8) function Bdead( cohort_in )
278278
! ============================================================================
279279
! Calculate stem biomass from height(m) dbh(cm) and wood density(g/cm3)
280280
! default params using allometry of J.G. Saldarriaga et al 1988 - Rio Negro
281-
! Journal of Ecology vol 76 p938-958
281+
! Journal of Ecology vol 76 p938-958
282+
!
283+
! NOTE (RGK 07-2017) Various other biomass allometries calculate above ground
284+
! biomass, and it appear Saldariagga may be an outlier that calculates total
285+
! biomass (these parameters will have to be a placeholder for both)
286+
!
282287
! ============================================================================
283288

284289
type(ed_cohort_type), intent(in) :: cohort_in
@@ -288,10 +293,10 @@ real(r8) function Bdead( cohort_in )
288293
real(r8) :: dbh2bd_c
289294
real(r8) :: dbh2bd_d
290295

291-
dbh2bd_a = EDPftvarcon_inst%dbh2bd_a(cohort_in%pft)
292-
dbh2bd_b = EDPftvarcon_inst%dbh2bd_b(cohort_in%pft)
293-
dbh2bd_c = EDPftvarcon_inst%dbh2bd_c(cohort_in%pft)
294-
dbh2bd_d = EDPftvarcon_inst%dbh2bd_d(cohort_in%pft)
296+
dbh2bd_a = EDPftvarcon_inst%allom_agb1(cohort_in%pft)
297+
dbh2bd_b = EDPftvarcon_inst%allom_agb2(cohort_in%pft)
298+
dbh2bd_c = EDPftvarcon_inst%allom_agb3(cohort_in%pft)
299+
dbh2bd_d = EDPftvarcon_inst%allom_agb4(cohort_in%pft)
295300

296301
bdead = dbh2bd_a*(cohort_in%hite**dbh2bd_b)*(cohort_in%dbh**dbh2bd_c)* &
297302
(EDPftvarcon_inst%wood_density(cohort_in%pft)** dbh2bd_d)
@@ -315,10 +320,10 @@ real(r8) function dHdBd( cohort_in )
315320
real(r8) :: dbh2bd_c
316321
real(r8) :: dbh2bd_d
317322

318-
dbh2bd_a = EDPftvarcon_inst%dbh2bd_a(cohort_in%pft)
319-
dbh2bd_b = EDPftvarcon_inst%dbh2bd_b(cohort_in%pft)
320-
dbh2bd_c = EDPftvarcon_inst%dbh2bd_c(cohort_in%pft)
321-
dbh2bd_d = EDPftvarcon_inst%dbh2bd_d(cohort_in%pft)
323+
dbh2bd_a = EDPftvarcon_inst%allom_agb1(cohort_in%pft)
324+
dbh2bd_b = EDPftvarcon_inst%allom_agb2(cohort_in%pft)
325+
dbh2bd_c = EDPftvarcon_inst%allom_agb3(cohort_in%pft)
326+
dbh2bd_d = EDPftvarcon_inst%allom_agb4(cohort_in%pft)
322327

323328
dbddh = dbh2bd_a*dbh2bd_b*(cohort_in%hite**(dbh2bd_b-1.0_r8))*(cohort_in%dbh**dbh2bd_c)* &
324329
(EDPftvarcon_inst%wood_density(cohort_in%pft)**dbh2bd_d)
@@ -347,14 +352,14 @@ real(r8) function dDbhdBd( cohort_in )
347352
real(r8) :: dbh2bd_b
348353
real(r8) :: dbh2bd_c
349354
real(r8) :: dbh2bd_d
355+
356+
m = EDPftvarcon_inst%allom_d2h1(cohort_in%pft)
357+
c = EDPftvarcon_inst%allom_d2h2(cohort_in%pft)
350358

351-
m = EDPftvarcon_inst%dbh2h_m(cohort_in%pft)
352-
c = EDPftvarcon_inst%dbh2h_c(cohort_in%pft)
353-
354-
dbh2bd_a = EDPftvarcon_inst%dbh2bd_a(cohort_in%pft)
355-
dbh2bd_b = EDPftvarcon_inst%dbh2bd_b(cohort_in%pft)
356-
dbh2bd_c = EDPftvarcon_inst%dbh2bd_c(cohort_in%pft)
357-
dbh2bd_d = EDPftvarcon_inst%dbh2bd_d(cohort_in%pft)
359+
dbh2bd_a = EDPftvarcon_inst%allom_agb1(cohort_in%pft)
360+
dbh2bd_b = EDPftvarcon_inst%allom_agb2(cohort_in%pft)
361+
dbh2bd_c = EDPftvarcon_inst%allom_agb3(cohort_in%pft)
362+
dbh2bd_d = EDPftvarcon_inst%allom_agb4(cohort_in%pft)
358363

359364
dBD_dDBH = dbh2bd_c*dbh2bd_a*(cohort_in%hite**dbh2bd_b)*(cohort_in%dbh**(dbh2bd_c-1.0_r8))* &
360365
(EDPftvarcon_inst%wood_density(cohort_in%pft)**dbh2bd_d)
@@ -387,9 +392,11 @@ real(r8) function dDbhdBl( cohort_in )
387392
real(r8) :: dbh2bl_b
388393
real(r8) :: dbh2bl_c
389394

390-
dbh2bl_a = EDPftvarcon_inst%dbh2bl_a(cohort_in%pft)
391-
dbh2bl_b = EDPftvarcon_inst%dbh2bl_b(cohort_in%pft)
392-
dbh2bl_c = EDPftvarcon_inst%dbh2bl_c(cohort_in%pft)
395+
dbh2bl_a = EDPftvarcon_inst%allom_d2bl1(cohort_in%pft)
396+
dbh2bl_b = EDPftvarcon_inst%allom_d2bl2(cohort_in%pft)
397+
dbh2bl_c = EDPftvarcon_inst%allom_d2bl3(cohort_in%pft)
398+
399+
393400
dblddbh = dbh2bl_b*dbh2bl_a*(cohort_in%dbh**dbh2bl_b)*(EDPftvarcon_inst%wood_density(cohort_in%pft)**dbh2bl_c)
394401
dblddbh = dblddbh*cohort_in%canopy_trim
395402

0 commit comments

Comments
 (0)