From 3ec95b21fb53f1b45f368007d7552d83e9c41142 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 28 Sep 2020 11:21:50 -0700 Subject: [PATCH 01/13] adding scalar bc inputs from hlm --- main/FatesInterfaceMod.F90 | 4 ++++ main/FatesInterfaceTypesMod.F90 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 24b10f1ded..4a80bf285c 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -220,6 +220,8 @@ subroutine zero_bcs(fates,s) fates%bc_in(s)%tot_litc = 0.0_r8 fates%bc_in(s)%snow_depth_si = 0.0_r8 fates%bc_in(s)%frac_sno_eff_si = 0.0_r8 + fates%bc_in(s)%w_scalar_sisl(:) = 0.0_r8 + fates%bc_in(s)%t_scalar_sisl(:) = 0.0_r8 if(do_fates_salinity)then fates%bc_in(s)%salinity_sl(:) = 0.0_r8 @@ -397,6 +399,8 @@ subroutine allocate_bcin(bc_in, nlevsoil_in, nlevdecomp_in, num_lu_harvest_cats) allocate(bc_in%z_sisl(nlevsoil_in)) allocate(bc_in%decomp_id(nlevsoil_in)) allocate(bc_in%dz_decomp_sisl(nlevdecomp_in)) + allocate(bc_in%w_scalar_sisl(nlevsoil_in)) + allocate(bc_in%t_scalar_sisl(nlevsoil_in)) ! Lightning (or successful ignitions) and population density allocate(bc_in%lightning24(maxPatchesPerSite)) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 485b30cb9e..e8c9515f18 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -330,6 +330,10 @@ module FatesInterfaceTypesMod ! soil layer maps to. This will either ! be equivalent (ie integer ascending) ! Or, all will be 1. + + ! Decomposition fractions + real(r8),allocatable :: w_scalar_sisl(:) ! fraction by which decomposition is limited by moisture availability + real(r8),allocatable :: t_scalar_sisl(:) ! fraction by which decomposition is limited by temperature ! Vegetation Dynamics From dbf64ef73d9576f3fa5d7b137338d532fb89fe3f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 28 Sep 2020 14:33:53 -0700 Subject: [PATCH 02/13] bringing in hlm scalar values to fragmentation subroutine --- biogeochem/EDPhysiologyMod.F90 | 59 ++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 423f1918d6..2719c61a7c 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2247,13 +2247,15 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ! ! !LOCAL VARIABLES: logical :: use_century_tfunc = .false. + logical :: use_hlm_scalar = .true. ! Use hlm input decomp fraction scalars integer :: j - integer :: ifp ! Index of a FATES Patch "ifp" - real(r8) :: t_scalar - real(r8) :: w_scalar - real(r8) :: catanf ! hyperbolic temperature function from CENTURY - real(r8) :: catanf_30 ! hyperbolic temperature function from CENTURY - real(r8) :: t1 ! temperature argument + integer :: ifp ! Index of a FATES Patch "ifp" + real(r8) :: t_scalar ! temperature scalar + real(r8) :: w_scalar ! moisture scalar + real(r8) :: catanf ! hyperbolic temperature function from CENTURY + real(r8) :: catanf_30 ! hyperbolic temperature function from CENTURY + real(r8) :: t1 ! temperature argument + real(r8) :: i_decomp ! decomp layer index !---------------------------------------------------------------------- catanf(t1) = 11.75_r8 +(29.7_r8 / pi) * atan( pi * 0.031_r8 * ( t1 - 15.4_r8 )) @@ -2261,28 +2263,45 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ifp = currentPatch%patchno - if ( .not. use_century_tfunc ) then - !calculate rate constant scalar for soil temperature,assuming that the base rate constants - !are assigned for non-moisture limiting conditions at 25C. + ! Use the hlm temp and moisture decomp fractions by default + if ( use_hlm_scalar ) then + + i_decomp = 0 + t_scalar = bc_in%t_scalar_sisl(i_decomp) + w_scalar = bc_in%w_scalar_sisl(i_decomp) + + write(fates_log(),*) 'HLM t_scalar:', t_scalar + write(fates_log(),*) 'HLM w_scalar:', w_scalar + + endif + + + if ( .not. use_century_tfunc ) then + !calculate rate constant scalar for soil temperature,assuming that the base rate constants + !are assigned for non-moisture limiting conditions at 25C. if (bc_in%t_veg24_pa(ifp) >= tfrz) then - t_scalar = q10_mr**((bc_in%t_veg24_pa(ifp)-(tfrz+25._r8))/10._r8) - ! Q10**((t_soisno(c,j)-(tfrz+25._r8))/10._r8) + t_scalar = q10_mr**((bc_in%t_veg24_pa(ifp)-(tfrz+25._r8))/10._r8) + ! Q10**((t_soisno(c,j)-(tfrz+25._r8))/10._r8) else - t_scalar = (q10_mr**(-25._r8/10._r8))*(q10_froz**((bc_in%t_veg24_pa(ifp)-tfrz)/10._r8)) + t_scalar = (q10_mr**(-25._r8/10._r8))*(q10_froz**((bc_in%t_veg24_pa(ifp)-tfrz)/10._r8)) !Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-tfrz)/10._r8) endif - else + else ! original century uses an arctangent function to calculate the ! temperature dependence of decomposition t_scalar = max(catanf(bc_in%t_veg24_pa(ifp)-tfrz)/catanf_30,0.01_r8) - endif + endif - !Moisture Limitations - !BTRAN APPROACH - is quite simple, but max's out decomp at all unstressed - !soil moisture values, which is not realistic. - !litter decomp is proportional to water limitation on average... - w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) - + !Moisture Limitations + !BTRAN APPROACH - is quite simple, but max's out decomp at all unstressed + !soil moisture values, which is not realistic. + !litter decomp is proportional to water limitation on average... + w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) + + write(fates_log(),*) 'q10 t_scalar:', t_scalar + write(fates_log(),*) 'q10 w_scalar:', w_scalar + + ! Calculate the fragmentation_scaler currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,t_scalar * w_scalar)) end subroutine fragmentation_scaler From 2007ffd5380cdf038d9cc8ae6aad5714c2f5dfb6 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 7 Oct 2020 15:06:03 -0700 Subject: [PATCH 03/13] updating fragmentation_scaler to use hardcoded switch --- biogeochem/EDPhysiologyMod.F90 | 53 +++++++++++++++------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 2719c61a7c..d32896bc8d 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2266,40 +2266,35 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ! Use the hlm temp and moisture decomp fractions by default if ( use_hlm_scalar ) then - i_decomp = 0 + i_decomp = 1 ! Temporary hardcode t_scalar = bc_in%t_scalar_sisl(i_decomp) w_scalar = bc_in%w_scalar_sisl(i_decomp) - - write(fates_log(),*) 'HLM t_scalar:', t_scalar - write(fates_log(),*) 'HLM w_scalar:', w_scalar - endif + else - - if ( .not. use_century_tfunc ) then - !calculate rate constant scalar for soil temperature,assuming that the base rate constants - !are assigned for non-moisture limiting conditions at 25C. - if (bc_in%t_veg24_pa(ifp) >= tfrz) then - t_scalar = q10_mr**((bc_in%t_veg24_pa(ifp)-(tfrz+25._r8))/10._r8) - ! Q10**((t_soisno(c,j)-(tfrz+25._r8))/10._r8) + if ( .not. use_century_tfunc ) then + !calculate rate constant scalar for soil temperature,assuming that the base rate constants + !are assigned for non-moisture limiting conditions at 25C. + if (bc_in%t_veg24_pa(ifp) >= tfrz) then + t_scalar = q10_mr**((bc_in%t_veg24_pa(ifp)-(tfrz+25._r8))/10._r8) + ! Q10**((t_soisno(c,j)-(tfrz+25._r8))/10._r8) + else + t_scalar = (q10_mr**(-25._r8/10._r8))*(q10_froz**((bc_in%t_veg24_pa(ifp)-tfrz)/10._r8)) + !Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-tfrz)/10._r8) + endif else - t_scalar = (q10_mr**(-25._r8/10._r8))*(q10_froz**((bc_in%t_veg24_pa(ifp)-tfrz)/10._r8)) - !Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-tfrz)/10._r8) - endif - else - ! original century uses an arctangent function to calculate the - ! temperature dependence of decomposition - t_scalar = max(catanf(bc_in%t_veg24_pa(ifp)-tfrz)/catanf_30,0.01_r8) - endif - - !Moisture Limitations - !BTRAN APPROACH - is quite simple, but max's out decomp at all unstressed - !soil moisture values, which is not realistic. - !litter decomp is proportional to water limitation on average... - w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) - - write(fates_log(),*) 'q10 t_scalar:', t_scalar - write(fates_log(),*) 'q10 w_scalar:', w_scalar + ! original century uses an arctangent function to calculate the + ! temperature dependence of decomposition + t_scalar = max(catanf(bc_in%t_veg24_pa(ifp)-tfrz)/catanf_30,0.01_r8) + endif + + !Moisture Limitations + !BTRAN APPROACH - is quite simple, but max's out decomp at all unstressed + !soil moisture values, which is not realistic. + !litter decomp is proportional to water limitation on average... + w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) + + endif ! Calculate the fragmentation_scaler currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,t_scalar * w_scalar)) From af6bd4bb2eb966e669eda2866d7eaed9647d0d85 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 9 Oct 2020 17:16:13 -0700 Subject: [PATCH 04/13] Updating fragmentation scalar to ouptu an array to hold scalar for the soil levels --- biogeochem/EDPhysiologyMod.F90 | 31 ++++++++++++++++++------------- main/EDTypesMod.F90 | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index d32896bc8d..8721feff76 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2247,7 +2247,7 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ! ! !LOCAL VARIABLES: logical :: use_century_tfunc = .false. - logical :: use_hlm_scalar = .true. ! Use hlm input decomp fraction scalars + logical :: use_hlm_soil_scalar = .true. ! Use hlm input decomp fraction scalars integer :: j integer :: ifp ! Index of a FATES Patch "ifp" real(r8) :: t_scalar ! temperature scalar @@ -2255,7 +2255,7 @@ subroutine fragmentation_scaler( currentPatch, bc_in) real(r8) :: catanf ! hyperbolic temperature function from CENTURY real(r8) :: catanf_30 ! hyperbolic temperature function from CENTURY real(r8) :: t1 ! temperature argument - real(r8) :: i_decomp ! decomp layer index + !real(r8) :: i_decomp ! decomp layer index !---------------------------------------------------------------------- catanf(t1) = 11.75_r8 +(29.7_r8 / pi) * atan( pi * 0.031_r8 * ( t1 - 15.4_r8 )) @@ -2264,12 +2264,15 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ifp = currentPatch%patchno ! Use the hlm temp and moisture decomp fractions by default - if ( use_hlm_scalar ) then + if ( use_hlm_soil_scalar ) then - i_decomp = 1 ! Temporary hardcode - t_scalar = bc_in%t_scalar_sisl(i_decomp) - w_scalar = bc_in%w_scalar_sisl(i_decomp) + !i_decomp = 1 ! Temporary hardcode + !t_scalar = bc_in%t_scalar_sisl(:) + !w_scalar = bc_in%w_scalar_sisl(:) + ! Calculate the fragmentation_scaler + currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,bc_in%t_scalar_sisl * bc_in%t_scalar_sisl)) + else if ( .not. use_century_tfunc ) then @@ -2294,10 +2297,12 @@ subroutine fragmentation_scaler( currentPatch, bc_in) !litter decomp is proportional to water limitation on average... w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) + ! Calculate the fragmentation_scaler + allocate(currentPatch%fragmentation_scaler(size(bc_in%t_scalar_sisl))) + currentPatch%fragmentation_scaler(:) = min(1.0_r8,max(0.0_r8,t_scalar * w_scalar)) + endif - ! Calculate the fragmentation_scaler - currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,t_scalar * w_scalar)) end subroutine fragmentation_scaler @@ -2316,7 +2321,7 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) ! !ARGUMENTS type(litter_type),intent(inout),target :: litt - real(r8),intent(in) :: fragmentation_scaler + real(r8),intent(in) :: fragmentation_scaler(:) ! This is not necessarily every soil layer, this is the number ! of effective layers that are active and can be sent @@ -2334,12 +2339,12 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) do c = 1,ncwd litt%ag_cwd_frag(c) = litt%ag_cwd(c) * SF_val_max_decomp(c) * & - years_per_day * fragmentation_scaler + years_per_day * fragmentation_scaler(1) do ilyr = 1,nlev_eff_decomp litt%bg_cwd_frag(c,ilyr) = litt%bg_cwd(c,ilyr) * SF_val_max_decomp(c) * & - years_per_day * fragmentation_scaler + years_per_day * fragmentation_scaler(ilyr) enddo end do @@ -2352,11 +2357,11 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) do dcmpy = 1,ndcmpy litt%leaf_fines_frag(dcmpy) = litt%leaf_fines(dcmpy) * & - years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler + years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler(1) do ilyr = 1,nlev_eff_decomp litt%root_fines_frag(dcmpy,ilyr) = litt%root_fines(dcmpy,ilyr) * & - years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler + years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler(ilyr) end do enddo diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 5ae635d5c8..2801cda297 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -526,7 +526,7 @@ module EDTypesMod type(litter_type), pointer :: litter(:) ! Litter (leaf,fnrt,CWD and seeds) for different elements - real(r8) :: fragmentation_scaler ! Scale rate of litter fragmentation. 0 to 1. + real(r8),allocatable :: fragmentation_scaler(:) ! Scale rate of litter fragmentation. 0 to 1. real(r8) :: repro(maxpft) ! allocation to reproduction per PFT : KgC/m2 From b4396fa53a5414c30b760f06ad002bc8da721cd2 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 12 Oct 2020 17:06:24 -0700 Subject: [PATCH 05/13] removing temp variables and unused numlevsoil in CWDout --- biogeochem/EDPhysiologyMod.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 8721feff76..8fbd9560f2 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2255,7 +2255,6 @@ subroutine fragmentation_scaler( currentPatch, bc_in) real(r8) :: catanf ! hyperbolic temperature function from CENTURY real(r8) :: catanf_30 ! hyperbolic temperature function from CENTURY real(r8) :: t1 ! temperature argument - !real(r8) :: i_decomp ! decomp layer index !---------------------------------------------------------------------- catanf(t1) = 11.75_r8 +(29.7_r8 / pi) * atan( pi * 0.031_r8 * ( t1 - 15.4_r8 )) @@ -2266,10 +2265,6 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ! Use the hlm temp and moisture decomp fractions by default if ( use_hlm_soil_scalar ) then - !i_decomp = 1 ! Temporary hardcode - !t_scalar = bc_in%t_scalar_sisl(:) - !w_scalar = bc_in%w_scalar_sisl(:) - ! Calculate the fragmentation_scaler currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,bc_in%t_scalar_sisl * bc_in%t_scalar_sisl)) @@ -2333,7 +2328,6 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) integer :: c integer :: ilyr integer :: dcmpy - integer :: numlevsoil !---------------------------------------------------------------------- do c = 1,ncwd From 087c87ce03fa044c4b8db908edc9eea1297213d0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 20 Oct 2020 12:03:39 -0700 Subject: [PATCH 06/13] correcting typo in fragmentation scaler calculation. Moisture missing --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 8fbd9560f2..608260f67b 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2266,7 +2266,7 @@ subroutine fragmentation_scaler( currentPatch, bc_in) if ( use_hlm_soil_scalar ) then ! Calculate the fragmentation_scaler - currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,bc_in%t_scalar_sisl * bc_in%t_scalar_sisl)) + currentPatch%fragmentation_scaler = min(1.0_r8,max(0.0_r8,bc_in%t_scalar_sisl * bc_in%w_scalar_sisl)) else From bb2a5e645854669353f1f65f1123c0868346b286 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Tue, 20 Oct 2020 12:14:49 -0700 Subject: [PATCH 07/13] Update main/EDTypesMod.F90 Adding clarification on fragmentation calculation. Co-authored-by: jkshuman --- main/EDTypesMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 2801cda297..7288a4ef99 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -526,7 +526,7 @@ module EDTypesMod type(litter_type), pointer :: litter(:) ! Litter (leaf,fnrt,CWD and seeds) for different elements - real(r8),allocatable :: fragmentation_scaler(:) ! Scale rate of litter fragmentation. 0 to 1. + real(r8),allocatable :: fragmentation_scaler(:) ! Scale rate of litter fragmentation based on soil layer. 0 to 1. real(r8) :: repro(maxpft) ! allocation to reproduction per PFT : KgC/m2 From 01b2a86c6d78c9e5a44d9f968200474dd2496c07 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 20 Oct 2020 12:21:54 -0700 Subject: [PATCH 08/13] adding descriptive comments and whitespace cleanup --- biogeochem/EDPhysiologyMod.F90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 608260f67b..7ab48918fc 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2315,7 +2315,6 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) ! ! !ARGUMENTS type(litter_type),intent(inout),target :: litt - real(r8),intent(in) :: fragmentation_scaler(:) ! This is not necessarily every soil layer, this is the number @@ -2330,6 +2329,11 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) integer :: dcmpy !---------------------------------------------------------------------- + + ! Above ground litters are associated with the top soil layer temperature and + ! moisture scalars and as such the top-layer fragmentation scalar index of 1 + ! is used for ag_cwd_frag and root_fines_frag calculations. + do c = 1,ncwd litt%ag_cwd_frag(c) = litt%ag_cwd(c) * SF_val_max_decomp(c) * & From 8dd2a2f34f00f0faf939fcfb53f8b278a24aec68 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 21 Oct 2020 18:32:34 -0600 Subject: [PATCH 09/13] fixing array allocation --- biogeochem/EDPatchDynamicsMod.F90 | 2 ++ biogeochem/EDPhysiologyMod.F90 | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index f8f71df8cd..7059341d22 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -1975,6 +1975,7 @@ subroutine create_patch(currentSite, new_patch, age, areap, label) allocate(new_patch%fabi(hlm_numSWb)) allocate(new_patch%sabs_dir(hlm_numSWb)) allocate(new_patch%sabs_dif(hlm_numSWb)) + allocate(new_patch%fragmentation_scaler(currentSite%nlevsoil)) ! Litter @@ -2794,6 +2795,7 @@ subroutine dealloc_patch(cpatch) deallocate(cpatch%fabi) deallocate(cpatch%sabs_dir) deallocate(cpatch%sabs_dif) + deallocate(cpatch%fragmentation_scaler) end if diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 7ab48918fc..187c281aac 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2247,7 +2247,7 @@ subroutine fragmentation_scaler( currentPatch, bc_in) ! ! !LOCAL VARIABLES: logical :: use_century_tfunc = .false. - logical :: use_hlm_soil_scalar = .true. ! Use hlm input decomp fraction scalars + logical :: use_hlm_soil_scalar = .false. ! Use hlm input decomp fraction scalars integer :: j integer :: ifp ! Index of a FATES Patch "ifp" real(r8) :: t_scalar ! temperature scalar @@ -2293,7 +2293,6 @@ subroutine fragmentation_scaler( currentPatch, bc_in) w_scalar = sum(currentPatch%btran_ft(1:numpft))/real(numpft,r8) ! Calculate the fragmentation_scaler - allocate(currentPatch%fragmentation_scaler(size(bc_in%t_scalar_sisl))) currentPatch%fragmentation_scaler(:) = min(1.0_r8,max(0.0_r8,t_scalar * w_scalar)) endif From 321ef22e83749c9e306213600bec35b541c3e65f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Wed, 28 Oct 2020 15:23:32 -0700 Subject: [PATCH 10/13] Update biogeochem/EDPhysiologyMod.F90 Adding variable for setting the index of the above ground litter Co-authored-by: jkshuman --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 187c281aac..943f3f4e8f 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2336,7 +2336,7 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) do c = 1,ncwd litt%ag_cwd_frag(c) = litt%ag_cwd(c) * SF_val_max_decomp(c) * & - years_per_day * fragmentation_scaler(1) + years_per_day * fragmentation_scaler(soil_layer_index) do ilyr = 1,nlev_eff_decomp From 54e9102be6c30bcabbeb2f60713fa09a53d3c46d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Wed, 28 Oct 2020 15:23:42 -0700 Subject: [PATCH 11/13] Update biogeochem/EDPhysiologyMod.F90 Adding variable for setting the index of the above ground litter Co-authored-by: jkshuman --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 943f3f4e8f..0317804b8d 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2354,7 +2354,7 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) do dcmpy = 1,ndcmpy litt%leaf_fines_frag(dcmpy) = litt%leaf_fines(dcmpy) * & - years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler(1) + years_per_day * SF_val_max_decomp(dl_sf) * fragmentation_scaler(soil_layer_index) do ilyr = 1,nlev_eff_decomp litt%root_fines_frag(dcmpy,ilyr) = litt%root_fines(dcmpy,ilyr) * & From b1f9b02ab287773ffce767e55faf21eafe9dd3d2 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Wed, 28 Oct 2020 15:25:23 -0700 Subject: [PATCH 12/13] Update biogeochem/EDPhysiologyMod.F90 Update comment to reflect addition of indexing variarble Co-authored-by: jkshuman --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 0317804b8d..3a5cfde47a 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2330,7 +2330,7 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) ! Above ground litters are associated with the top soil layer temperature and - ! moisture scalars and as such the top-layer fragmentation scalar index of 1 + ! moisture scalars and fragmentation scalar associated with specified index value ! is used for ag_cwd_frag and root_fines_frag calculations. do c = 1,ncwd From 19702e3712a47796961b0e854392372e06519d58 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 28 Oct 2020 15:32:59 -0700 Subject: [PATCH 13/13] adding soil_layer_index variable initialization --- biogeochem/EDPhysiologyMod.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 3a5cfde47a..fad5608346 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -2323,9 +2323,10 @@ subroutine CWDOut( litt, fragmentation_scaler, nlev_eff_decomp ) ! ! !LOCAL VARIABLES: - integer :: c - integer :: ilyr - integer :: dcmpy + integer :: c ! Fuel size class index + integer :: ilyr ! Soil layer index + integer :: dcmpy ! Decomposibility pool indexer + integer :: soil_layer_index = 1 ! Soil layer index associated with above ground litter !----------------------------------------------------------------------