From bc4468e2e5f7f26a8cbd5dbbd4945ace73f758ad Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Fri, 2 Jun 2023 17:31:53 -0700 Subject: [PATCH 1/8] A few allometry-related updates. 1. Added new IALLOM option, which combines the leaf area allometry model from IALLOM=3 with the height-based root allometry from IALLOM=4. 2. Define the root profile as a cohort-based variable, and moved the calculation of root distribution to a specific allometric function. 3. Few minor bug fixes. --- ED/build/make/include.mk.macosx | 11 +- ED/src/dynamics/disturbance.f90 | 10 +- ED/src/dynamics/farq_katul.f90 | 12 -- ED/src/dynamics/growth_balive.f90 | 81 +++++----- ED/src/dynamics/plant_hydro.f90 | 50 ++---- ED/src/init/ed_params.f90 | 114 ++++++++------ ED/src/init/ed_type_init.f90 | 9 +- ED/src/io/ed_init_history.f90 | 2 + ED/src/io/ed_read_ed21_history.f90 | 192 +++++++++++++--------- ED/src/memory/ed_state_vars.F90 | 15 ++ ED/src/memory/pft_coms.f90 | 3 + ED/src/utils/allometry.f90 | 150 +++++++++++++----- ED/src/utils/update_derived_utils.f90 | 52 ++++-- diff_version.sh | 219 +++++++++++++++++++------- 14 files changed, 601 insertions(+), 319 deletions(-) diff --git a/ED/build/make/include.mk.macosx b/ED/build/make/include.mk.macosx index 69ed3365c..a2e426af0 100644 --- a/ED/build/make/include.mk.macosx +++ b/ED/build/make/include.mk.macosx @@ -20,8 +20,8 @@ BASE=$(ED_ROOT)/build/ # libraries compiled with the same compiler you set for F_COMP and C_COMP. You may still # # be able to compile without HDF5 but it will not run. # #------------------------------------------------------------------------------------------# -ZLIB_PATH=/Users/mlongo/Util/ED2_Libs/zlib-1.2.11 -HDF5_PATH=/Users/mlongo/Util/ED2_Libs/hdf5-1.10.2 +ZLIB_PATH=/usr/local +HDF5_PATH=/usr/local HDF5_INCS=-I$(HDF5_PATH)/include HDF5C_INCS=$(HDF5_INCS) HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl @@ -51,10 +51,9 @@ USE_INTERF=1 #################################### COMPILER SETTINGS ##################################### CMACH=MAC_OS_X FC_TYPE=GNU -F_COMP=gfortran -C_COMP=gcc -LOADER=gfortran -C_LOADER=gcc +F_COMP=/usr/local/bin/gfortran-12 +C_COMP=/usr/local/bin/gcc-12 +LOADER=/usr/local/bin/gfortran-12 LIBS= MOD_EXT=mod ############################################################################################ diff --git a/ED/src/dynamics/disturbance.f90 b/ED/src/dynamics/disturbance.f90 index f1dc10627..19c30219d 100644 --- a/ED/src/dynamics/disturbance.f90 +++ b/ED/src/dynamics/disturbance.f90 @@ -4098,7 +4098,8 @@ subroutine prune_lianas(csite, np, lsl) , h2dbh & ! function , size2bl & ! function , size2bd & ! function - , size2krdepth ! ! function + , size2krdepth & ! function + , distrib_root ! ! subroutine use pft_coms, only : qsw & ! intent(in) , qbark & ! intent(in) , agf_bs & ! intent(in) @@ -4222,6 +4223,13 @@ subroutine prune_lianas(csite, np, lsl) !----- Update rooting depth ---------------------------------------------------! cpatch%krdepth(ico) = size2krdepth(cpatch%hite(ico),cpatch%dbh(ico),ipft,lsl) !if new root depth is smaller keep the old one + !------------------------------------------------------------------------------! + + + !----- Update the vertical distribution of roots. -----------------------------! + call distrib_root(cpatch%krdepth(ico),ipft,cpatch%root_frac(:,ico)) + !------------------------------------------------------------------------------! + !------------------------------------------------------------------------------! ! It is likely that biomass has changed, therefore, update ! diff --git a/ED/src/dynamics/farq_katul.f90 b/ED/src/dynamics/farq_katul.f90 index 31ac9b186..529d34a04 100644 --- a/ED/src/dynamics/farq_katul.f90 +++ b/ED/src/dynamics/farq_katul.f90 @@ -409,9 +409,6 @@ subroutine optimization_solver8(ib,ipft,lambda, real(kind=8) :: test_dcidg real(kind=8) :: test_dfcdg real(kind=8) :: test_dfedg - real(kind=8) :: test_fc_light - real(kind=8) :: test_fc_rubp - real(kind=8) :: test_fc_3rd real(kind=8) :: opt_ci_light real(kind=8) :: opt_ci_rubp real(kind=8) :: opt_ci_3rd @@ -852,15 +849,6 @@ subroutine photosynthesis_stomata_solver8(ib,gsc,limit_case, real(kind=8) :: a,b,c !! Coefficients of the quadratic equation to solve ci real(kind=8) :: rad !! sqrt(b2-4ac) real(kind=8) :: dbdg,dcdg !! derivatives of b,c wrt. gsc - real(kind=8) :: ci_rubp !! ci for rubp-limited scenario - real(kind=8) :: dcidg_rubp !! derivative of ci wrt. gsc for rubp-limited scenario - real(kind=8) :: dfcdg_rubp !! derivative of fc wrt. gsc for rubp-limited scenario - real(kind=8) :: ci_light !! ci for light-limited scenario - real(kind=8) :: dcidg_light !! derivative of ci wrt. gsc for light-limited scenario - real(kind=8) :: dfcdg_light !! derivative of fc wrt. gsc for light-limited scenario - real(kind=8) :: ci_3rd !! ci for TPU/CO2-limited scenario - real(kind=8) :: dcidg_3rd !! derivative of ci wrt. gsc for TPU/CO2-limited scenario - real(kind=8) :: dfcdg_3rd !! derivative of fc wrt. gsc for TPU/CO2-limited scenario !------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/growth_balive.f90 b/ED/src/dynamics/growth_balive.f90 index e9c66af96..b4309bb59 100644 --- a/ED/src/dynamics/growth_balive.f90 +++ b/ED/src/dynamics/growth_balive.f90 @@ -1379,46 +1379,49 @@ subroutine get_c_xfers(csite,ipa,ico,npp_actual,green_leaf_factor,gr_tfact0 ! net growth (i.e. increment from the value of btissue before ! ! maintenance was applied) is the same every day. ! !------------------------------------------------------------------------------! - if ( (iallom == 3 .or. iallom == 4) & - .and. (.not. (is_grass(ipft) .and. igrass == 1)) ) then - if (delta_bleaf >= tiny_num) then - gtf_bleaf = ( cpatch%leaf_maintenance(ico) & - + gr_tfact0 * (delta_bleaf - cpatch%leaf_maintenance(ico)) ) & - / delta_bleaf - else - gtf_bleaf = gr_tfact0 - end if - if (delta_broot >= tiny_num) then - gtf_broot = ( cpatch%root_maintenance(ico) & - + gr_tfact0 * (delta_broot - cpatch%root_maintenance(ico)) ) & - / delta_broot - else - gtf_broot = gr_tfact0 - end if - if (delta_bbarka >= tiny_num) then - gtf_bbarka = ( cpatch%barka_maintenance(ico) & - + gr_tfact0 & - * (delta_bbarka - cpatch%barka_maintenance(ico)) ) & - / delta_bbarka - else - gtf_bbarka = gr_tfact0 - end if - if (delta_bbarkb >= tiny_num) then - gtf_bbarkb = ( cpatch%barkb_maintenance(ico) & - + gr_tfact0 & - * (delta_bbarkb - cpatch%barkb_maintenance(ico)) ) & - / delta_bbarkb - else - gtf_bbarkb = gr_tfact0 + select case (iallom) + case (3,4,5) + if (.not. (is_grass(ipft) .and. igrass == 1) ) then + if (delta_bleaf >= tiny_num) then + gtf_bleaf = ( cpatch%leaf_maintenance(ico) & + + gr_tfact0 * (delta_bleaf-cpatch%leaf_maintenance(ico))) & + / delta_bleaf + else + gtf_bleaf = gr_tfact0 + end if + if (delta_broot >= tiny_num) then + gtf_broot = ( cpatch%root_maintenance(ico) & + + gr_tfact0 * (delta_broot-cpatch%root_maintenance(ico))) & + / delta_broot + else + gtf_broot = gr_tfact0 + end if + if (delta_bbarka >= tiny_num) then + gtf_bbarka = ( cpatch%barka_maintenance(ico) & + + gr_tfact0 & + * (delta_bbarka - cpatch%barka_maintenance(ico)) ) & + / delta_bbarka + else + gtf_bbarka = gr_tfact0 + end if + if (delta_bbarkb >= tiny_num) then + gtf_bbarkb = ( cpatch%barkb_maintenance(ico) & + + gr_tfact0 & + * (delta_bbarkb - cpatch%barkb_maintenance(ico)) ) & + / delta_bbarkb + else + gtf_bbarkb = gr_tfact0 + end if + !----- Correct deltas based on the time of the month and turnover. ------! + delta_bleaf = delta_bleaf * gtf_bleaf + delta_broot = delta_broot * gtf_broot + delta_bsapwooda = delta_bsapwooda * gr_tfact0 ! sapwood turnover is zero. + delta_bsapwoodb = delta_bsapwoodb * gr_tfact0 ! sapwood turnover is zero. + delta_bbarka = delta_bbarka * gtf_bbarka + delta_bbarkb = delta_bbarkb * gtf_bbarkb end if - !----- Correct deltas based on the time of the month and turnover. ---------! - delta_bleaf = delta_bleaf * gtf_bleaf - delta_broot = delta_broot * gtf_broot - delta_bsapwooda = delta_bsapwooda * gr_tfact0 ! sapwood turnover is zero. - delta_bsapwoodb = delta_bsapwoodb * gr_tfact0 ! sapwood turnover is zero. - delta_bbarka = delta_bbarka * gtf_bbarka - delta_bbarkb = delta_bbarkb * gtf_bbarkb - end if + !---------------------------------------------------------------------------! + end select !------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/plant_hydro.f90 b/ED/src/dynamics/plant_hydro.f90 index 76d6e7e04..3f66480b2 100644 --- a/ED/src/dynamics/plant_hydro.f90 +++ b/ED/src/dynamics/plant_hydro.f90 @@ -340,15 +340,15 @@ subroutine plant_hydro_driver(csite,ipa,ntext_soil) ! and psi_closed. ! !---------------------------------------------------------------------------! call calc_plant_water_flux( & - dtlsm &!input - ,sap_area,cpatch%nplant(ico),ipft &!input - ,cpatch%is_small(ico),cpatch%krdepth(ico) &!input - ,cpatch%bleaf(ico),bsap,cpatch%broot(ico) &!input - ,cpatch%hite(ico),transp &!input - ,cpatch%leaf_psi(ico),cpatch%wood_psi(ico) &!input - ,soil_psi,soil_cond,ipa,ico &!input - ,cpatch%wflux_wl(ico),cpatch%wflux_gw(ico) &!output - ,cpatch%wflux_gw_layer(:,ico)) !!output + dtlsm & ! input + ,sap_area,cpatch%nplant(ico),ipft & ! input + ,cpatch%is_small(ico),cpatch%krdepth(ico) & ! input + ,cpatch%bleaf(ico),bsap,cpatch%broot(ico) & ! input + ,cpatch%hite(ico),cpatch%root_frac(:,ico) & ! input + ,transp,cpatch%leaf_psi(ico),cpatch%wood_psi(ico) & ! input + ,soil_psi,soil_cond,ipa,ico & ! input + ,cpatch%wflux_wl(ico),cpatch%wflux_gw(ico) & ! output + ,cpatch%wflux_gw_layer(:,ico)) ! ! output !---------------------------------------------------------------------------! else !----- Neither leaves nor wood are resolvable. Assume zero flow. ----------! @@ -450,13 +450,12 @@ end subroutine plant_hydro_driver !---------------------------------------------------------------------------------------! subroutine calc_plant_water_flux(dt & !timestep ,sap_area,nplant,ipft,is_small,krdepth & !plant input - ,bleaf,bsap,broot,hite & !plant input + ,bleaf,bsap,broot,hite ,root_frac & !plant input ,transp,leaf_psi,wood_psi & !plant input ,soil_psi,soil_cond & !soil input ,ipa,ico & !debug input ,wflux_wl,wflux_gw,wflux_gw_layer) ! !flux output - use soil_coms , only : slz8 & ! intent(in) - , dslz8 ! ! intent(in) + use soil_coms , only : dslz8 ! ! intent(in) use grid_coms , only : nzg ! ! intent(in) use consts_coms , only : pi18 & ! intent(in) , lnexp_min8 ! ! intent(in) @@ -470,7 +469,6 @@ subroutine calc_plant_water_flux(dt & !timestep , wood_Kmax & ! intent(in) , wood_Kexp & ! intent(in) , vessel_curl_factor & ! intent(in) - , root_beta & ! intent(in) , SRA & ! intent(in) , C2B ! ! intent(in) use ed_misc_coms , only : current_time ! ! intent(in) @@ -486,6 +484,7 @@ subroutine calc_plant_water_flux(dt & !timestep real , intent(in) :: bsap !sapwood biomass [ kgC/pl] real , intent(in) :: broot !fine root biomass [ kgC/pl] real , intent(in) :: hite !plant height [ m] + real , dimension(nzg), intent(in) :: root_frac !Root fraction [ m] real , intent(in) :: transp !transpiration [ kg/s] real , intent(in) :: leaf_psi !leaf water pot. [ m] real , intent(in) :: wood_psi !wood water pot. [ m] @@ -517,12 +516,12 @@ subroutine calc_plant_water_flux(dt & !timestep real(kind=8) :: wood_psi_min_d real(kind=8) :: leaf_psi_lwr_d real(kind=8) :: wood_psi_lwr_d - real(kind=8) :: root_beta_d real(kind=8) :: SRA_d real(kind=8) :: wood_psi50_d real(kind=8) :: wood_Kexp_d real(kind=8) :: wood_Kmax_d real(kind=8) :: vessel_curl_factor_d + real(kind=8) :: root_frac_d !fraction of roots !----- Auxiliary variables. ---------------------------------------------------------! real(kind=8) :: exp_term !exponent term real(kind=8) :: ap ![s-1] @@ -532,7 +531,6 @@ subroutine calc_plant_water_flux(dt & !timestep real(kind=8) :: c_leaf !leaf water capacitance real(kind=8) :: c_stem !stem water capacitance real(kind=8) :: RAI !root area index - real(kind=8) :: root_frac !fraction of roots real(kind=8) :: proj_leaf_psi !projected leaf water pot. real(kind=8) :: proj_wood_psi !projected wood water pot. real(kind=8) :: gw_cond !g->w water conductivity @@ -540,8 +538,6 @@ subroutine calc_plant_water_flux(dt & !timestep real(kind=8) :: org_leaf_psi !used for small tree real(kind=8) :: weighted_soil_psi real(kind=8) :: weighted_gw_cond - real(kind=8) :: above_layer_depth - real(kind=8) :: current_layer_depth real(kind=8) :: total_water_supply real(kind=8) , dimension(nzg) :: layer_water_supply !----- Counters. --------------------------------------------------------------------! @@ -570,14 +566,13 @@ subroutine calc_plant_water_flux(dt & !timestep bleaf_d = dble(bleaf ) bsap_d = dble(bsap ) broot_d = dble(broot ) - nplant_d = dble(nplant ) + nplant_d = dble(nplant ) hite_d = dble(hite ) transp_d = dble(transp ) leaf_psi_d = dble(leaf_psi ) wood_psi_d = dble(wood_psi ) soil_psi_d = dble(soil_psi ) soil_cond_d = dble(soil_cond ) - root_beta_d = dble(root_beta (ipft)) SRA_d = dble(SRA (ipft)) !----- Minimum threshold depends on whether the plant is small or large. ------------! if (is_small) then @@ -795,26 +790,16 @@ subroutine calc_plant_water_flux(dt & !timestep !----- Loop over all soil layers to get the aggregated water conductance. -----------! do k = krdepth,nzg - !---------------------------------------------------------------------------------! - ! Define layer edges - ! - !---------------------------------------------------------------------------------! - current_layer_depth = -slz8(k) - above_layer_depth = -slz8(k+1) - !---------------------------------------------------------------------------------! - - - !----- Calculate the root fraction of this layer. --------------------------------! - root_frac = ( root_beta_d ** (above_layer_depth / (-slz8(krdepth))) & - - root_beta_d ** (current_layer_depth / (-slz8(krdepth))) ) + !----- Retrieve the root fraction of this layer. ---------------------------------! + root_frac_d = dble(root_frac(k)) !---------------------------------------------------------------------------------! !---------------------------------------------------------------------------------! ! Calculate RAI in each layer. ! !---------------------------------------------------------------------------------! - RAI = broot_d * SRA_d * root_frac * nplant_d ! m2/m2 + RAI = broot_d * SRA_d * root_frac_d * nplant_d ! m2/m2 !---------------------------------------------------------------------------------! !---------------------------------------------------------------------------------! @@ -979,7 +964,6 @@ subroutine calc_plant_water_flux(dt & !timestep write (unit=*,fmt='(a)' ) ' ' write (unit=*,fmt=efmt ) ' + LEAF_PSI_MIN =',leaf_psi_min (ipft) - write (unit=*,fmt=efmt ) ' + WOOD_PSI_MIN =',wood_psi_min (ipft) write (unit=*,fmt=efmt ) ' + SMALL_PSI_MIN =',small_psi_min(ipft) write (unit=*,fmt='(a)' ) ' ' diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index 98b14d90b..738029fee 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -3041,7 +3041,7 @@ subroutine init_pft_alloc_params() ! Glob. Change Biol., 23(1):177-190. doi:10.1111/gcb.13388 (J17). ! ! ! !---------------------------------------------------------------------------------------! - real, dimension(2) , parameter :: c14f15_bl_xx = (/ 0.46769540,0.6410495 /) + real, dimension(2) , parameter :: c14f15_bl_xx = (/ 0.23384770,0.6410495 /) real, dimension(3) , parameter :: c14f15_la_wd = (/-0.5874,0.5679,0.5476 /) real, dimension(3) , parameter :: c14f15_ht_xx = (/0.5709,-0.1007,0.6734 /) real, dimension(2) , parameter :: c14f15_bs_tf = (/ 0.06080334,1.0044785 /) @@ -3354,7 +3354,7 @@ subroutine init_pft_alloc_params() ! ! !---------------------------------------------------------------------------------------! select case (iallom) - case (3) + case (3,5) do ipft=1,n_pft if (is_liana(ipft)) then !------------------------------------------------------------------------------! @@ -3467,12 +3467,18 @@ subroutine init_pft_alloc_params() ! ! ! The root fraction (Y) above depth D cm for a cohort with max rooting depth as ! ! D_max (cm) can be calculated as: ! - ! Y = 1. - (root_beta) ** (D / D_max) ! ! ! - ! Suggested values range from 0.0001 to 0.01. ! + ! Y = ( 1. - (root_beta) ** (D / D_max) ) / (1 - root_beta) ! + ! ! + ! ! + ! MLO (2020-10-27): I added the denominator (1 - root_beta) to ensure that Y at ! + ! D=D_max is always 1, regardless of the value of root_beta, as ! + ! long as root_beta < 1. ! + ! ! + ! Suggested values range from 0.0001 to 0.1. ! ! ! !---------------------------------------------------------------------------------------! - root_beta(:) = 0.01 + root_beta(:) = 0.1 !---------------------------------------------------------------------------------------! @@ -3531,7 +3537,7 @@ subroutine init_pft_alloc_params() ! qbark - ratio between leaf biomass and bark biomass per unit height. ! !---------------------------------------------------------------------------------------! select case (iallom) - case (3) + case (3,5) !------ New allometry, use estimate based on M01. -----------------------------------! b1Xs(:) = 0.315769481 !------------------------------------------------------------------------------------! @@ -3626,7 +3632,7 @@ subroutine init_pft_alloc_params() !----- hgt_ref is their "Hmax". -----------------------------------------------! hgt_ref(ipft) = 61.7 !------------------------------------------------------------------------------! - case (3) + case (3,5) !------------------------------------------------------------------------------! ! Allometric equation based on the fitted curve using the Sustainable ! ! Landscapes data set (L16) and the size- and site-dependent stratified ! @@ -3812,7 +3818,7 @@ subroutine init_pft_alloc_params() b1Ca(ipft) = exp(ncrown_area(1)) b2Ca(ipft) = ncrown_area(2) !------------------------------------------------------------------------------! - case (3,4) + case (3,4,5) !------------------------------------------------------------------------------! ! Allometry using the Sustainable Landscapes data. ! !------------------------------------------------------------------------------! @@ -3885,7 +3891,7 @@ subroutine init_pft_alloc_params() elseif (is_tropical(ipft)) then !----- Tropical PFTs: check allometry settings. ----------------------------------! select case (iallom) - case (3,4) + case (3,4,5) b1Cl(ipft) = 0.29754 b2Cl(ipft) = 1.0324 case default @@ -3955,7 +3961,7 @@ subroutine init_pft_alloc_params() b1Bl (ipft) = C2B * exp(nleaf(1)) * rho(ipft) / nleaf(3) b2Bl (ipft) = nleaf(2) !------------------------------------------------------------------------------! - case (3) + case (3,5) !------------------------------------------------------------------------------! ! Allometry based on the BAAD data based (F15). We only used leaves from ! ! wild tropical, flowering trees, and applied a stratified sample by DBH class ! @@ -3974,7 +3980,7 @@ subroutine init_pft_alloc_params() ! Amazon. Global Biogeochem. Cycles, 30(11):1639-1660. ! ! doi:10.1002/2016GB005465 (L16). ! !------------------------------------------------------------------------------! - b1Bl(ipft) = c14f15_bl_xx(1) / SLA(ipft) ! XX --> MLO: should ther be a C2B here given c14f15_bl_xx is in m2 (?) and SLA is m2/kgC + b1Bl(ipft) = c14f15_bl_xx(1) b2Bl(ipft) = c14f15_bl_xx(2) !------------------------------------------------------------------------------! case (4) @@ -4097,7 +4103,7 @@ subroutine init_pft_alloc_params() b1Bs_large (ipft) = C2B * exp(ndead_large(1)) * rho(ipft) / ndead_large(3) b2Bs_large (ipft) = ndead_large(2) !------------------------------------------------------------------------------! - case (3,4) + case (3,4,5) !------------------------------------------------------------------------------! ! Trees: set parameters based on Chave et al. (2014). ! ! Grasses: set numbers to small values, too keep bdead at a minimum but still ! @@ -4393,7 +4399,7 @@ subroutine init_pft_alloc_params() , +0.4223014 & , is_tropical(:) .and. (.not. is_liana(:)) ) !------------------------------------------------------------------------------------! - case (4) + case (4,5) !------------------------------------------------------------------------------------! ! Test allometry based on excavation data in Panama based on H. ! ! Multiply it by 2 so that a 40 m tree can get access to water below 5m depth ! @@ -5218,7 +5224,7 @@ subroutine init_pft_resp_params() ! names already in use in c2n factors. ! !---------------------------------------------------------------------------------------! select case (iallom) - case (2,3,4) + case (2,3,4,5) !------------------------------------------------------------------------------------! ! For tropical leaves/fine roots, assume the metabolic/structural ratio obtained ! ! by B17. For grasses and temperate plants, use B17 equation and R96 values for ! @@ -8233,6 +8239,7 @@ subroutine init_derived_params_after_xml() , srf_hor & ! intent(inout) , srf_q10 & ! intent(inout) , bleaf_crit & ! intent(inout) + , ddh_allom & ! intent(out) , d1DBH_small & ! intent(out) , d2DBH_small & ! intent(out) , d1DBH_large & ! intent(out) @@ -8655,6 +8662,14 @@ subroutine init_derived_params_after_xml() !------------------------------------------------------------------------------------! + !----- Set allometric formula. ------------------------------------------------------! + select case (iallom) + case (3,4,5) + ddh_allom(ipft) = is_tropical(ipft) .and. (.not. is_liana(ipft)) + case default + ddh_allom(ipft) = .false. + end select + !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! @@ -8662,8 +8677,7 @@ subroutine init_derived_params_after_xml() ! the size2bd and size2bl functions, and to be consistent, they cannot be ! ! initialised through XML. ! !------------------------------------------------------------------------------------! - if ((iallom == 3 .or. iallom == 4) & - .and. is_tropical(ipft) .and. (.not. is_liana(ipft)) ) then + if (ddh_allom(ipft)) then !---------------------------------------------------------------------------------! ! Incorporate both heartwood and height allometric equations to derive DBH. ! !---------------------------------------------------------------------------------! @@ -8680,7 +8694,7 @@ subroutine init_derived_params_after_xml() !------ Inverse of the leaf biomass function. ------------------------------------! l2DBH(ipft) = 1. / ( ( 2. + b2Ht(ipft) ) * b2Bl(ipft) ) - l1DBH(ipft) = ( C2B / (b1Bl(ipft) * exp(b1Ht(ipft) * b2Bl(ipft)) ) ) ** l2DBH(ipft) + l1DBH(ipft) = ( 1. / (b1Bl(ipft) * exp(b1Ht(ipft) * b2Bl(ipft)) ) ) ** l2DBH(ipft) !---------------------------------------------------------------------------------! else !---------------------------------------------------------------------------------! @@ -8769,7 +8783,7 @@ subroutine init_derived_params_after_xml() ! allometry sets define the minimum sizes as before, for back-compability. ! !------------------------------------------------------------------------------------! select case (iallom) - case (3,4) + case (3,4,5) !---------------------------------------------------------------------------------! ! New method, each PFT has a minimum resolvable density. The fraction ensures ! ! that plants start as resolvable. ! @@ -9665,41 +9679,43 @@ subroutine init_derived_params_after_xml() !----- Print allometric coefficients. --------------------------------------------------! if (print_zero_table) then open (unit=18,file=trim(allom_file),status='replace',action='write') - write(unit=18,fmt='(54(1x,a))') ' PFT',' TROPICAL',' GRASS' & + write(unit=18,fmt='(55(1x,a))') ' PFT',' TROPICAL',' GRASS' & ,' CONIFER',' SAVANNAH',' LIANA' & - ,' RHO',' B1HT',' B2HT' & - ,' HGT_REF',' B1BL',' B2BL' & - ,' B1BS_SMALL',' B2BS_SMALL',' B1BS_LARGE' & - ,' B2BS_LARGE',' D1DBH_SMALL',' D2DBH_SMALL' & - ,' D1DBH_LARGE',' D2DBH_LARGE',' L1DBH' & - ,' L2DBH',' B1CA',' B2CA' & - ,' B1WAI',' B2WAI',' B1SA' & - ,' B2SA',' B1RD',' B2RD' & - ,' B1XS',' B1XB',' HGT_MIN' & - ,' HGT_MAX',' MIN_DBH',' DBH_CRIT' & - ,' DBH_BIGLEAF',' BDEAD_CRIT',' BLEAF_CRIT' & - ,' BALIVE_CRIT',' BEVERY_CRIT',' INIT_DENS' & - ,' SLA',' F_BSTOR_INIT',' Q' & - ,' QSW',' QBARK',' QRHOB' & - ,' d18O_REF',' B1_D18O',' B2_D18O' & - ,' B1_EFRD',' B2_EFRD',' INIT_LAIMAX' - + ,' DDH_ALLOM',' RHO',' B1HT' & + ,' B2HT',' HGT_REF',' B1BL' & + ,' B2BL',' B1BS_SMALL',' B2BS_SMALL' & + ,' B1BS_LARGE',' B2BS_LARGE',' D1DBH_SMALL' & + ,' D2DBH_SMALL',' D1DBH_LARGE',' D2DBH_LARGE' & + ,' L1DBH',' L2DBH',' B1CA' & + ,' B2CA',' B1WAI',' B2WAI' & + ,' B1SA',' B2SA',' B1RD' & + ,' B2RD',' B1XS',' B1XB' & + ,' HGT_MIN',' HGT_MAX',' MIN_DBH' & + ,' DBH_CRIT',' DBH_BIGLEAF',' BDEAD_CRIT' & + ,' BLEAF_CRIT',' BALIVE_CRIT',' BEVERY_CRIT' & + ,' INIT_DENS',' SLA',' F_BSTOR_INIT' & + ,' Q',' QSW',' QBARK' & + ,' QRHOB',' d18O_REF',' B1_D18O' & + ,' B2_D18O',' B1_EFRD',' B2_EFRD' & + ,' INIT_LAIMAX' + do ipft=1,n_pft - write (unit=18,fmt='(9x,i5,5(13x,l1),47(1x,f13.6),1(1x,es13.6))') & + write (unit=18,fmt='(9x,i5,6(13x,l1),47(1x,f13.6),1(1x,es13.6))') & ipft,is_tropical(ipft),is_grass(ipft),is_conifer(ipft) & - ,is_savannah(ipft),is_liana(ipft),rho(ipft),b1Ht(ipft),b2Ht(ipft) & - ,hgt_ref(ipft),b1Bl(ipft),b2Bl(ipft),b1Bs_small(ipft) & - ,b2Bs_small(ipft),b1Bs_large(ipft),b2Bs_large(ipft) & - ,d1DBH_small(ipft),d2DBH_small(ipft),d1DBH_large(ipft) & - ,d2DBH_large(ipft),l1DBH(ipft),l2DBH(ipft),b1Ca(ipft),b2Ca(ipft) & - ,b1WAI(ipft),b2WAI(ipft),b1SA(ipft),b2SA(ipft),b1Rd(ipft) & - ,b2Rd(ipft),b1Xs(ipft),b1Xb(ipft),hgt_min(ipft),hgt_max(ipft) & - ,min_dbh(ipft),dbh_crit(ipft),dbh_bigleaf(ipft),bdead_crit(ipft) & - ,bleaf_crit(ipft),balive_crit(ipft),bevery_crit(ipft) & - ,init_density(ipft),sla(ipft),f_bstorage_init(ipft),q(ipft) & - ,qsw(ipft),qbark(ipft),qrhob(ipft),d18O_ref(ipft),b1d18O(ipft) & - ,b2d18O(ipft),b1Efrd(ipft),b2Efrd(ipft),init_laimax(ipft) + ,is_savannah(ipft),is_liana(ipft),ddh_allom(ipft),rho(ipft) & + ,b1Ht(ipft),b2Ht(ipft),hgt_ref(ipft),b1Bl(ipft),b2Bl(ipft) & + ,b1Bs_small(ipft),b2Bs_small(ipft),b1Bs_large(ipft) & + ,b2Bs_large(ipft),d1DBH_small(ipft),d2DBH_small(ipft) & + ,d1DBH_large(ipft),d2DBH_large(ipft),l1DBH(ipft),l2DBH(ipft) & + ,b1Ca(ipft),b2Ca(ipft),b1WAI(ipft),b2WAI(ipft),b1SA(ipft) & + ,b2SA(ipft),b1Rd(ipft),b2Rd(ipft),b1Xs(ipft),b1Xb(ipft) & + ,hgt_min(ipft),hgt_max(ipft),min_dbh(ipft),dbh_crit(ipft) & + ,dbh_bigleaf(ipft),bdead_crit(ipft),bleaf_crit(ipft) & + ,balive_crit(ipft),bevery_crit(ipft),init_density(ipft),sla(ipft) & + ,f_bstorage_init(ipft),q(ipft),qsw(ipft),qbark(ipft),qrhob(ipft) & + ,d18O_ref(ipft),b1d18O(ipft),b2d18O(ipft),b1Efrd(ipft),b2Efrd(ipft) & + ,init_laimax(ipft) end do close(unit=18,status='keep') end if diff --git a/ED/src/init/ed_type_init.f90 b/ED/src/init/ed_type_init.f90 index 456c93fd4..6b6648805 100644 --- a/ED/src/init/ed_type_init.f90 +++ b/ED/src/init/ed_type_init.f90 @@ -19,7 +19,8 @@ module ed_type_init !---------------------------------------------------------------------------------------! subroutine init_ed_cohort_vars(cpatch,ico, lsl,mzg,ntext_soil) use ed_state_vars , only : patchtype ! ! structure - use allometry , only : size2krdepth ! ! function + use allometry , only : size2krdepth & ! function + , distrib_root ! ! sub-routine use pft_coms , only : phenology & ! intent(in) , cuticular_cond & ! intent(in) , leaf_turnover_rate & ! intent(in) @@ -201,6 +202,12 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl,mzg,ntext_soil) !------------------------------------------------------------------------------------! + + !------ Find the root distribution. -------------------------------------------------! + call distrib_root(kroot,ipft,cpatch%root_frac(:,ico)) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! ! Start variables related with plant hydraulics. ! !------------------------------------------------------------------------------------! diff --git a/ED/src/io/ed_init_history.f90 b/ED/src/io/ed_init_history.f90 index f4d91cc49..0300b24a7 100644 --- a/ED/src/io/ed_init_history.f90 +++ b/ED/src/io/ed_init_history.f90 @@ -5691,6 +5691,8 @@ subroutine fill_history_patch(cpatch,paco_index,ncohorts_global) memdims (2) = int(cpatch%ncohorts,8) memsize (2) = int(cpatch%ncohorts,8) memoffs (2) = 0_8 + call hdf_getslab_r(cpatch%root_frac & + ,'ROOT_FRAC ',dsetrank,iparallel,.true. ,foundvar) call hdf_getslab_r(cpatch%wflux_gw_layer & ,'WFLUX_GW_LAYER ',dsetrank,iparallel,.true. ,foundvar) if (writing_long) then diff --git a/ED/src/io/ed_read_ed21_history.f90 b/ED/src/io/ed_read_ed21_history.f90 index 3e84faf03..bba663ff7 100644 --- a/ED/src/io/ed_read_ed21_history.f90 +++ b/ED/src/io/ed_read_ed21_history.f90 @@ -691,36 +691,52 @@ subroutine read_ed21_history_file !---------------------------------------------------------------! ! Initialise size and structural pools. ! !---------------------------------------------------------------! - if ((iallom == 3 .or. iallom == 4)) then + select case (iallom) + case (3,4,5) !----- New allometry, initialise with DBH. ------------------! cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) bdeadx = size2bd(cpatch%dbh(ico) & ,cpatch%hite(ico),ipft) cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - elseif ( igrass == 1 .and. is_grass(ipft) & - .and. cpatch%bdeada(ico) > 0.0 ) then - !-- if the initial file was running with igrass = 0, bdead ! - ! should be nonzero. If the new run has igrass = 1, bdead ! - ! is set to zero and the mass is discarded ! - cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) - cpatch%bdeada(ico) = 0.0 - cpatch%bdeadb(ico) = 0.0 - - else if (bdeadx > 0.0 .and. igrass == 0) then - ! grasses have bdead in both input and current run (igrass=0) - cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & - ,cpatch%bdeadb(ico) ) - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) - else - ! it is either a new grass (igrass=1) in the initial file, ! - ! or the value for bdead is missing from the files ! - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) - bdeadx = size2bd(cpatch%dbh(ico) & - ,cpatch%hite(ico),ipft) - cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx - cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - end if + case default + if ( igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdeada(ico) > 0.0 ) then + !---------------------------------------------------------! + ! If the initial file was running with igrass = 0, ! + ! bdead should be nonzero. If the new run has ! + ! igrass = 1, bdead is set to zero and the mass is ! + ! discarded. This does not violate carbon conservation ! + ! because this is the initial state of a new run. ! + !---------------------------------------------------------! + cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdeada(ico) = 0.0 + cpatch%bdeadb(ico) = 0.0 + !---------------------------------------------------------! + + else if (bdeadx > 0.0 .and. igrass == 0) then + !---------------------------------------------------------! + ! Grasses have bdead in both input and current run ! + ! (igrass=0). ! + !---------------------------------------------------------! + cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & + ,cpatch%bdeadb(ico) ) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) + !---------------------------------------------------------! + else + !---------------------------------------------------------! + ! It is either a new grass (igrass=1) in the initial ! + ! file, or the value for bdead is missing from the files. ! + !---------------------------------------------------------! + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + bdeadx = size2bd(cpatch%dbh(ico) & + ,cpatch%hite(ico),ipft) + cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx + cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx + !---------------------------------------------------------! + end if + !------------------------------------------------------------! + end select !---------------------------------------------------------------! @@ -2082,36 +2098,52 @@ subroutine read_ed21_history_unstruct !---------------------------------------------------------------! ! Initialise size and structural pools. ! !---------------------------------------------------------------! - if (iallom == 3 .or. iallom == 4) then + select case (iallom) + case (3,4,5) !----- New allometry, initialise with DBH. ------------------! cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) bdeadx = size2bd(cpatch%dbh(ico) & ,cpatch%hite(ico),ipft) cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - elseif ( igrass == 1 .and. is_grass(ipft) & - .and. cpatch%bdeada(ico) > 0.0 ) then - !-- if the initial file was running with igrass = 0, bdead ! - ! should be nonzero. If the new run has igrass = 1, bdead ! - ! is set to zero and the mass is discarded ! - cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) - cpatch%bdeada(ico) = 0.0 - cpatch%bdeadb(ico) = 0.0 - - else if (bdeadx > 0.0 .and. igrass == 0) then - ! grasses have bdead in both input and current run (igrass=0) - cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & - ,cpatch%bdeadb(ico) ) - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) - else - ! it is either a new grass (igrass=1) in the initial file, ! - ! or the value for bdead is missing from the files ! - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) - bdeadx = size2bd(cpatch%dbh(ico) & - ,cpatch%hite(ico),ipft) - cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx - cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - end if + case default + if ( igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdeada(ico) > 0.0 ) then + !---------------------------------------------------------! + ! If the initial file was running with igrass = 0, ! + ! bdead should be nonzero. If the new run has ! + ! igrass = 1, bdead is set to zero and the mass is ! + ! discarded. This does not violate carbon conservation ! + ! because this is the initial state of a new run. ! + !---------------------------------------------------------! + cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdeada(ico) = 0.0 + cpatch%bdeadb(ico) = 0.0 + !---------------------------------------------------------! + + else if (bdeadx > 0.0 .and. igrass == 0) then + !---------------------------------------------------------! + ! Grasses have bdead in both input and current run ! + ! (igrass=0). ! + !---------------------------------------------------------! + cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & + ,cpatch%bdeadb(ico) ) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) + !---------------------------------------------------------! + else + !---------------------------------------------------------! + ! It is either a new grass (igrass=1) in the initial ! + ! file, or the value for bdead is missing from the files. ! + !---------------------------------------------------------! + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + bdeadx = size2bd(cpatch%dbh(ico) & + ,cpatch%hite(ico),ipft) + cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx + cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx + !---------------------------------------------------------! + end if + !------------------------------------------------------------! + end select !---------------------------------------------------------------! @@ -3456,36 +3488,52 @@ subroutine read_ed21_polyclone !---------------------------------------------------------------! ! Initialise size and structural pools. ! !---------------------------------------------------------------! - if (iallom == 3 .or. iallom == 4) then + select case (iallom) + case (3,4,5) !----- New allometry, initialise with DBH. ------------------! cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) bdeadx = size2bd(cpatch%dbh(ico) & ,cpatch%hite(ico),ipft) cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - elseif ( igrass == 1 .and. is_grass(ipft) & - .and. cpatch%bdeada(ico) > 0.0 ) then - !-- if the initial file was running with igrass = 0, bdead ! - ! should be nonzero. If the new run has igrass = 1, bdead ! - ! is set to zero and the mass is discarded ! - cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) - cpatch%bdeada(ico) = 0.0 - cpatch%bdeadb(ico) = 0.0 - - else if (bdeadx > 0.0 .and. igrass == 0) then - ! grasses have bdead in both input and current run (igrass=0) - cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & - ,cpatch%bdeadb(ico) ) - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) - else - ! it is either a new grass (igrass=1) in the initial file, ! - ! or the value for bdead is missing from the files ! - cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) - bdeadx = size2bd(cpatch%dbh(ico) & - ,cpatch%hite(ico),ipft) - cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx - cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx - end if + case default + if ( igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdeada(ico) > 0.0 ) then + !---------------------------------------------------------! + ! If the initial file was running with igrass = 0, ! + ! bdead should be nonzero. If the new run has ! + ! igrass = 1, bdead is set to zero and the mass is ! + ! discarded. This does not violate carbon conservation ! + ! because this is the initial state of a new run. ! + !---------------------------------------------------------! + cpatch%hite (ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdeada(ico) = 0.0 + cpatch%bdeadb(ico) = 0.0 + !---------------------------------------------------------! + + else if (bdeadx > 0.0 .and. igrass == 0) then + !---------------------------------------------------------! + ! Grasses have bdead in both input and current run ! + ! (igrass=0). ! + !---------------------------------------------------------! + cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdeada(ico) & + ,cpatch%bdeadb(ico) ) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico) ) + !---------------------------------------------------------! + else + !---------------------------------------------------------! + ! It is either a new grass (igrass=1) in the initial ! + ! file, or the value for bdead is missing from the files. ! + !---------------------------------------------------------! + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + bdeadx = size2bd(cpatch%dbh(ico) & + ,cpatch%hite(ico),ipft) + cpatch%bdeada(ico) = agf_bs(ipft) * bdeadx + cpatch%bdeadb(ico) = (1.0 - agf_bs(ipft)) * bdeadx + !---------------------------------------------------------! + end if + !------------------------------------------------------------! + end select !---------------------------------------------------------------! diff --git a/ED/src/memory/ed_state_vars.F90 b/ED/src/memory/ed_state_vars.F90 index d72654bec..46eb29116 100644 --- a/ED/src/memory/ed_state_vars.F90 +++ b/ED/src/memory/ed_state_vars.F90 @@ -633,6 +633,8 @@ module ed_state_vars real, pointer, dimension(:) :: wflux_wl ! bl_max) then - ! if the new bl_max is smaller than current bleaf, we need to dump - ! the extra carbon into bstorage and change phenology_status - cpatch%bstorage(ico) = cpatch%bstorage(ico) & - + (cpatch%bleaf(ico) - bl_max) - ! Water content will be updated later in structural_growth + + !---------------------------------------------------------------------------------! + ! Check that plasticity doesn't violate allometry. ! + !---------------------------------------------------------------------------------! + if (cpatch%bleaf(ico) > bl_max) then + !------------------------------------------------------------------------------! + ! If the new bl_max is smaller than current bleaf, we need to dump the ! + ! extra carbon into bstorage and change phenology_status. ! + !------------------------------------------------------------------------------! + cpatch%bstorage(ico) = cpatch%bstorage(ico) + (cpatch%bleaf(ico) - bl_max) + + !----- Water content will be updated later in structural_growth. --------------! cpatch%bleaf(ico) = bl_max + !------------------------------------------------------------------------------! - ! we also update balive since bleaf changed + !----- We also update balive since bleaf changed. -----------------------------! cpatch%balive(ico) = ed_balive(cpatch,ico) + !------------------------------------------------------------------------------! + !----- Leaves are at maximum elongation, update phenology flag accordingly. ---! cpatch%phenology_status(ico) = 0 - endif + !------------------------------------------------------------------------------! + end if + !---------------------------------------------------------------------------------! end select !------------------------------------------------------------------------------------! diff --git a/diff_version.sh b/diff_version.sh index 77a083c15..d3be988ac 100755 --- a/diff_version.sh +++ b/diff_version.sh @@ -24,9 +24,11 @@ subdirs="ED BRAMS Ramspost R-utils" #------ Editor to use (I've only tested with nedit, use others at your own risk). ---------# editor="nedit" #------ Two paths with EDBRAMS (full path). -----------------------------------------------# -ours="${HOME}/EDBRAMS" -theirs="${HOME}/MainLine/EDBRAMS" -ournew=true +ours="${HOME}/Downloads/MLN-EDBRAMS" +theirs="${HOME}/Downloads/MLO-EDBRAMS" +ournew=false +#------ Working path when implementing a partial merge (otherwise, leave it blank). -------# +work="${HOME}/Models/EDBRAMS" #------------------------------------------------------------------------------------------# @@ -45,7 +47,24 @@ esac #------------------------------------------------------------------------------------------# # Remove any comparison file that may exist. # #------------------------------------------------------------------------------------------# -/bin/rm -f notthesame.* +/bin/rm -f notthesame.* \~notthesame.* +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Add settings for partial merge (if sought). # +#------------------------------------------------------------------------------------------# +if [[ "${work}" == "" ]] +then + #---- Disable work version (preferred method, much less messy). ------------------------# + load_work=false + work=${theirs} + #---------------------------------------------------------------------------------------# +else + #---- Enable work version (more prone to complications, be careful). -------------------# + load_work=true + #---------------------------------------------------------------------------------------# +fi #------------------------------------------------------------------------------------------# @@ -60,11 +79,11 @@ do #---------------------------------------------------------------------------------------# for ext in ${exts} do - if [ ${subdir} == "R-utils" ] && [ ${ext} == ".txt" ] + if [[ ${subdir} == "R-utils" ]] && [[ ${ext} == ".txt" ]] then srcours="${ours}/${subdir}/samap" srctheirs="${theirs}/${subdir}/samap" - elif [ ${subdir} == "R-utils" ] + elif [[ ${subdir} == "R-utils" ]] then srcours="${ours}/${subdir}" srctheirs="${theirs}/${subdir}" @@ -82,12 +101,14 @@ do for fileours in ${lookuptable} do file=$(basename ${fileours}) - newpath=$(dirname ${fileours} | sed s@${ours}@${theirs}@g) + theirpath=$(dirname ${fileours} | sed s@${ours}@${theirs}@g) + workpath=$(dirname ${fileours} | sed s@${ours}@${work}@g) case "${myos}" in Darwin|Cygwin) #---- Case-insensitive file system. ---------------------------------------------# - filetheirs="${newpath}/${file}" - alt="" + filetheirs="${theirpath}/${file}" + filework="${workpath}/${file}" + theirs_alt="" ;; #--------------------------------------------------------------------------------# *) @@ -95,64 +116,154 @@ do case "${ext}" in ".f90") alt_file=$(echo ${file} | sed s@"\\.f90"@".F90"@g) - if [ -s "${newpath}/${alt_file}" ] + if [[ -s "${theirpath}/${alt_file}" ]] then - filetheirs="${newpath}/${alt_file}" - alt=".F90" + filetheirs="${theirpath}/${alt_file}" + theirs_alt=".F90" else - filetheirs="${newpath}/${file}" - alt="" + filetheirs="${theirpath}/${file}" + theirs_alt="" fi ;; ".F90") alt_file=$(echo ${file} | sed s@"\\.F90"@".f90"@g) - if [ -s "${newpath}/${alt_file}" ] + if [[ -s "${theirpath}/${alt_file}" ]] then - filetheirs="${newpath}/${alt_file}" - alt=".f90" + filetheirs="${theirpath}/${alt_file}" + theirs_alt=".f90" else - filetheirs="${newpath}/${file}" - alt="" + filetheirs="${theirpath}/${file}" + theirs_alt="" fi ;; *) - filetheirs="${newpath}/${file}" - alt="" + filetheirs="${theirpath}/${file}" + theirs_alt="" ;; esac - ;; #--------------------------------------------------------------------------------# + + + #----- Probably Linux or Unix, assume case-sensitive file system. ---------------# + case "${ext}" in + ".f90") + alt_file=$(echo ${file} | sed s@"\\.f90"@".F90"@g) + if [[ -s "${workpath}/${alt_file}" ]] + then + filework="${workpath}/${alt_file}" + work_alt=".F90" + else + filework="${workpath}/${file}" + work_alt="" + fi + ;; + ".F90") + alt_file=$(echo ${file} | sed s@"\\.F90"@".f90"@g) + if [[ -s "${workpath}/${alt_file}" ]] + then + filework="${workpath}/${alt_file}" + work_alt=".f90" + else + filework="${workpath}/${file}" + work_alt="" + fi + ;; + *) + filework="${workpath}/${file}" + work_alt="" + ;; + esac + #--------------------------------------------------------------------------------# + + ;; esac - filetheirs="${newpath}/${file}" - if [ -s ${filetheirs} ] + + + #-----------------------------------------------------------------------------------# + # If we are doing partial merge, we must check the existence three-way, # + # otherwise we compare just the "ours" and "theirs". # + #-----------------------------------------------------------------------------------# + if [[ -s ${filetheirs} ]] then - ldif=$(diff -ibB <(grep -vE "^\s*!" ${fileours}) <(grep -vE "^\s*!" ${filetheirs}) | wc -l) - if [ ${ldif} -gt 0 ] - then - woroot=$(echo ${fileours} | sed s@"${srcours}/"@""@g) - case "${alt}" in - .f90|.F90) - echo "${woroot} has changed. New extension is ${alt}." - ;; - *) - echo "${woroot} has changed." - ;; - esac - if ${ournew} - then - diff -uibB <(grep -vE "^\s*!" ${filetheirs}) <(grep -vE "^\s*!" ${fileours})\ - > notthesame${ext} - else - diff -uibB <(grep -vE "^\s*!" ${fileours}) <(grep -vE "^\s*!" ${filetheirs})\ - > notthesame${ext} - fi - ${editor} ${fileours} ${filetheirs} notthesame${ext} 1> /dev/null 2> /dev/null - /bin/rm -f notthesame${ext} - fi + #---- Check for extension change. -----------------------------------------------# + woroot=$(echo ${fileours} | sed s@"${srcours}/"@""@g) + case "${theirs_alt}" in + .f90|.F90) + if ${ournew} + then + ext_mess="Old extension was ${theirs_alt}." + else + ext_mess="New extension is ${theirs_alt}." + fi + ;; + *) + ext_mess="" + ;; + esac + #--------------------------------------------------------------------------------# + + + + #--------------------------------------------------------------------------------# + # Check for changes (ignoring spaces and commented lines). # + #--------------------------------------------------------------------------------# + ldif=$(diff -ibB <(grep -vE "^\s*!" ${fileours}) <(grep -vE "^\s*!" ${filetheirs}) | wc -l) + if [[ ${ldif} -gt 0 ]] + then + change=true + if [[ "${ext_mess}" == "" ]] + then + echo "File ${woroot}. Code has changed." + else + echo "File ${woroot}. Code has changed. ${ext_mess}" + fi + elif [[ "${ext_mess}" == "" ]] + then + change=false + else + change=false + echo "File ${woroot}. ${ext_mess}" + fi + #--------------------------------------------------------------------------------# + + + #--------------------------------------------------------------------------------# + # If files have changes, report differences. # + #--------------------------------------------------------------------------------# + if ${change} + then + #----- Write differences to a temporary file. --------------------------------# + if ${ournew} + then + diff -uibB <(grep -vE "^\s*!" ${filetheirs}) \ + <(grep -vE "^\s*!" ${fileours}) > notthesame${ext} + else + diff -uibB <(grep -vE "^\s*!" ${fileours}) \ + <(grep -vE "^\s*!" ${filetheirs}) > notthesame${ext} + fi + #-----------------------------------------------------------------------------# + + + #----- Open editor with all files needed. ------------------------------------# + if ${load_work} && [[ -s ${filework} ]] + then + ${editor} ${filework} ${filetheirs} notthesame${ext} \ + 1> /dev/null 2> /dev/null + /bin/rm -f notthesame${ext} + elif ${load_work} + then + ${editor} ${filetheirs} notthesame${ext} 1> /dev/null 2> /dev/null + echo " ---> Working file is missing!" + else + ${editor} ${fileours} ${filetheirs} notthesame${ext} \ + 1> /dev/null 2> /dev/null + fi + #-----------------------------------------------------------------------------# + fi else - woroot=$(echo ${fileours} | sed s@"${srcours}/"@""@g) - echo "${woroot} is exclusive to ${ours} version." - fi #if [ -s ${filetheirs} ] + woroot=$(echo ${fileours} | sed s@"${srcours}/"@""@g) + echo "${woroot} is exclusive to ${ours} version." + fi #if [[ -s ${filetheirs} ]] done #for fileours in ${lookuptable} #-------------------------------------------------------------------------------------# @@ -165,13 +276,13 @@ do for filetheirs in ${lookuptable} do file=$(basename ${filetheirs}) - newpath=$(dirname ${filetheirs} | sed s@${theirs}@${ours}@g) - fileours="${newpath}/${file}" - if [ ! -s ${fileours} ] + ourpath=$(dirname ${filetheirs} | sed s@${theirs}@${ours}@g) + fileours="${ourpath}/${file}" + if [[ ! -s ${fileours} ]] then woroot=$(echo ${filetheirs} | sed s@"${srctheirs}/"@""@g) echo "${woroot} is exclusive to ${theirs} version." - fi #if [ -s ${filetheirs} ] + fi #if [[ -s ${filetheirs} ]] done #for fileours in ${lookuptable} #-------------------------------------------------------------------------------------# done #for ext in ${exts} From a8d3e4aeca7371f4d986b15add69eead6ad95e73 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Sun, 4 Jun 2023 10:47:43 -0700 Subject: [PATCH 2/8] Minor bug fix in ed_params.f90, one place was missing the IALLOM=5 setting. --- ED/src/init/ed_params.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index 738029fee..343905b31 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -3723,7 +3723,7 @@ subroutine init_pft_alloc_params() ! Minimum and maximum height allowed for each cohort. ! !---------------------------------------------------------------------------------------! select case (iallom) - case (3,4) + case (3,4,5) !------------------------------------------------------------------------------------! ! This value corresponds to the 99% quantile of all trees measured by the ! ! Sustainable Landscapes. ! From 02a8a3c5bd69c6cc5fb9fe38813f547c83c5173a Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Sun, 4 Jun 2023 11:17:30 -0700 Subject: [PATCH 3/8] More bug fixes, and updates to comments to reflect the correct references. --- ED/src/init/ed_params.f90 | 134 ++++++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 48 deletions(-) diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index 343905b31..697cc9a5c 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -3016,13 +3016,13 @@ subroutine init_pft_alloc_params() real, dimension(3) , parameter :: nleaf = (/ 0.0192512, 0.9749494, 2.5858509 /) real, dimension(2) , parameter :: ncrown_area = (/ 0.1184295, 1.0521197 /) !---------------------------------------------------------------------------------------! - ! Coefficients for leaf and structural biomass (iallom = 3). For adult individuals, ! - ! we use the pantropical allometric equation from C14 that estimates AGB and the leaf ! - ! biomass from an allometric equation derived from F15 data (tropical forest, wild ! - ! flowering trees only), and the size- and site-dependent stratified sampling and ! - ! aggregation (J17). Total individual leaf area was fitted, so to get biomass we must ! - ! divide by SLA. The C2B term is added here but is removed when the coefficients are ! - ! set. ! + ! Coefficients for leaf and structural biomass (iallom = 3 or 5). For adult ! + ! individuals, we use the pantropical allometric equation from C14 that estimates AGB ! + ! and the leaf biomass from an allometric equation derived from F15 data (tropical ! + ! forest, wild flowering trees only), and the size- and site-dependent stratified ! + ! sampling and aggregation (J17). Total individual leaf area was fitted, so to get ! + ! biomass we must divide by SLA. The C2B term is added here but is removed when the ! + ! coefficients are set. ! ! ! ! References: ! ! ! @@ -3033,7 +3033,7 @@ subroutine init_pft_alloc_params() ! ! ! Falster DS, Duursma RA, Ishihara MI, Barneche DR, FitzJohn RG, Vahammar A, Aiba M, ! ! Ando M, Anten N, Aspinwall MJ. 2015. BAAD: a biomass and allometry database for ! - ! woody plants. Ecology, 96 (5):1445-1445. doi:10.1890/14-1889.1 (F16). ! + ! woody plants. Ecology, 96 (5):1445-1445. doi:10.1890/14-1889.1 (F15). ! ! ! ! Jucker T, Caspersen J, Chave J, Antin C, Barbier N, Bongers F, Dalponte M, ! ! van Ewijk KY, Forrester DI, Haeni M et al. 2017. Allometric equations for ! @@ -3315,9 +3315,10 @@ subroutine init_pft_alloc_params() !---------------------------------------------------------------------------------------! ! KIM: ED1/ED2 codes and Moorcroft et al. had the incorrect ratio. ! - ! MLO: The ratio is corrected only for tropical PFTs using iallom=3. To extend this ! - ! fix to other PFTs, one must refit parameters for other tissues (e.g. bdead), ! - ! so the total AGB is consistent with the original allometric equation for AGB. ! + ! MLO: The ratio is corrected only for tropical PFTs using iallom = 3 or 5. To ! + ! extend this fix to other PFTs, one must refit parameters for other tissues ! + ! (e.g. bdead), so the total AGB is consistent with the original allometric ! + ! equation for AGB. ! ! ! ! For the PFTs that were updated, we combine the pipe model with the data from ! ! CA08 and shape parameter from F16 to derive the ratio. ! @@ -3506,8 +3507,8 @@ subroutine init_pft_alloc_params() !---------------------------------------------------------------------------------------! ! Set bark thickness and carbon allocation to bark. This is currently done only ! - ! for tropical trees when IALLOM=3, because all biomass pools must be corrected to ! - ! ensure that total aboveground biomass is consistent with the allometric equations. ! + ! for tropical trees when IALLOM = 3 or 5, because all biomass pools must be corrected ! + ! to ensure that total aboveground biomass is consistent with the allometric equations. ! ! This may and should be changed in the future. ! ! ! ! References: ! @@ -3636,13 +3637,13 @@ subroutine init_pft_alloc_params() !------------------------------------------------------------------------------! ! Allometric equation based on the fitted curve using the Sustainable ! ! Landscapes data set (L16) and the size- and site-dependent stratified ! - ! sampling and aggregation (J17). This relationship is fitted using ! - ! Standardised Major Axis (SMA) so the same parameters can be used for ! - ! y=f(x) and x=f(y). This is particularly useful when initialising the model ! - ! with airborne lidar data. Because it would be extremely cumbersome to ! - ! derive a SMA-based regression based on Weibull function, we use a log-linear ! - ! relationship. The maximum height is based on the 99% quantile of all trees ! - ! measured by the SL team. ! + ! sampling and aggregation (J17), as described in (L20). This relationship is ! + ! fitted using Standardised Major Axis (SMA) so the same parameters can be ! + ! used for y=f(x) and x=f(y). This is particularly useful when initialising ! + ! the model with airborne lidar data (L20). Because it would be extremely ! + ! cumbersome to derive a SMA-based regression based on Weibull function, we ! + ! use a log-linear relationship. The maximum height is based on the 99% ! + ! quantile of all trees measured by the SL team. ! ! ! ! References: ! ! ! @@ -3656,6 +3657,11 @@ subroutine init_pft_alloc_params() ! biomass variability across intact and degraded forests in the Brazilian ! ! Amazon. Global Biogeochem. Cycles, 30(11):1639-1660. ! ! doi:10.1002/2016GB005465 (L16). ! + ! ! + ! Longo M, Saatchi SS, Keller M, Bowman KW, Ferraz A, Moorcroft PR, Morton D, ! + ! Bonal D, Brando P, Burban B et al. 2020. Impacts of degradation on water, ! + ! energy, and carbon cycling of the Amazon tropical forests. J. Geophys. ! + ! Res.-Biogeosci., 125: e2020JG005677. doi:10.1029/2020JG005677 (L20). ! !------------------------------------------------------------------------------! b1Ht (ipft) = 1.139963 b2Ht (ipft) = 0.564899 @@ -3823,8 +3829,10 @@ subroutine init_pft_alloc_params() ! Allometry using the Sustainable Landscapes data. ! !------------------------------------------------------------------------------! ! ! - ! Longo, M. et al. Carbon Debt and Recovery time of degraded forests in ! - ! the Amazon. Environ. Res. Lett., in prep. ! + ! Longo M, Saatchi SS, Keller M, Bowman KW, Ferraz A, Moorcroft PR, Morton D, ! + ! Bonal D, Brando P, Burban B et al. 2020. Impacts of degradation on water, ! + ! energy, and carbon cycling of the Amazon tropical forests. J. Geophys. ! + ! Res.-Biogeosci., 125: e2020JG005677. doi:10.1029/2020JG005677 (L20). ! ! ! ! Equation was derived from forest inventory measurements carried out at ! ! multiple locations in the Brazilian Amazon, and fitted using a ! @@ -3867,11 +3875,13 @@ subroutine init_pft_alloc_params() ! Poorter L., L. Bongers, F. Bongers, 2006: Architecture of 54 moist-forest tree ! ! species: traits, trade-offs, and functional groups. Ecology, 87, 1289-1301. ! ! ! - ! For iallom = 3, we use the allometric equation based on the Sustainable Landscapes ! - ! data set. ! + ! For iallom = 3 or 5, we use the allometric equation based on the Sustainable ! + ! Landscapes data set. ! ! ! - ! Longo, M. et al. Carbon Debt and Recovery time of degraded forests in the Amazon, ! - ! in prep. ! + ! Longo M, Saatchi SS, Keller M, Bowman KW, Ferraz A, Moorcroft PR, Morton D, Bonal D, ! + ! Brando P, Burban B et al. 2020. Impacts of degradation on water, energy, and ! + ! carbon cycling of the Amazon tropical forests. J. Geophys. Res.-Biogeosci., 125: ! + ! e2020JG005677. doi:10.1029/2020JG005677 (L20). ! ! ! ! Equation was derived from forest inventory measurements carried out at multiple ! ! locations in the Brazilian Amazon, and fitted using a heteroscedastic least ! @@ -3919,9 +3929,9 @@ subroutine init_pft_alloc_params() ! Parameters for DBH -> Bleaf allometry. ! ! ! ! IALLOM = 0,1,2 -- Bleaf = b1Bl * DBH^b2Bl ! - ! IALLOM = 3 -- Bleaf = b1Bl * (DBH*DBH*Height)^b2Bl ! - ! IALLOM = 4 -- leaf_A= b1Bl * (DBH*DBH*Height)^b2Bl ! - ! b1Bl is a fucntion of wood density ! + ! IALLOM = 3,4,5 -- leaf_A= b1Bl * (DBH*DBH*Height)^b2Bl ! + ! b1Bl is a function of wood density (IALLOM=4 only). ! + ! For IALLOM=3,4,5, leaf biomass will depend on SLA. ! ! ! ! The coefficients and thresholds depend on the PFT and allometric equations. In ! ! addition to the coefficients, we define the dbh point that defines adult cohorts as ! @@ -3963,22 +3973,27 @@ subroutine init_pft_alloc_params() !------------------------------------------------------------------------------! case (3,5) !------------------------------------------------------------------------------! - ! Allometry based on the BAAD data based (F15). We only used leaves from ! - ! wild tropical, flowering trees, and applied a stratified sample by DBH class ! - ! and location and cross-validation, following (J17). ! + ! Allometry based on the BAAD data based (F15) and described in (L20). We ! + ! only used leaves from wild tropical, flowering trees, and applied a ! + ! stratified sample by DBH class and location and cross-validation, following ! + ! (J17). ! ! ! ! References: ! ! ! + ! Falster DS, Duursma RA, Ishihara MI, Barneche DR, FitzJohn RG, Vahammar A, ! + ! Aiba M, Ando M, Anten N, Aspinwall MJ. 2015. BAAD: a biomass and ! + ! allometry database for woody plants. Ecology, 96 (5):1445-1445. ! + ! doi:10.1890/14-1889.1 (F15). ! + ! ! ! Jucker T, Caspersen J, Chave J, Antin C, Barbier N, Bongers F, Dalponte M, ! ! van Ewijk KY, Forrester DI, Haeni M et al. 2017. Allometric equations for ! ! integrating remote sensing imagery into forest monitoring programmes. ! ! Glob. Change Biol., 23(1):177-190. doi:10.1111/gcb.13388 (J17). ! ! ! - ! Longo M, Keller M, dos-Santos MN, Leitold V, Pinage ER, Baccini A, ! - ! Saatchi S, Nogueira EM, Batistella M , Morton DC. 2016. Aboveground ! - ! biomass variability across intact and degraded forests in the Brazilian ! - ! Amazon. Global Biogeochem. Cycles, 30(11):1639-1660. ! - ! doi:10.1002/2016GB005465 (L16). ! + ! Longo M, Saatchi SS, Keller M, Bowman KW, Ferraz A, Moorcroft PR, Morton D, ! + ! Bonal D, Brando P, Burban B et al. 2020. Impacts of degradation on water, ! + ! energy, and carbon cycling of the Amazon tropical forests. J. Geophys. ! + ! Res.-Biogeosci., 125: e2020JG005677. doi:10.1029/2020JG005677 (L20). ! !------------------------------------------------------------------------------! b1Bl(ipft) = c14f15_bl_xx(1) b2Bl(ipft) = c14f15_bl_xx(2) @@ -3987,7 +4002,12 @@ subroutine init_pft_alloc_params() !------------------------------------------------------------------------------! ! Allometry based on the BAAD data based (F15). We only used leaves from ! ! wild tropical, note that b1Bl has the unit of m2 leaf under this scenario ! - ! and will be converted to leaf carbon using SLA in size2bl + ! and will be converted to leaf carbon using SLA in size2bl. ! + ! ! + ! Falster DS, Duursma RA, Ishihara MI, Barneche DR, FitzJohn RG, Vahammar A, ! + ! Aiba M, Ando M, Anten N, Aspinwall MJ. 2015. BAAD: a biomass and ! + ! allometry database for woody plants. Ecology, 96 (5):1445-1445. ! + ! doi:10.1890/14-1889.1 (F15). ! !------------------------------------------------------------------------------! b1Bl(ipft) = exp( c14f15_la_wd(1) + c14f15_la_wd(2) * log(rho(ipft))) b2Bl(ipft) = c14f15_la_wd(3) @@ -4040,7 +4060,7 @@ subroutine init_pft_alloc_params() ! Bdead = { ! ! { b1Bs_large * DBH^b2Bl_large , if dbh > dbh_crit ! ! ! - ! IALLOM = 3, 4 ! + ! IALLOM = 3, 4, 5 ! ! ! ! Bdead = b1Bs_small * (DBH^2 * Height) ^ b2Bs_small ! ! ! @@ -4244,7 +4264,7 @@ subroutine init_pft_alloc_params() ! WAI parameters, the choice depends on IALLOM. ! !---------------------------------------------------------------------------------------! select case (iallom) - case (3,4) + case (3,4,5) !------------------------------------------------------------------------------------! ! WAI is defined as a fraction of (potential) LAI. This is just a refit of ! ! allometry 2 but using DBH*DBH*Height as predictor for consistency. ! @@ -4429,11 +4449,6 @@ subroutine init_pft_alloc_params() ! Hydrological niche segregation defines forest structure and drought tolerance ! ! strategies in a seasonal Amazonian forest. J. Ecol., in press. ! ! doi:10.1111/1365-2745.13022 (B18). ! - ! ! - ! Longo M, Keller M, dos-Santos MN, Leitold V, Pinage ER, Baccini A, Saatchi S, ! - ! Nogueira EM, Batistella M , Morton DC. 2016. Aboveground biomass variability ! - ! across intact and degraded forests in the Brazilian Amazon. Global Biogeochem. ! - ! Cycles, 30(11):1639-1660. doi:10.1002/2016GB005465 (L16). ! !---------------------------------------------------------------------------------------! d18O_ref(:) = -5.356 b1d18O (:) = 0.0516 @@ -4722,12 +4737,35 @@ subroutine init_pft_photo_params() !---------------------------------------------------------------------------------------! select case (iphysiol) case (0,2) - !----- Default parameters (Moorcroft et al. 2001; Longo 2014). ----------------------! + !------------------------------------------------------------------------------------! + ! Default parameters (M01/M09/L19). ! + ! ! + ! Longo M, Knox RG, Medvigy DM, Levine NM, Dietze MC, Kim Y, Swann ALS, Zhang K, ! + ! Rollinson CR, Bras RL et al. 2019. The biophysics, ecology, and biogeochemistry ! + ! of functionally diverse, vertically and horizontally heterogeneous ecosystems: ! + ! the Ecosystem Demography model, version 2.2 -- part 1: Model description. ! + ! Geosci. Model Dev., 12: 4309-4346. doi:10.5194/gmd-12-4309-2019 (L19). ! + ! ! + ! Medvigy DM, Wofsy SC, Munger JW, Hollinger DY , Moorcroft PR. 2009. Mechanistic ! + ! scaling of ecosystem function and dynamics in space and time: Ecosystem ! + ! demography model version 2. J. Geophys. Res.-Biogeosci., 114: G01002. ! + ! doi:10.1029/2008JG000812 (M09). ! + ! ! + ! Moorcroft PR, Hurtt GC , Pacala SW. 2001. A method for scaling vegetation ! + ! dynamics: The Ecosystem Demography model (ED). Ecol. Monogr., 71: 557-586. ! + ! doi:10.1890/0012- 9615(2001)071[0557:AMFSVD]2.0.CO;2 (M01). ! + !------------------------------------------------------------------------------------! vm_hor(:) = 3000. vm_q10(:) = merge(q10_c4,q10_c3,photosyn_pathway(:) == 4) !------------------------------------------------------------------------------------! case (1,3) - !----- Use values from von Caemmerer (2000). ----------------------------------------! + !------------------------------------------------------------------------------------! + ! Use values from vC00. ! + ! ! + ! von Caemmerer S. 2000. Biochemical models of leaf photosynthesis. No. 2 in ! + ! Techniques in Plant Sciences. CSIRO Publishing, Collingwood, VIC, Australia. ! + ! doi:10.1006/anbo.2000.1296 (vC00). ! + !------------------------------------------------------------------------------------! vm_hor(:) = 58520. * tphysref / (rmol * (t00+25.)) vm_q10(:) = 2.21 !------------------------------------------------------------------------------------! @@ -8568,7 +8606,7 @@ subroutine init_derived_params_after_xml() !---------------------------------------------------------------------------------------! ! Hgt_max of temperate trees cannot exceed b1Ht, and cannot exceed hgt_ref for ! - ! tropical trees (IALLOM=2 or IALLOM=3). ! + ! tropical trees (IALLOM = 2). ! !---------------------------------------------------------------------------------------! select case (iallom) case (2) From b2162b6e457b4f6618476d1c39689e373e752d63 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 6 Jun 2023 14:42:23 -0700 Subject: [PATCH 4/8] Fix ed_opspec.F90 so the model accepts IALLOM = 5. --- ED/src/io/ed_opspec.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ED/src/io/ed_opspec.F90 b/ED/src/io/ed_opspec.F90 index 1011fcf90..1bc47e331 100644 --- a/ED/src/io/ed_opspec.F90 +++ b/ED/src/io/ed_opspec.F90 @@ -1841,9 +1841,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (iallom < 0 .or. iallom > 4) then + if (iallom < 0 .or. iallom > 5) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid IALLOM, it must be between 0 and 4. Yours is set to' & + 'Invalid IALLOM, it must be between 0 and 5. Yours is set to' & ,iallom,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 From 291b2467a5a0df1c735641d8ccb916c7862dad8c Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 6 Jun 2023 16:55:18 -0700 Subject: [PATCH 5/8] Updated descriptions of the new IALLOM approaches in namelists and in ed_misc_coms.f90. --- BRAMS/Template/RAMSIN | 20 +++++++++------ BRAMS/run/RAMSIN | 20 +++++++++------ ED/Template/Template/ED2IN | 20 +++++++++------ ED/run/ED2IN | 23 ++++++++--------- ED/src/memory/ed_misc_coms.f90 | 45 +++++++++++++++++++++++++--------- 5 files changed, 85 insertions(+), 43 deletions(-) diff --git a/BRAMS/Template/RAMSIN b/BRAMS/Template/RAMSIN index 0e9b47465..dec8caac9 100644 --- a/BRAMS/Template/RAMSIN +++ b/BRAMS/Template/RAMSIN @@ -2347,13 +2347,19 @@ $ED2_INFO ! a few genera in Costa Rica. References: ! ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! ! (2008, Tree Physiol.). ! - ! 3. (Beta) Updated allometric for tropical PFTs based on data from ! - ! Sustainable Landscapes Brazil (Height and crown area), Chave et al. ! - ! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et ! - ! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take ! - ! DBH and Height as dependent variables, and DBH-Height takes a simpler ! - ! log-linear form fitted using SMA so it can be inverted (useful for ! - ! airborne lidar initialisation). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! IALLOM = 3, !---------------------------------------------------------------------------------------! diff --git a/BRAMS/run/RAMSIN b/BRAMS/run/RAMSIN index dd87f6b44..a8ce22db7 100644 --- a/BRAMS/run/RAMSIN +++ b/BRAMS/run/RAMSIN @@ -2365,13 +2365,19 @@ $ED2_INFO ! a few genera in Costa Rica. References: ! ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! ! (2008, Tree Physiol.). ! - ! 3. (Beta) Updated allometric for tropical PFTs based on data from ! - ! Sustainable Landscapes Brazil (Height and crown area), Chave et al. ! - ! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et ! - ! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take ! - ! DBH and Height as dependent variables, and DBH-Height takes a simpler ! - ! log-linear form fitted using SMA so it can be inverted (useful for ! - ! airborne lidar initialisation). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! IALLOM = 3, !---------------------------------------------------------------------------------------! diff --git a/ED/Template/Template/ED2IN b/ED/Template/Template/ED2IN index 63504ddd5..2bc06efda 100644 --- a/ED/Template/Template/ED2IN +++ b/ED/Template/Template/ED2IN @@ -882,13 +882,19 @@ $ED_NL ! a few genera in Costa Rica. References: ! ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! ! (2008, Tree Physiol.). ! - ! 3. (Beta) Updated allometric for tropical PFTs based on data from ! - ! Sustainable Landscapes Brazil (Height and crown area), Chave et al. ! - ! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et ! - ! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take ! - ! DBH and Height as dependent variables, and DBH-Height takes a simpler ! - ! log-linear form fitted using SMA so it can be inverted (useful for ! - ! airborne lidar initialisation). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! NL%IALLOM = myallom !---------------------------------------------------------------------------------------! diff --git a/ED/run/ED2IN b/ED/run/ED2IN index 11f752ea3..b057ba5f3 100644 --- a/ED/run/ED2IN +++ b/ED/run/ED2IN @@ -895,18 +895,19 @@ $ED_NL ! a few genera in Costa Rica. References: ! ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! ! (2008, Tree Physiol.). ! - ! 3. (Beta) Updated allometric for tropical PFTs based on data from ! - ! Sustainable Landscapes Brazil (Height and crown area), Chave et al. ! - ! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et ! - ! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take ! - ! DBH and Height as dependent variables, and DBH-Height takes a simpler ! - ! log-linear form fitted using SMA so it can be inverted (useful for ! - ! airborne lidar initialisation). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! - ! equations depend on wood density; (b) use leaf area based allometry ! - ! instead of leaf biomass based allometry, which is more compatible with ! - ! trait plasticity in SLA; (c) use height-based root allometry from ! - ! Smith-Martin et al. (2020, New Phyt.) ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! NL%IALLOM = 3 !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ed_misc_coms.f90 b/ED/src/memory/ed_misc_coms.f90 index 79968322d..542fc0227 100644 --- a/ED/src/memory/ed_misc_coms.f90 +++ b/ED/src/memory/ed_misc_coms.f90 @@ -260,17 +260,40 @@ module ed_misc_coms !----- Namelist option for allometry scheme. -------------------------------------------! - integer :: iallom ! 0 -- Original ED-2.1 allometry - ! 1 -- DBH -> AGB Tree allometry based on Baker et al. (2004) - ! keep original ED-2.1 Bl/Bd ratio - ! 2 -- DBH -> AGB Tree allometry based on Baker et al. (2004) - ! keep original ED-2.1 Bl - ! 3 -- Updated allometric and trait-based parameters for tropical - ! PFTs. When available, parameters came from regional data - ! sets and regional studies, or from local studies when regional - ! ones were not found. Check ed_params.f90 for details and - ! references. - !---------------------------------------------------------------------------------------! + integer :: iallom ! 0 -- (Legacy) Original ED-1.0, included for back compatibility. + ! 1 -- (Legacy) ED-2.1 allometry, included for back compatibility. + ! a. The coefficients for structural biomass are set so the + ! total AGB is similar to Baker et al. (2004, Glob. Change + ! Biol.), equation 2. + ! b. Experimental root depth that makes canopy trees to have + ! root depths of 5m and grasses/seedlings at 0.5 to have root + ! depth of 0.5 m. + ! c. Crown area defined as in Poorter et al. (2006, Ecology), + ! imposing maximum crown area. + ! 2 -- (ED-2.2 default) Similar to 1, but with a few extra changes. + ! a. Height -> DBH allometry as in Poorter et al. (2006) + ! b. Balive is retuned, using a few leaf biomass allometric + ! equations for a few genera in Costa Rica. References: + ! Cole and Ewel (2006, Forest Ecol. Manag.), and + ! Calvo-Alvarado et al. (2008, Tree Physiol.). + ! 3 -- (Beta) Revised tropical PFT allometric (Longo et al. 2020, + ! J. Geophys. Res.-Biogeosci.). + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the + ! Sustainable Landscapes Dataset (Longo et al. 2016, Glob. + ! Biogeochem. Cycles). DBH-Height takes a simpler log-linear + ! form fitted using SMA so it can be inverted (useful for + ! airborne lidar initialisation). + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change + ! Biol.) + ! c. DBH^2*H -> Leaf area based on the BAAD data base: + ! Falster et al. (2015, Ecology). + ! 4 -- (Under Development) Similar to 3 but (a) leaf and height + ! allometric equations depend on wood density; (b) use + ! height-based root allometry from Smith-Martin et al. (2020, + ! New Phyt.). + ! 5 -- (Under Development) Similar to IALLOM = 3 but using the + ! rooting allometry from IALLOM = 4. + !---------------------------------------------------------------------------------------! From 73181bee286ee41e8b9bb2190260ed6f4015291a Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Sun, 11 Jun 2023 12:33:18 -0700 Subject: [PATCH 6/8] Added call to update rooting distribution after cohort merging. --- ED/src/utils/fuse_fiss_utils.f90 | 9 ++++++++- diff_version.sh | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ED/src/utils/fuse_fiss_utils.f90 b/ED/src/utils/fuse_fiss_utils.f90 index 213f00572..0ce34479f 100644 --- a/ED/src/utils/fuse_fiss_utils.f90 +++ b/ED/src/utils/fuse_fiss_utils.f90 @@ -1995,7 +1995,8 @@ subroutine fuse_2_cohorts(cpatch,donc,recc,can_prss,can_shv,lsl,fuse_initial) , bl2h & ! function , dbh2h & ! function , size2xb & ! function - , ed_balive ! ! function + , ed_balive & ! function + , distrib_root ! ! subroutine use ed_max_dims , only : n_mort ! ! intent(in) use ed_misc_coms , only : writing_long & ! intent(in) , writing_eorq & ! intent(in) @@ -2198,6 +2199,12 @@ subroutine fuse_2_cohorts(cpatch,donc,recc,can_prss,can_shv,lsl,fuse_initial) + !----- Update the vertical distribution of roots. -----------------------------------! + call distrib_root(cpatch%krdepth(recc),cpatch%pft(recc),cpatch%root_frac(:,recc)) + !------------------------------------------------------------------------------------! + + + !----- Maintenance costs. -----------------------------------------------------------! cpatch%leaf_maintenance (recc) = cpatch%leaf_maintenance (recc) * rnplant & diff --git a/diff_version.sh b/diff_version.sh index d3be988ac..3e69ceee0 100755 --- a/diff_version.sh +++ b/diff_version.sh @@ -38,8 +38,8 @@ work="${HOME}/Models/EDBRAMS" # Extensions. Decide how much to check. # #------------------------------------------------------------------------------------------# case "${comptype}" in -partial) exts=".c .f90 .F90" ;; -*) exts=".c .f90 .F90 .r .txt" ;; +partial) exts=".c .F90 .f90" ;; +*) exts=".c .F90 .f90 .r .txt" ;; esac #------------------------------------------------------------------------------------------# From 07e6d7b2c5f0a5c1fc1da5b6695aba9dc42a2cc0 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Sun, 11 Jun 2023 16:01:01 -0700 Subject: [PATCH 7/8] Temporarily disabling mpi compilation from CI. --- ED/build/make/include.mk.travisci | 40 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/ED/build/make/include.mk.travisci b/ED/build/make/include.mk.travisci index 243995438..35ade16d0 100644 --- a/ED/build/make/include.mk.travisci +++ b/ED/build/make/include.mk.travisci @@ -39,17 +39,27 @@ USE_COLLECTIVE_MPIO=0 + +#------------------------------------------------------------------------------------------# +# This should be 1 unless you are running with -gen-interfaces. Interfaces usually # +# make the compilation to crash when the -gen-interfaces option are on, so this flag # +# bypass all interfaces in the code. # +#------------------------------------------------------------------------------------------# +USE_INTERF=1 +#------------------------------------------------------------------------------------------# + + + #################################### COMPILER SETTINGS ##################################### CMACH=TRAVISCI FC_TYPE=GNU -F_COMP=mpif90 -C_COMP=mpicc -LOADER=mpif90 +F_COMP=gfortran +C_COMP=gcc +LOADER=gfortran LIBS= MOD_EXT=mod #------------------------------------------------------------------------------------------# -USE_INTERF=1 ##################################### COMPILER OPTIONS ##################################### @@ -62,19 +72,19 @@ ifeq ($(KIND_COMP),) endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),$(filter $(KIND_COMP), A B C D)) - F_OPTS= -O0 -ffree-line-length-none -g -fimplicit-none -Wall -finit-real=nan \ - -ffpe-trap=invalid,zero,overflow,underflow -fbacktrace -fbounds-check \ - -frecursive - C_OPTS= -O0 -DLITTLE -g - LOADER_OPTS= -O0 -ffree-line-length-none -g -fimplicit-none -Wall -finit-real=nan \ - -ffpe-trap=invalid,zero,overflow,underflow -fbacktrace -fbounds-check \ - -frecursive + F_OPTS= -O0 -ffree-line-length-none -g -fimplicit-none -Wall -finit-real=snan \ + -finit-integer=-2147483648 -ffpe-trap=invalid,zero,overflow,underflow \ + -fcheck=all -frecursive -fsignaling-nans -Werror -fopenmp -fbacktrace -static + C_OPTS= -O0 -DLITTLE -g -fbacktrace -static + LOADER_OPTS= -O0 -ffree-line-length-none -g -fimplicit-none -Wall -finit-real=snan \ + -finit-integer=-2147483648 -ffpe-trap=invalid,zero,overflow,underflow \ + -fcheck=all -frecursive -fsignaling-nans -Werror -fopenmp -fbacktrace #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) - F_OPTS= -O3 -ffree-line-length-none -frecursive -fno-whole-file -static - C_OPTS= -O0 -DLITTLE -g -static - LOADER_OPTS= -O3 -ffree-line-length-none -frecursive -fno-whole-file + F_OPTS= -O3 -ffree-line-length-none -frecursive -fopenmp -fbacktrace -static + C_OPTS= -O3 -DLITTLE -g -fbacktrace -static + LOADER_OPTS= -O3 -ffree-line-length-none -frecursive -fopenmp -fbacktrace #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# @@ -91,7 +101,7 @@ endif MPI_PATH= PAR_INCS= PAR_LIBS= -PAR_DEFS=-DRAMS_MPI +PAR_DEFS= #------------------------------------------------------------------------------------------# From cf1eeb2c6e6f59dff7061c9eb2ec328bfde8b668 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Sun, 11 Jun 2023 17:00:06 -0700 Subject: [PATCH 8/8] Update ED2IN variable description in the CI namelists. --- EDTS/Templates/ED2IN-TEST | 20 +++++++++----- EDTS/Templates/ED2IN-tonzi | 43 ++++++++++++++++++------------ EDTS/Templates/ED2IN-tonzi.harvest | 43 ++++++++++++++++++------------ 3 files changed, 65 insertions(+), 41 deletions(-) diff --git a/EDTS/Templates/ED2IN-TEST b/EDTS/Templates/ED2IN-TEST index 64f489146..11845187c 100644 --- a/EDTS/Templates/ED2IN-TEST +++ b/EDTS/Templates/ED2IN-TEST @@ -887,13 +887,19 @@ $ED_NL ! a few genera in Costa Rica. References: ! ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! ! (2008, Tree Physiol.). ! - ! 3. (Beta) Updated allometric for tropical PFTs based on data from ! - ! Sustainable Landscapes Brazil (Height and crown area), Chave et al. ! - ! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et ! - ! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take ! - ! DBH and Height as dependent variables, and DBH-Height takes a simpler ! - ! log-linear form fitted using SMA so it can be inverted (useful for ! - ! airborne lidar initialisation). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! NL%IALLOM = 3 !---------------------------------------------------------------------------------------! diff --git a/EDTS/Templates/ED2IN-tonzi b/EDTS/Templates/ED2IN-tonzi index 06ed7ff22..a3e0b78c4 100644 --- a/EDTS/Templates/ED2IN-tonzi +++ b/EDTS/Templates/ED2IN-tonzi @@ -788,27 +788,36 @@ $ED_NL !---------------------------------------------------------------------------------------! - ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs. Temperate PFTs ! - ! will use the new root allometry and the maximum crown area if IALLOM is set ! - ! to 1 or 2). ! - ! 0. Original ED-2.1 ! - ! 1. a. The coefficients for structural biomass are set so the total AGB ! - ! is similar to Baker et al. (2004), equation 2. Balive is the ! - ! default ED-2.1; ! + ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs). Temperate PFTs ! + ! will use the new root allometry and the maximum crown area unless IALLOM is ! + ! set to 0). ! + ! 0. (Legacy) Original ED-1.0, included for back compatibility. ! + ! 1. (Legacy) ! + ! a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004, Glob. Change Biol.), equation 2. ! ! b. Experimental root depth that makes canopy trees to have root depths ! ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! - ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! - ! crown area ! - ! 2. Similar to 1, but with a few extra changes. ! + ! c. Crown area defined as in Poorter et al. (2006, Ecology), imposing ! + ! maximum crown area. ! + ! 2. (ED-2.2 default) Similar to 1, but with a few extra changes. ! ! a. Height -> DBH allometry as in Poorter et al. (2006) ! ! b. Balive is retuned, using a few leaf biomass allometric equations for ! - ! a few genuses in Costa Rica. References: ! - ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! - ! 3. Similar to 2, except that tropical leaf biomass is estimated from ! - ! Lescure et al. (1983), and PFT differences on bleaf are based on SLA ! - ! instead of wood density. Also, the leaf allometry is split into ! - ! small classes ("saplings") and large classes ("trees"), like in Cole ! - ! and Ewel (2006). ! + ! a few genera in Costa Rica. References: ! + ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! + ! (2008, Tree Physiol.). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! NL%IALLOM = 2 !---------------------------------------------------------------------------------------! diff --git a/EDTS/Templates/ED2IN-tonzi.harvest b/EDTS/Templates/ED2IN-tonzi.harvest index fed665436..590485aaf 100644 --- a/EDTS/Templates/ED2IN-tonzi.harvest +++ b/EDTS/Templates/ED2IN-tonzi.harvest @@ -788,27 +788,36 @@ $ED_NL !---------------------------------------------------------------------------------------! - ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs. Temperate PFTs ! - ! will use the new root allometry and the maximum crown area if IALLOM is set ! - ! to 1 or 2). ! - ! 0. Original ED-2.1 ! - ! 1. a. The coefficients for structural biomass are set so the total AGB ! - ! is similar to Baker et al. (2004), equation 2. Balive is the ! - ! default ED-2.1; ! + ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs). Temperate PFTs ! + ! will use the new root allometry and the maximum crown area unless IALLOM is ! + ! set to 0). ! + ! 0. (Legacy) Original ED-1.0, included for back compatibility. ! + ! 1. (Legacy) ! + ! a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004, Glob. Change Biol.), equation 2. ! ! b. Experimental root depth that makes canopy trees to have root depths ! ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! - ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! - ! crown area ! - ! 2. Similar to 1, but with a few extra changes. ! + ! c. Crown area defined as in Poorter et al. (2006, Ecology), imposing ! + ! maximum crown area. ! + ! 2. (ED-2.2 default) Similar to 1, but with a few extra changes. ! ! a. Height -> DBH allometry as in Poorter et al. (2006) ! ! b. Balive is retuned, using a few leaf biomass allometric equations for ! - ! a few genuses in Costa Rica. References: ! - ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! - ! 3. Similar to 2, except that tropical leaf biomass is estimated from ! - ! Lescure et al. (1983), and PFT differences on bleaf are based on SLA ! - ! instead of wood density. Also, the leaf allometry is split into ! - ! small classes ("saplings") and large classes ("trees"), like in Cole ! - ! and Ewel (2006). ! + ! a few genera in Costa Rica. References: ! + ! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. ! + ! (2008, Tree Physiol.). ! + ! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). ! + ! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable ! + ! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). ! + ! DBH-Height takes a simpler log-linear form fitted using SMA so it can ! + ! be inverted (useful for airborne lidar initialisation). ! + ! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) ! + ! c. DBH^2*H -> Leaf area based on the BAAD data base: ! + ! Falster et al. (2015, Ecology). ! + ! 4. (Under Development) Similar to 3 but (a) leaf and height allometric ! + ! equations depend on wood density; (b) use height-based root allometry ! + ! from Smith-Martin et al. (2020, New Phyt.). ! + ! 5. (Under Development) Similar to IALLOM = 3 but using the rooting ! + ! allometry from IALLOM = 4. ! !---------------------------------------------------------------------------------------! NL%IALLOM = 2 !---------------------------------------------------------------------------------------!