From 2bf1d1bb9cbf2d25f8da894aafca984ad0e8aba0 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 1 Apr 2024 10:05:54 -0600 Subject: [PATCH 01/64] added megan_voc_pftindex parameter --- parameter_files/fates_params_default.cdl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index e288664751..fffda96215 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -639,6 +639,9 @@ variables: double fates_woody(fates_pft) ; fates_woody:units = "logical flag" ; fates_woody:long_name = "Binary woody lifeform flag" ; + double fates_voc_pftindex(fates_pft) ; + fates_voc_pftindex: units = "Integer PFT index" + fates_voc_pftindex: long_name = "integer index for MEGAN PFT definitions" ; double fates_hlm_pft_map(fates_hlm_pftno, fates_pft) ; fates_hlm_pft_map:units = "area fraction" ; fates_hlm_pft_map:long_name = "In fixed biogeog mode, fraction of HLM area associated with each FATES PFT" ; @@ -1561,6 +1564,8 @@ data: fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; + fates_voc_pftindex = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; + fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, From 786b27b786a3aefdcdedb72d613cf83242a5db95 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 1 Apr 2024 10:21:33 -0600 Subject: [PATCH 02/64] reading new parameter --- main/EDPftvarcon.F90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 5745141c70..2048b9d76a 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -141,7 +141,8 @@ module EDPftvarcon real(r8), allocatable :: rhos(:, :) ! Stem reflectance; second dim: 1 = vis, 2 = nir real(r8), allocatable :: taul(:, :) ! Leaf transmittance; second dim: 1 = vis, 2 = nir real(r8), allocatable :: taus(:, :) ! Stem transmittance; second dim: 1 = vis, 2 = nir - + integer, allocatable :: voc_pftindex(:) ! Index for MEGAN parameters + ! Fire Parameters (No PFT vector capabilities in their own routines) ! See fire/SFParamsMod.F90 for bulk of fire parameters ! ------------------------------------------------------------------------------------------- @@ -443,6 +444,10 @@ subroutine Register_PFT(this, fates_params) call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & dimension_names=dim_names, lower_bounds=dim_lower_bound) + name = 'fates_voc_pftindex' + call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names, lower_bounds=dim_lower_bound) + name = 'fates_nonhydro_smpso' call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & dimension_names=dim_names, lower_bounds=dim_lower_bound) @@ -884,6 +889,10 @@ subroutine Receive_PFT(this, fates_params) call fates_params%RetrieveParameterAllocate(name=name, & data=this%c3psn) + name = 'fates_voc_pftindex' + call fates_params%RetrieveParameterAllocate(name=name, & + data=this%c3psn) + name = 'fates_nonhydro_smpso' call fates_params%RetrieveParameterAllocate(name=name, & data=this%smpso) @@ -1667,6 +1676,7 @@ subroutine FatesReportPFTParams(is_master) write(fates_log(),fmt0) 'xl = ',EDPftvarcon_inst%xl write(fates_log(),fmt0) 'clumping_index = ',EDPftvarcon_inst%clumping_index write(fates_log(),fmt0) 'c3psn = ',EDPftvarcon_inst%c3psn + write(fates_log(),fmt0) 'voc_pftindex = ',EDPftvarcon_inst%voc_pftindex write(fates_log(),fmt0) 'vcmax25top = ',EDPftvarcon_inst%vcmax25top write(fates_log(),fmt0) 'smpso = ',EDPftvarcon_inst%smpso write(fates_log(),fmt0) 'smpsc = ',EDPftvarcon_inst%smpsc @@ -2122,7 +2132,13 @@ subroutine FatesCheckParams(is_master) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + + if(EDPftvarcon_inst%c3psn(ipft) .le. 0 or DPftvarcon_inst%c3psn(ipft) .gt. 5 ) then + write(fates_log(),*) 'MEGAN indices must be between 1 and 5' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + if( hlm_use_fixed_biogeog .eq. itrue ) then ! check that the host-fates PFT map adds to one along HLM dimension so that all the HLM area ! goes to a FATES PFT. Each FATES PFT can get < or > 1 of an HLM PFT. From a075d763aa7f39018977b1070c15c4fbd96f0542 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 1 Apr 2024 10:33:23 -0600 Subject: [PATCH 03/64] adding interface variable for MEGAN PFT --- biogeochem/EDCanopyStructureMod.F90 | 1 + main/FatesInterfaceMod.F90 | 3 +++ main/FatesInterfaceTypesMod.F90 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 23d851ea92..d971312925 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1976,6 +1976,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label + bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) ! Calculate area indices for output boundary to HLM ! It is assumed that cpatch%canopy_area_profile and cpat%xai_profiles diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 7b5b72ad9e..70f1f412f3 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -389,6 +389,8 @@ subroutine zero_bcs(fates,s) fates%bc_out(s)%z0m_pa(:) = 0.0_r8 fates%bc_out(s)%dleaf_pa(:) = 0.0_r8 fates%bc_out(s)%nocomp_pft_label_pa(:) = 0 + fates%bc_out(s)%nocomp_MEGAN_pft_label_pa(:) = 0 + fates%bc_out(s)%canopy_fraction_pa(:) = 0.0_r8 fates%bc_out(s)%frac_veg_nosno_alb_pa(:) = 0.0_r8 @@ -710,6 +712,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in) allocate(bc_out%frac_veg_nosno_alb_pa(maxpatch_total)) allocate(bc_out%nocomp_pft_label_pa(maxpatch_total)) + allocate(bc_out%nocomp_MEGAN_pft_label_pa(maxpatch_total)) ! Plant-Hydro BC's if (hlm_use_planthydro.eq.itrue) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 6e9779dcac..c713c25550 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -731,6 +731,8 @@ module FatesInterfaceTypesMod integer, allocatable :: nocomp_pft_label_pa(:) ! in nocomp and SP mode, each patch has a PFT identity. + integer, allocatable :: nocomp_MEGAN_pft_label_pa(:) ! Index to map from FATES NOCOMP PFT identity into MEGAN PFT space. + ! FATES Hydraulics From c12e75deca625ea983553948ab91d212266b561c Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 17 Oct 2024 16:10:12 +0200 Subject: [PATCH 04/64] altered PFT map to use the right numbers --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 574e532797..e473916928 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1674,7 +1674,7 @@ data: fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; - fates_voc_pftindex = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; + fates_voc_pftindex = 1, 2, 3, 1, 1, 1, 4, 4, 4, 5, 5, 5 ; fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, From 53e71bc35253f76e09adb6e644eb0e27c1fb639b Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 17 Oct 2024 17:11:51 +0200 Subject: [PATCH 05/64] bunch of minor debugging changes from parallel fire emissions branch --- biogeochem/EDCanopyStructureMod.F90 | 5 +++-- main/EDPftvarcon.F90 | 6 +++--- parameter_files/fates_params_default.cdl | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index deb3e9f366..0b80c10147 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -2001,8 +2001,9 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label - bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) - + if(currentPatch%nocomp_pft_label.gt.0)then + bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) + endif ! Calculate area indices for output boundary to HLM ! It is assumed that cpatch%canopy_area_profile and cpat%xai_profiles ! have been updated (ie ed_leaf_area_profile has been called since dynamics has been called) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 88f3d660d4..add1846b8d 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -147,7 +147,7 @@ module EDPftvarcon real(r8), allocatable :: rhos(:, :) ! Stem reflectance; second dim: 1 = vis, 2 = nir real(r8), allocatable :: taul(:, :) ! Leaf transmittance; second dim: 1 = vis, 2 = nir real(r8), allocatable :: taus(:, :) ! Stem transmittance; second dim: 1 = vis, 2 = nir - integer, allocatable :: voc_pftindex(:) ! Index for MEGAN parameters + real(r8), allocatable :: voc_pftindex(:) ! Index for MEGAN parameters ! Fire Parameters (No PFT vector capabilities in their own routines) ! See fire/SFParamsMod.F90 for bulk of fire parameters @@ -928,7 +928,7 @@ subroutine Receive_PFT(this, fates_params) name = 'fates_voc_pftindex' call fates_params%RetrieveParameterAllocate(name=name, & - data=this%c3psn) + data=this%voc_pftindex) name = 'fates_nonhydro_smpso' call fates_params%RetrieveParameterAllocate(name=name, & @@ -2240,7 +2240,7 @@ subroutine FatesCheckParams(is_master) end if - if(EDPftvarcon_inst%c3psn(ipft) .le. 0 or DPftvarcon_inst%c3psn(ipft) .gt. 5 ) then + if(EDPftvarcon_inst%voc_pftindex(ipft) .le. 0 or EDPftvarcon_inst%voc_pftindex(ipft) .gt. 5 ) then write(fates_log(),*) 'MEGAN indices must be between 1 and 5' call endrun(msg=errMsg(sourcefile, __LINE__)) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index e473916928..df8902f5dd 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -673,7 +673,7 @@ variables: fates_woody:units = "logical flag" ; fates_woody:long_name = "Binary woody lifeform flag" ; double fates_voc_pftindex(fates_pft) ; - fates_voc_pftindex: units = "Integer PFT index" + fates_voc_pftindex: units = "Integer PFT index" ; fates_voc_pftindex: long_name = "integer index for MEGAN PFT definitions" ; double fates_hlm_pft_map(fates_hlm_pftno, fates_pft) ; fates_hlm_pft_map:units = "area fraction" ; @@ -1675,7 +1675,7 @@ data: fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; fates_voc_pftindex = 1, 2, 3, 1, 1, 1, 4, 4, 4, 5, 5, 5 ; - + fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, From fa46a845e1453ead436a78063896125239da4c1d Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 17 Oct 2024 17:19:59 +0200 Subject: [PATCH 06/64] error in bounds check statement --- main/EDPftvarcon.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index add1846b8d..43335cf1f0 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -2240,7 +2240,7 @@ subroutine FatesCheckParams(is_master) end if - if(EDPftvarcon_inst%voc_pftindex(ipft) .le. 0 or EDPftvarcon_inst%voc_pftindex(ipft) .gt. 5 ) then + if(EDPftvarcon_inst%voc_pftindex(ipft) .le. 0 .or. EDPftvarcon_inst%voc_pftindex(ipft) .gt. 5 ) then write(fates_log(),*) 'MEGAN indices must be between 1 and 5' call endrun(msg=errMsg(sourcefile, __LINE__)) From c8d76025a64ea89147e349f99969a59ef8930d53 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 18 Oct 2024 02:16:45 -0600 Subject: [PATCH 07/64] correct the parameter file --- parameter_files/fates_params_default.cdl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index df8902f5dd..7c260bf151 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1672,9 +1672,9 @@ data: fates_wood_density = 0.548327, 0.44235, 0.454845, 0.754336, 0.548327, 0.566452, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7 ; - fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; + fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; - fates_voc_pftindex = 1, 2, 3, 1, 1, 1, 4, 4, 4, 5, 5, 5 ; + fates_voc_pftindex = 1, 2, 3, 1, 1, 1, 4, 4, 4, 5, 5, 5 , 5, 5 ; fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, From d58f9ac51b670ec737438c0b0d20a87b28b1a681 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 28 Oct 2024 01:53:45 -0600 Subject: [PATCH 08/64] adjusted parameter map to point at HLM parameters --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 7c260bf151..90a2e3f3cb 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1674,7 +1674,7 @@ data: fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; - fates_voc_pftindex = 1, 2, 3, 1, 1, 1, 4, 4, 4, 5, 5, 5 , 5, 5 ; + fates_voc_pftindex = 4, 1, 3, 5, 6, 7, 9, 10, 10, 9, 11, 12, 13, 14 ; fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, From 42f89537355e4606b9d29f412b3473794324e9e0 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 28 Oct 2024 01:58:35 -0600 Subject: [PATCH 09/64] add megan indices for bare ground and no canopy patches --- biogeochem/EDCanopyStructureMod.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 0b80c10147..d41a4b98b4 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1977,6 +1977,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%z0m_pa(ifp) = EDPftvarcon_inst%z0mr(1) * bc_out(s)%htop_pa(ifp) bc_out(s)%displa_pa(ifp) = EDPftvarcon_inst%displar(1) * bc_out(s)%htop_pa(ifp) bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1) + bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 endif ! ----------------------------------------------------------------------------- @@ -2001,9 +2002,13 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label + if(currentPatch%nocomp_pft_label.gt.0)then bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) - endif + else + bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 ! dummy for bare ground. + endif + ! Calculate area indices for output boundary to HLM ! It is assumed that cpatch%canopy_area_profile and cpat%xai_profiles ! have been updated (ie ed_leaf_area_profile has been called since dynamics has been called) From 14581667795f9a05c8175c6243012df580d05edc Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 28 Oct 2024 02:15:03 -0600 Subject: [PATCH 10/64] changes bounds of check on VOC index --- main/EDPftvarcon.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 43335cf1f0..07c7922751 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -2239,10 +2239,9 @@ subroutine FatesCheckParams(is_master) call endrun(msg=errMsg(sourcefile, __LINE__)) end if - - if(EDPftvarcon_inst%voc_pftindex(ipft) .le. 0 .or. EDPftvarcon_inst%voc_pftindex(ipft) .gt. 5 ) then - - write(fates_log(),*) 'MEGAN indices must be between 1 and 5' + write(*,*) EDPftvarcon_inst%voc_pftindex(:) + if(EDPftvarcon_inst%voc_pftindex(ipft) .le. 0 .or. EDPftvarcon_inst%voc_pftindex(ipft) .gt. 16 ) then + write(fates_log(),*) 'MEGAN indices must be between 1 and 16',ipft,EDPftvarcon_inst%voc_pftindex(ipft) call endrun(msg=errMsg(sourcefile, __LINE__)) endif From efc50985994512b95c9a025cd813a785d934e053 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 28 Oct 2024 02:41:31 -0600 Subject: [PATCH 11/64] making the bc_out ci variable --- main/FatesInterfaceMod.F90 | 2 ++ main/FatesInterfaceTypesMod.F90 | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 5506c2a744..7e2e017d87 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -325,6 +325,7 @@ subroutine zero_bcs(fates,s) ! Output boundaries fates%bc_out(s)%active_suction_sl(:) = .false. fates%bc_out(s)%fsun_pa(:) = 0.0_r8 + fates%bc_out(s)%ci_pa(:) = 0.0_r8 fates%bc_out(s)%laisun_pa(:) = 0.0_r8 fates%bc_out(s)%laisha_pa(:) = 0.0_r8 fates%bc_out(s)%rootr_pasl(:,:) = 0.0_r8 @@ -607,6 +608,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in) ! Radiation allocate(bc_out%fsun_pa(maxpatch_total)) + allocate(bc_out%ci_pa(maxpatch_total)) allocate(bc_out%laisun_pa(maxpatch_total)) allocate(bc_out%laisha_pa(maxpatch_total)) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 9875783dce..0b84d89605 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -600,6 +600,10 @@ module FatesInterfaceTypesMod ! Shaded canopy LAI real(r8),allocatable :: laisha_pa(:) + + ! Average internal CO2 concentration + real(r8), allocatable :: ci_pa(:) + ! Logical stating whether a soil layer can have water uptake by plants ! The only condition right now is that liquid water exists From 63021eae385ffcd8b2f80f8bf7f3ab44591fd1ca Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 28 Oct 2024 08:50:21 -0600 Subject: [PATCH 12/64] internal co2 variable construction --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index b37e3630a0..5f4e4a4eff 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -23,6 +23,7 @@ module FATESPlantRespPhotosynthMod use FatesGlobals, only : endrun => fates_endrun use FatesGlobals, only : fates_log use FatesGlobals, only : FatesWarn,N2S,A2S,I2S + use FatesInterfaceTypesMod , only : hlm_use_nocomp use FatesConstantsMod, only : r8 => fates_r8 use FatesConstantsMod, only : itrue use FatesConstantsMod, only : nearzero @@ -193,6 +194,9 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! net leaf photosynthesis averaged over sun and shade leaves. [umol CO2/m**2/s] real(r8) :: anet_av_z(nlevleaf,maxpft,nclmax) + ! internal leaf Co2 memory variable (for passing into MEGAN) Pa + real(r8) :: internal_co2_z(nlevleaf,maxpft,nclmax) + ! Photosynthesis [umol /m2 /s] real(r8) :: psn_z(nlevleaf,maxpft,nclmax) @@ -355,9 +359,10 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! --------------------------------------------------------------------------- bc_out(s)%rssun_pa(ifp) = 0._r8 bc_out(s)%rssha_pa(ifp) = 0._r8 - - psn_z(:,:,:) = 0._r8 + bc_out(s)%ci_pa(ifp) = 0._r8 + psn_z(:,:,:) = 0._r8 + !internal_co2_z(:,:,:) = 0._r8 g_sb_leaves = 0._r8 patch_la = 0._r8 @@ -731,6 +736,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) psn_z(iv,ft,cl), & ! out rs_z(iv,ft,cl), & ! out anet_av_z(iv,ft,cl), & ! out + internal_co2_z(iv,ft,cl), & ! out c13disc_z(cl,ft,iv)) ! out rate_mask_z(iv,ft,cl) = .true. @@ -1080,7 +1086,13 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! when it comes time to calculate a flux rate per unit ground bc_out(s)%rssun_pa(ifp) = r_stomata bc_out(s)%rssha_pa(ifp) = r_stomata - + + if(hlm_use_nocomp)then + bc_out(s)%ci_pa(ifp) = internal_co2_z(1,currentpatch%nocomp_pft_label,1) + else + bc_out(s)%ci_pa(ifp) = -999 + endif + ! This value is used for diagnostics, the molar form of conductance ! is what is used in the field usually, so we track that form currentPatch%c_stomata = cf / r_stomata @@ -1204,6 +1216,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in psn_out, & ! out rstoma_out, & ! out anet_av_out, & ! out + internal_co2_out, & ! out c13disc_z) ! out @@ -1263,6 +1276,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in real(r8), intent(out) :: rstoma_out ! stomatal resistance (1/gs_lsl) (s/m) real(r8), intent(out) :: anet_av_out ! net leaf photosynthesis (umol CO2/m**2/s) ! averaged over sun and shade leaves. + real(r8), intent(out) :: internal_co2_out ! internal co2 diagnostic (Pa) real(r8), intent(out) :: c13disc_z ! carbon 13 in newly assimilated carbon @@ -1354,6 +1368,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in anet_av_out = -lmr psn_out = 0._r8 + internal_co2_out = init_co2_inter_c ! The cuticular conductance already factored in maximum resistance as a bound ! no need to re-bound it @@ -1372,6 +1387,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in psn_out = 0._r8 ! psn is accumulated across sun and shaded leaves. rstoma_out = 0._r8 ! 1/rs is accumulated across sun and shaded leaves. anet_av_out = 0._r8 + internal_co2_out = 0._r8 gstoma = 0._r8 do sunsha = 1,2 @@ -1599,10 +1615,12 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in if(sunsha == 1)then !sunlit psn_out = psn_out + agross * f_sun_lsl anet_av_out = anet_av_out + anet * f_sun_lsl + internal_co2_out = internal_co2_out + co2_inter_c * f_sun_lsl gstoma = gstoma + 1._r8/(min(1._r8/gs, rsmax0)) * f_sun_lsl else psn_out = psn_out + agross * (1.0_r8-f_sun_lsl) anet_av_out = anet_av_out + anet * (1.0_r8-f_sun_lsl) + internal_co2_out = internal_co2_out + co2_inter_c * (1.0_r8 -f_sun_lsl) gstoma = gstoma + & 1._r8/(min(1._r8/gs, rsmax0)) * (1.0_r8-f_sun_lsl) end if @@ -1648,7 +1666,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in psn_out = 0._r8 anet_av_out = 0._r8 - + internal_co2_out = 0._r8 rstoma_out = min(rsmax0,cf/(stem_cuticle_loss_frac*stomatal_intercept(ft))) c13disc_z = 0.0_r8 From e5cd91bb7e17e98fc1f6c09e5af844dd4c05efe8 Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Thu, 19 Sep 2024 10:59:02 +0200 Subject: [PATCH 13/64] merge conflicts on pftvarcon file --- main/EDPftvarcon.F90 | 12 ++++++++++++ parameter_files/fates_params_default.cdl | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 07c7922751..84f204d67c 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -287,6 +287,9 @@ module EDPftvarcon real(r8), allocatable :: landusechange_frac_exported(:) ! fraction of land use change-generated wood material that is exported to wood product (the remainder is either burned or goes to litter) real(r8), allocatable :: landusechange_pprod10(:) ! fraction of land use change wood product that goes to 10-year product pool (remainder goes to 100-year pool) + real(r8), allocatable :: wesley_pft_index_fordrydep + + contains procedure, public :: Init => EDpftconInit procedure, public :: Register @@ -828,6 +831,10 @@ subroutine Register_PFT(this, fates_params) call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & dimension_names=dim_names, lower_bounds=dim_lower_bound) + name = 'fates_wesley_pft_index_fordrydep' + call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names, lower_bounds=dim_lower_bound) + ! adding the hlm_pft_map variable with two dimensions - FATES PFTno and HLM PFTno pftmap_dim_names(1) = dimension_name_pft pftmap_dim_names(2) = dimension_name_hlm_pftno @@ -1292,6 +1299,10 @@ subroutine Receive_PFT(this, fates_params) call fates_params%RetrieveParameterAllocate(name=name, & data=this%eca_lambda_ptase) + name = 'fates_wesley_pft_index_fordrydep' + call fates_params%RetrieveParameterAllocate(name=name, & + data=this%wesley_pft_index_fordrydep) + name = 'fates_hlm_pft_map' call fates_params%RetrieveParameterAllocate(name=name, & data=this%hlm_pft_map) @@ -1805,6 +1816,7 @@ subroutine FatesReportPFTParams(is_master) write(fates_log(),fmt0) 'hydro_pinot_node = ',EDPftvarcon_inst%hydr_pinot_node write(fates_log(),fmt0) 'hydro_kmax_node = ',EDPftvarcon_inst%hydr_kmax_node write(fates_log(),fmt0) 'hlm_pft_map = ', EDPftvarcon_inst%hlm_pft_map + write(fates_log(),fmt0) 'wesley_pft_index_fordrydep = ', EDPftvarcon_inst%wesley_pft_index_fordrydep write(fates_log(),fmt0) 'hydro_vg_alpha_node = ',EDPftvarcon_inst%hydr_vg_alpha_node write(fates_log(),fmt0) 'hydro_vg_m_node = ',EDPftvarcon_inst%hydr_vg_m_node write(fates_log(),fmt0) 'hydro_vg_n_node = ',EDPftvarcon_inst%hydr_vg_n_node diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 90a2e3f3cb..d51253bf95 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -678,6 +678,9 @@ variables: double fates_hlm_pft_map(fates_hlm_pftno, fates_pft) ; fates_hlm_pft_map:units = "area fraction" ; fates_hlm_pft_map:long_name = "In fixed biogeog mode, fraction of HLM area associated with each FATES PFT" ; + double fates_wesley_pft_index_fordrydep(fates_pft) ; + fates_wesley_pft_index_fordrydep:units = 'integer index' + fates_wesley_pft_index_fordrydep:long_name = "index to map from fates pfts into the wesley pft space used to determing dry deposition veolcity. double fates_fire_FBD(fates_litterclass) ; fates_fire_FBD:units = "kg Biomass/m3" ; fates_fire_FBD:long_name = "fuel bulk density" ; @@ -1692,6 +1695,8 @@ data: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ; + fates_wesley_pft_index_fordrydep = 1, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12 ; + fates_fire_FBD = 15.4, 16.8, 19.6, 999, 4, 4 ; fates_fire_low_moisture_Coeff = 1.12, 1.09, 0.98, 0.8, 1.15, 1.15 ; From ed1c87da963b08c005271391d3c12a7fb29bc165 Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Thu, 19 Sep 2024 11:21:00 +0200 Subject: [PATCH 14/64] merge conflicts in main/FatesInterfaceMod.F90 --- main/FatesInterfaceMod.F90 | 4 ++-- main/FatesInterfaceTypesMod.F90 | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 7e2e017d87..1f5d706650 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -393,8 +393,7 @@ subroutine zero_bcs(fates,s) fates%bc_out(s)%dleaf_pa(:) = 0.0_r8 fates%bc_out(s)%nocomp_pft_label_pa(:) = 0 fates%bc_out(s)%nocomp_MEGAN_pft_label_pa(:) = 0 - - + fates%bc_out(s)%wesley_pft_label_pa(:) = 0 fates%bc_out(s)%canopy_fraction_pa(:) = 0.0_r8 fates%bc_out(s)%frac_veg_nosno_alb_pa(:) = 0.0_r8 @@ -723,6 +722,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in) allocate(bc_out%nocomp_pft_label_pa(maxpatch_total)) allocate(bc_out%nocomp_MEGAN_pft_label_pa(maxpatch_total)) + allocate(bc_out%wesley_pft_label_pa(maxpatch_total)) ! Plant-Hydro BC's if (hlm_use_planthydro.eq.itrue) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 0b84d89605..61ee49d428 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -753,6 +753,8 @@ module FatesInterfaceTypesMod ! [0,1] integer, allocatable :: nocomp_pft_label_pa(:) ! in nocomp and SP mode, each patch has a PFT identity. + integer, allocatable :: wesley_pft_label_pa(:) ! For dry deposition, each FATES PFT needs to correspond to a PFT from the 'wesley 1989' scheme + integer, allocatable :: nocomp_MEGAN_pft_label_pa(:) ! Index to map from FATES NOCOMP PFT identity into MEGAN PFT space. From 0923df3ffb297662ed2b2b35aed5f19afd9c8402 Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Thu, 19 Sep 2024 11:58:43 +0200 Subject: [PATCH 15/64] set the boundary conditions --- biogeochem/EDCanopyStructureMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index d41a4b98b4..a27c39ca8f 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -2002,6 +2002,8 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label + bc_out(s)%wesley_pft_label_pa(ifp) = currentPatch%EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) + if(currentPatch%nocomp_pft_label.gt.0)then bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) From 9e86f45db156cc13ad241c3af12afb2c86114773 Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Thu, 19 Sep 2024 16:12:53 +0200 Subject: [PATCH 16/64] more merge conflicts in main/EDPftvarcon.F90 --- biogeochem/EDCanopyStructureMod.F90 | 4 ++-- main/EDPftvarcon.F90 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index a27c39ca8f..f6da0b88ed 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -2002,8 +2002,8 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label - bc_out(s)%wesley_pft_label_pa(ifp) = currentPatch%EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) - + bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) + bc_out(s)%drydep_season_pa(ifp) = currentPatch%drydep_season if(currentPatch%nocomp_pft_label.gt.0)then bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 84f204d67c..794d628f67 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -287,7 +287,7 @@ module EDPftvarcon real(r8), allocatable :: landusechange_frac_exported(:) ! fraction of land use change-generated wood material that is exported to wood product (the remainder is either burned or goes to litter) real(r8), allocatable :: landusechange_pprod10(:) ! fraction of land use change wood product that goes to 10-year product pool (remainder goes to 100-year pool) - real(r8), allocatable :: wesley_pft_index_fordrydep + real(r8), allocatable :: wesley_pft_index_fordrydep(:) contains From 6ed133e7b880fc39563e4f16bd918c2cd5e652a4 Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Fri, 20 Sep 2024 10:12:26 +0200 Subject: [PATCH 17/64] more merge conflicts in biogeochem/FatesPatchMod.F90 --- biogeochem/EDCanopyStructureMod.F90 | 3 +++ biogeochem/FatesPatchMod.F90 | 3 +++ main/EDTypesMod.F90 | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index f6da0b88ed..cf31eb66fd 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -2003,6 +2003,9 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) + ! THIS IS A PLACEHOLDE + currentPatch%drydep_season = 1 + bc_out(s)%drydep_season_pa(ifp) = currentPatch%drydep_season if(currentPatch%nocomp_pft_label.gt.0)then diff --git a/biogeochem/FatesPatchMod.F90 b/biogeochem/FatesPatchMod.F90 index 999bd73228..34ea6faf01 100644 --- a/biogeochem/FatesPatchMod.F90 +++ b/biogeochem/FatesPatchMod.F90 @@ -69,6 +69,7 @@ module FatesPatchMod integer :: land_use_label ! patch label for land use classification (primaryland, secondaryland, etc) real(r8) :: age_since_anthro_disturbance ! average age for secondary forest since last anthropogenic disturbance [years] logical :: changed_landuse_this_ts ! logical flag to track patches that have just undergone land use change [only used with nocomp and land use change] + integer :: drydep_season ! marker for the season according to the dry deposition code definitions. !--------------------------------------------------------------------------- @@ -447,6 +448,7 @@ subroutine NanValues(this) this%age_class = fates_unset_int this%area = nan this%countcohorts = fates_unset_int + this%drydep_season = fates_unset_int this%ncl_p = fates_unset_int this%land_use_label = fates_unset_int this%age_since_anthro_disturbance = nan @@ -949,6 +951,7 @@ subroutine Dump(this) write(fates_log(),*) 'pa%age_class = ',this%age_class write(fates_log(),*) 'pa%area = ',this%area write(fates_log(),*) 'pa%countcohorts = ',this%countcohorts + write(fates_log(),*) 'pa%drydep_season = ',this%drydep_season write(fates_log(),*) 'pa%ncl_p = ',this%ncl_p write(fates_log(),*) 'pa%total_canopy_area = ',this%total_canopy_area write(fates_log(),*) 'pa%total_tree_area = ',this%total_tree_area diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 10ef14734c..efeeefc047 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -1,4 +1,4 @@ -module EDTypesMod +smodule EDTypesMod use FatesConstantsMod, only : r8 => fates_r8 use FatesGlobals, only : endrun => fates_endrun From 18d5f12e0dffb254220fa8589a8127e9dfe6fe3f Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Fri, 20 Sep 2024 23:34:47 +0200 Subject: [PATCH 18/64] add drydep_season_pa to the fates interface, plus bugfixes --- main/EDTypesMod.F90 | 2 +- main/FatesInterfaceMod.F90 | 2 ++ main/FatesInterfaceTypesMod.F90 | 2 +- parameter_files/fates_params_default.cdl | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index efeeefc047..10ef14734c 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -1,4 +1,4 @@ -smodule EDTypesMod +module EDTypesMod use FatesConstantsMod, only : r8 => fates_r8 use FatesGlobals, only : endrun => fates_endrun diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 1f5d706650..27145d803f 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -394,6 +394,7 @@ subroutine zero_bcs(fates,s) fates%bc_out(s)%nocomp_pft_label_pa(:) = 0 fates%bc_out(s)%nocomp_MEGAN_pft_label_pa(:) = 0 fates%bc_out(s)%wesley_pft_label_pa(:) = 0 + fates%bc_out(s)%drydep_season_pa(:) = 0 fates%bc_out(s)%canopy_fraction_pa(:) = 0.0_r8 fates%bc_out(s)%frac_veg_nosno_alb_pa(:) = 0.0_r8 @@ -723,6 +724,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in) allocate(bc_out%nocomp_pft_label_pa(maxpatch_total)) allocate(bc_out%nocomp_MEGAN_pft_label_pa(maxpatch_total)) allocate(bc_out%wesley_pft_label_pa(maxpatch_total)) + allocate(bc_out%drydep_season_pa(maxpatch_total)) ! Plant-Hydro BC's if (hlm_use_planthydro.eq.itrue) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 61ee49d428..e9ee32686a 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -754,7 +754,7 @@ module FatesInterfaceTypesMod integer, allocatable :: nocomp_pft_label_pa(:) ! in nocomp and SP mode, each patch has a PFT identity. integer, allocatable :: wesley_pft_label_pa(:) ! For dry deposition, each FATES PFT needs to correspond to a PFT from the 'wesley 1989' scheme - + integer, allocatable :: drydep_season_pa(:) ! For dry deposition, we need to define the season index, from 1-5, for the purposes of detrmining the deposition velocity parameters. See drydep code for details of season indices. integer, allocatable :: nocomp_MEGAN_pft_label_pa(:) ! Index to map from FATES NOCOMP PFT identity into MEGAN PFT space. diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index d51253bf95..63776f8e58 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -679,8 +679,8 @@ variables: fates_hlm_pft_map:units = "area fraction" ; fates_hlm_pft_map:long_name = "In fixed biogeog mode, fraction of HLM area associated with each FATES PFT" ; double fates_wesley_pft_index_fordrydep(fates_pft) ; - fates_wesley_pft_index_fordrydep:units = 'integer index' - fates_wesley_pft_index_fordrydep:long_name = "index to map from fates pfts into the wesley pft space used to determing dry deposition veolcity. + fates_wesley_pft_index_fordrydep:units = "integer index"; + fates_wesley_pft_index_fordrydep:long_name = "index to map from fates pfts into the wesley pft space used to determing dry deposition veolcity." ; double fates_fire_FBD(fates_litterclass) ; fates_fire_FBD:units = "kg Biomass/m3" ; fates_fire_FBD:long_name = "fuel bulk density" ; From 1972039b49c2f96eedb968dd26e76af7274a852f Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Thu, 3 Oct 2024 14:50:26 +0200 Subject: [PATCH 19/64] add new mapping for Wesley PFTs --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 63776f8e58..8337d5f9f8 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1695,7 +1695,7 @@ data: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ; - fates_wesley_pft_index_fordrydep = 1, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12 ; + fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11 ,3, 3, 3 ; fates_fire_FBD = 15.4, 16.8, 19.6, 999, 4, 4 ; From 1cbf1767ba3180b8fd7f09a28d5a26add88c85b4 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 10 Oct 2024 14:08:37 +0200 Subject: [PATCH 20/64] add initial value for drydep_season --- biogeochem/FatesPatchMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/biogeochem/FatesPatchMod.F90 b/biogeochem/FatesPatchMod.F90 index 34ea6faf01..af47c89372 100644 --- a/biogeochem/FatesPatchMod.F90 +++ b/biogeochem/FatesPatchMod.F90 @@ -757,7 +757,8 @@ subroutine Create(this, age, area, land_use_label, nocomp_pft, num_swb, num_pft, this%age_since_anthro_disturbance = fates_unset_r8 endif this%nocomp_pft_label = nocomp_pft - + this%drydep_season = 1 ! initialize season at summer time. + this%tr_soil_dir(:) = 1.0_r8 this%tr_soil_dif(:) = 1.0_r8 this%NCL_p = 1 From d91166081e23bd69e490b93f06537dc2ec9fafa2 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 11 Oct 2024 17:16:03 +0200 Subject: [PATCH 21/64] modifictions to EDCanopyStructure to update drydep properties for all patches --- biogeochem/EDCanopyStructureMod.F90 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index cf31eb66fd..08c95e4b0f 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1894,7 +1894,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) real(r8) :: total_canopy_area real(r8) :: total_patch_leaf_stem_area real(r8) :: weight ! Weighting for cohort variables in patch - + do s = 1,nsites ifp = 0 @@ -1904,7 +1904,8 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%dleaf_pa(:) = 0._r8 bc_out(s)%z0m_pa(:) = 0._r8 bc_out(s)%displa_pa(:) = 0._r8 - + bc_out(s)%drydep_season_pa(:) = 0 + bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. currentPatch => sites(s)%oldest_patch c = fcolumn(s) do while(associated(currentPatch)) @@ -1979,6 +1980,13 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1) bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 endif + + bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) + + ! THIS IS A PLACEHOLDER + currentPatch%drydep_season = 1 + bc_out(s)%drydep_season_pa(ifp) = 4 + ! ----------------------------------------------------------------------------- ! We are assuming here that grass is all located underneath tree canopies. @@ -2001,12 +2009,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) - bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label - bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) - ! THIS IS A PLACEHOLDE - currentPatch%drydep_season = 1 - - bc_out(s)%drydep_season_pa(ifp) = currentPatch%drydep_season if(currentPatch%nocomp_pft_label.gt.0)then bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) @@ -2066,8 +2068,9 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! for vegetated patches only ifp = ifp+1 bc_out(s)%canopy_fraction_pa(ifp) = bc_out(s)%canopy_fraction_pa(ifp)/total_patch_area - endif ! veg patch - + bc_out(s)%wesley_pft_label_pa(ifp)=8 + bc_out(s)%drydep_season_pa(ifp)=4 !winter season where there is bare ground + endif ! veg patch currentPatch => currentPatch%younger end do @@ -2087,7 +2090,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) ! Pass FATES Harvested C to bc_out. call UpdateHarvestC(sites(s),bc_out(s)) - end do ! This call to RecruitWaterStorage() makes an accounting of From cd793edc07bb5a090d73818a937c9ebe535e0be6 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 11 Oct 2024 17:23:11 +0200 Subject: [PATCH 22/64] parameter file change --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 8337d5f9f8..4a3cf0be5d 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1695,7 +1695,7 @@ data: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ; - fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11 ,3, 3, 3 ; + fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11 ,3, 3, 3, 3, 3; fates_fire_FBD = 15.4, 16.8, 19.6, 999, 4, 4 ; From b52edcfed5a6673f969769c17142dbd073804bb9 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 16 Oct 2024 08:39:44 +0200 Subject: [PATCH 23/64] merge conflicts in biogeochem/FatesPatchMod.F90 --- biogeochem/FatesPatchMod.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/biogeochem/FatesPatchMod.F90 b/biogeochem/FatesPatchMod.F90 index af47c89372..05dfa6e2c7 100644 --- a/biogeochem/FatesPatchMod.F90 +++ b/biogeochem/FatesPatchMod.F90 @@ -69,7 +69,8 @@ module FatesPatchMod integer :: land_use_label ! patch label for land use classification (primaryland, secondaryland, etc) real(r8) :: age_since_anthro_disturbance ! average age for secondary forest since last anthropogenic disturbance [years] logical :: changed_landuse_this_ts ! logical flag to track patches that have just undergone land use change [only used with nocomp and land use change] - integer :: drydep_season ! marker for the season according to the dry deposition code definitions. + + !--------------------------------------------------------------------------- @@ -448,7 +449,6 @@ subroutine NanValues(this) this%age_class = fates_unset_int this%area = nan this%countcohorts = fates_unset_int - this%drydep_season = fates_unset_int this%ncl_p = fates_unset_int this%land_use_label = fates_unset_int this%age_since_anthro_disturbance = nan @@ -757,7 +757,6 @@ subroutine Create(this, age, area, land_use_label, nocomp_pft, num_swb, num_pft, this%age_since_anthro_disturbance = fates_unset_r8 endif this%nocomp_pft_label = nocomp_pft - this%drydep_season = 1 ! initialize season at summer time. this%tr_soil_dir(:) = 1.0_r8 this%tr_soil_dif(:) = 1.0_r8 @@ -952,7 +951,6 @@ subroutine Dump(this) write(fates_log(),*) 'pa%age_class = ',this%age_class write(fates_log(),*) 'pa%area = ',this%area write(fates_log(),*) 'pa%countcohorts = ',this%countcohorts - write(fates_log(),*) 'pa%drydep_season = ',this%drydep_season write(fates_log(),*) 'pa%ncl_p = ',this%ncl_p write(fates_log(),*) 'pa%total_canopy_area = ',this%total_canopy_area write(fates_log(),*) 'pa%total_tree_area = ',this%total_tree_area From 9e049a5fd533386ceab4efcb1896e037d7a588a9 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 27 Nov 2024 14:10:50 +0100 Subject: [PATCH 24/64] added calculation of drydep season into FATES --- biogeochem/EDCanopyStructureMod.F90 | 43 +++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 08c95e4b0f..4995b5d0ac 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1877,7 +1877,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) use EDTypesMod , only : ed_site_type, AREA use FatesPatchMod, only : fates_patch_type use FatesInterfaceTypesMod , only : bc_out_type - + use FatesInterfaceTypesMod , only : hlm_day_of_year ! ! !ARGUMENTS integer, intent(in) :: nsites @@ -1981,12 +1981,45 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 endif + ! Set patch properties for the HLM dry depositioin model + ! This wants to know the PFT according to the 'wesley' classification scheme + ! and the season according to the same scheme. bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) - - ! THIS IS A PLACEHOLDER - currentPatch%drydep_season = 1 - bc_out(s)%drydep_season_pa(ifp) = 4 + !wesely seasonal "index_season" + ! 1 - midsummer with lush vegetation + ! 2 - Autumn with unharvested cropland + ! 3 - Late autumn after frost, no snow + ! 4 - Winter, snow on ground and subfreezing + ! 5 - Transitional spring with partially green short annuals + if(bc_out(s)%tlai_pa(ifp) .gt. 2.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 1 ! Summer, or something like it. + else ! NOT SUMMER + if(sites(s)%lat>0)then ! Northern HS + if(hlm_day_of_year .lt. 180)then ! DOY + bc_out(s)%drydep_season_pa(ifp) = 5 ! NH spring + else ! autumn + if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 2 ! NH early autumn + else + bc_out(s)%drydep_season_pa(ifp) = 3 ! NH late autumn + endif + endif ! DOY + else !Southern HS + if(hlm_day_of_year .gt. 180)then ! spring + bc_out(s)%drydep_season_pa(ifp) = 5 ! SH spring + else ! SH autumn + if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 2 ! SH early autumn + else + bc_out(s)%drydep_season_pa(ifp) = 3 ! SH late autumn + endif ! autumn + endif ! DOY + endif ! Hemisphere + endif ! summer? + + + ! ----------------------------------------------------------------------------- ! We are assuming here that grass is all located underneath tree canopies. From 96c14dceb7ed714c3912e4241841385f427db4ab Mon Sep 17 00:00:00 2001 From: Rosie Fisher Date: Fri, 31 Jan 2025 12:22:07 +0100 Subject: [PATCH 25/64] Update z0mr parameters to CLM5vdefault values and add temporary increase to fluxes for BETs --- parameter_files/fates_params_default.cdl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 4a3cf0be5d..e1d6f9b905 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1371,16 +1371,16 @@ data: fates_leaf_slatop = 0.012, 0.005, 0.024, 0.009, 0.03, 0.03, 0.012, 0.03, 0.03, 0.01, 0.032, 0.027, 0.05, 0.05 ; - fates_leaf_stomatal_intercept = 10000, 10000, 10000, 10000, 10000, 10000, + fates_leaf_stomatal_intercept = 50000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 40000 ; - fates_leaf_stomatal_slope_ballberry = 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; + fates_leaf_stomatal_slope_ballberry = 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; fates_leaf_stomatal_slope_medlyn = 4.1, 2.3, 2.3, 4.1, 4.4, 4.4, 4.7, 4.7, 4.7, 4.7, 4.7, 2.2, 5.3, 1.6 ; fates_leaf_vcmax25top = - 50, 62, 39, 61, 58, 58, 62, 54, 54, 38, 54, 86, 78, 78 ; + 60, 62, 39, 61, 58, 58, 62, 54, 54, 38, 54, 86, 78, 78 ; fates_leaf_vcmaxha = 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330 ; @@ -1656,8 +1656,8 @@ data: fates_turb_leaf_diameter = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04 ; - fates_turb_z0mr = 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, - 0.055, 0.055, 0.055, 0.055, 0.055, 0.055 ; + fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, + 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0 ; From 883537bd0d18c24e267ac2ca1cf3bb8bfd09faea Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 25 Feb 2025 10:56:14 +0100 Subject: [PATCH 26/64] fix logical for ci --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index 5f4e4a4eff..270621969e 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -1087,7 +1087,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) bc_out(s)%rssun_pa(ifp) = r_stomata bc_out(s)%rssha_pa(ifp) = r_stomata - if(hlm_use_nocomp)then + if(hlm_use_nocomp .eq. itrue)then bc_out(s)%ci_pa(ifp) = internal_co2_z(1,currentpatch%nocomp_pft_label,1) else bc_out(s)%ci_pa(ifp) = -999 From 5c1692a7a792be344875aef664b728f6dc7c679d Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Fri, 14 Mar 2025 11:08:58 +0100 Subject: [PATCH 27/64] add drydep control to the insteface --- main/FatesInterfaceMod.F90 | 6 ++++++ main/FatesInterfaceTypesMod.F90 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 27145d803f..15c9036302 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -1920,6 +1920,12 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) write(fates_log(),*) 'Transfering hlm_use_sp= ',ival,' to FATES' end if + case('use_drydep') + hlm_use_drydep = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_use_drydep= ',ival,' to FATES' + end if + case('use_planthydro') hlm_use_planthydro = ival if (fates_global_verbose()) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index e9ee32686a..f5c5a60ed3 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -199,6 +199,8 @@ module FatesInterfaceTypesMod integer, public :: hlm_use_sp ! Flag to use FATES satellite phenology (LAI) mode ! 1 = TRUE, 0 = FALSE + integer, public :: hlm_use_drydep ! Flag to use calculate drydep-related variables in FATES + ! 1 = TRUE, 0 = FALSE ! Flag specifying what types of history fields to allocate and prepare From 72823e240cd5debbd84e7b79e4be3ca803388a0d Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 14 Mar 2025 21:45:48 +0100 Subject: [PATCH 28/64] add set_fates_drydep_indices to FatesInterfaceMod --- main/FatesInterfaceMod.F90 | 55 +++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 15c9036302..e2ce69c2f8 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -179,7 +179,8 @@ module FatesInterfaceMod public :: set_bcs public :: UpdateFatesRMeansTStep public :: InitTimeAveragingGlobals - + public :: set_fates_drydep_indices + private :: FatesReadParameters public :: DetermineGridCellNeighbors @@ -2210,6 +2211,58 @@ end subroutine UpdateFatesRMeansTStep ! ======================================================================================== +subroutine set_fates_drydep_indices(nsites,sites,fcolumn,bc_out) + + type(bc_out_type), intent(inout) :: bc_out(nsites) + integer :: s, ifp, c, p + type (fates_patch_type) , pointer :: currentPatch + + do s = 1,nsites + bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. + currentPatch => sites(s)%oldest_patch + c = fcolumn(s) + do while(associated(currentPatch) + bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) + + ! Wesely seasonal "index_season" + ! 1 - midsummer with lush vegetation + ! 2 - Autumn with unharvested cropland + ! 3 - Late autumn after frost, no snow + ! 4 - Winter, snow on ground and subfreezing + ! 5 - Transitional spring with partially green short annuals + if(bc_out(s)%tlai_pa(ifp) .gt. 2.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 1 ! Summer, or something like it. + else ! NOT SUMMER + if(sites(s)%lat>0)then ! Northern HS + if(hlm_day_of_year .lt. 180)then ! DOY + bc_out(s)%drydep_season_pa(ifp) = 5 ! NH spring + else ! autumn + if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 2 ! NH early autumn + else + bc_out(s)%drydep_season_pa(ifp) = 3 ! NH late autumn + endif + endif ! DOY + else !Southern HS + if(hlm_day_of_year .gt. 180)then ! spring + bc_out(s)%drydep_season_pa(ifp) = 5 ! SH spring + else ! SH autumn + if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then + bc_out(s)%drydep_season_pa(ifp) = 2 ! SH early autumn + else + bc_out(s)%drydep_season_pa(ifp) = 3 ! SH late autumn + endif ! autumn + endif ! DOY + endif ! Hemisphere + endif ! summer? + currentPatch => currentPatch%younger + end do + + end do +end subroutine set_fates_drydep_indices + +! ======================================================================================== + subroutine SeedlingParPatch(cpatch, & atm_par, & seedling_par_high, par_high_frac, & From df857555f02c506fca2358781792456c91ca27e8 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 14 Mar 2025 21:55:22 +0100 Subject: [PATCH 29/64] remove the previous calculation of wesley PFT and season indices from EDCanopyStructureMod --- biogeochem/EDCanopyStructureMod.F90 | 42 ----------------------------- 1 file changed, 42 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 4995b5d0ac..0e5273e164 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1904,8 +1904,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%dleaf_pa(:) = 0._r8 bc_out(s)%z0m_pa(:) = 0._r8 bc_out(s)%displa_pa(:) = 0._r8 - bc_out(s)%drydep_season_pa(:) = 0 - bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. currentPatch => sites(s)%oldest_patch c = fcolumn(s) do while(associated(currentPatch)) @@ -1981,44 +1979,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 endif - ! Set patch properties for the HLM dry depositioin model - ! This wants to know the PFT according to the 'wesley' classification scheme - ! and the season according to the same scheme. - bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) - - !wesely seasonal "index_season" - ! 1 - midsummer with lush vegetation - ! 2 - Autumn with unharvested cropland - ! 3 - Late autumn after frost, no snow - ! 4 - Winter, snow on ground and subfreezing - ! 5 - Transitional spring with partially green short annuals - if(bc_out(s)%tlai_pa(ifp) .gt. 2.0_r8)then - bc_out(s)%drydep_season_pa(ifp) = 1 ! Summer, or something like it. - else ! NOT SUMMER - if(sites(s)%lat>0)then ! Northern HS - if(hlm_day_of_year .lt. 180)then ! DOY - bc_out(s)%drydep_season_pa(ifp) = 5 ! NH spring - else ! autumn - if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then - bc_out(s)%drydep_season_pa(ifp) = 2 ! NH early autumn - else - bc_out(s)%drydep_season_pa(ifp) = 3 ! NH late autumn - endif - endif ! DOY - else !Southern HS - if(hlm_day_of_year .gt. 180)then ! spring - bc_out(s)%drydep_season_pa(ifp) = 5 ! SH spring - else ! SH autumn - if(bc_out(s)%tlai_pa(ifp) .gt. 1.0_r8)then - bc_out(s)%drydep_season_pa(ifp) = 2 ! SH early autumn - else - bc_out(s)%drydep_season_pa(ifp) = 3 ! SH late autumn - endif ! autumn - endif ! DOY - endif ! Hemisphere - endif ! summer? - - ! ----------------------------------------------------------------------------- @@ -2101,8 +2061,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! for vegetated patches only ifp = ifp+1 bc_out(s)%canopy_fraction_pa(ifp) = bc_out(s)%canopy_fraction_pa(ifp)/total_patch_area - bc_out(s)%wesley_pft_label_pa(ifp)=8 - bc_out(s)%drydep_season_pa(ifp)=4 !winter season where there is bare ground endif ! veg patch currentPatch => currentPatch%younger end do From 9f63d53d18da5fb3158f12e5b84738db1603c111 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 14 Mar 2025 21:56:55 +0100 Subject: [PATCH 30/64] forgot ro zero out drydep_season_pa --- main/FatesInterfaceMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index e2ce69c2f8..26aabf5ac3 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -2219,6 +2219,7 @@ subroutine set_fates_drydep_indices(nsites,sites,fcolumn,bc_out) do s = 1,nsites bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. + bc_out(s)%drydep_season_pa(:) = 0 currentPatch => sites(s)%oldest_patch c = fcolumn(s) do while(associated(currentPatch) From 0b825c75ce91d8fe1a20018d13820d8d599f3a31 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Sat, 15 Mar 2025 08:27:30 +0100 Subject: [PATCH 31/64] debugging --- main/FatesInterfaceMod.F90 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 26aabf5ac3..8cb72f3aeb 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -2211,18 +2211,20 @@ end subroutine UpdateFatesRMeansTStep ! ======================================================================================== -subroutine set_fates_drydep_indices(nsites,sites,fcolumn,bc_out) - - type(bc_out_type), intent(inout) :: bc_out(nsites) - integer :: s, ifp, c, p +subroutine set_fates_drydep_indices(nsites,sites,bc_out) + use EDPftvarcon , only : EDPftvarcon_inst + type(bc_out_type), intent(inout) :: bc_out(nsites) + type(ed_site_type), pointer :: sites(:) + integer :: nsites + integer :: s, ifp, p type (fates_patch_type) , pointer :: currentPatch do s = 1,nsites bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. bc_out(s)%drydep_season_pa(:) = 0 currentPatch => sites(s)%oldest_patch - c = fcolumn(s) - do while(associated(currentPatch) + + do while(associated(currentPatch)) bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) ! Wesely seasonal "index_season" From 78cfa5a499999b8518a0d86919c61c8711247a52 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 24 Mar 2025 09:20:21 +0100 Subject: [PATCH 32/64] adding bare ground patch term for drydep into FatesInterfaceMod and fixing ifp issue --- main/FatesInterfaceMod.F90 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 8cb72f3aeb..1707c8e42e 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -2220,13 +2220,14 @@ subroutine set_fates_drydep_indices(nsites,sites,bc_out) type (fates_patch_type) , pointer :: currentPatch do s = 1,nsites + ifp=0 bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation. - bc_out(s)%drydep_season_pa(:) = 0 + bc_out(s)%drydep_season_pa(:) = 3 ! bare currentPatch => sites(s)%oldest_patch - + ifp=ifp+1 do while(associated(currentPatch)) - bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) - + if(currentPatch%nocomp_pft_label>0)then + bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label) ! Wesely seasonal "index_season" ! 1 - midsummer with lush vegetation ! 2 - Autumn with unharvested cropland @@ -2258,10 +2259,14 @@ subroutine set_fates_drydep_indices(nsites,sites,bc_out) endif ! DOY endif ! Hemisphere endif ! summer? - currentPatch => currentPatch%younger - end do - end do + else ! bare ground + bc_out(s)%drydep_season_pa(ifp) = 3 + bc_out(s)%wesley_pft_label_pa(ifp)= 8 + endif ! not bare ground. + currentPatch => currentPatch%younger + end do ! patch + end do ! site end subroutine set_fates_drydep_indices ! ======================================================================================== From 29b54348b2c8b41d8c2f386939c1126a6b30dce6 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 24 Mar 2025 09:59:58 +0100 Subject: [PATCH 33/64] reversing arbitrary parameter changes to be brought in with a different PR --- parameter_files/fates_params_default.cdl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index e1d6f9b905..ee3e2756df 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1371,7 +1371,7 @@ data: fates_leaf_slatop = 0.012, 0.005, 0.024, 0.009, 0.03, 0.03, 0.012, 0.03, 0.03, 0.01, 0.032, 0.027, 0.05, 0.05 ; - fates_leaf_stomatal_intercept = 50000, 10000, 10000, 10000, 10000, 10000, + fates_leaf_stomatal_intercept = 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 40000 ; fates_leaf_stomatal_slope_ballberry = 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; @@ -1380,7 +1380,7 @@ data: 4.7, 4.7, 4.7, 2.2, 5.3, 1.6 ; fates_leaf_vcmax25top = - 60, 62, 39, 61, 58, 58, 62, 54, 54, 38, 54, 86, 78, 78 ; + 50, 62, 39, 61, 58, 58, 62, 54, 54, 38, 54, 86, 78, 78 ; fates_leaf_vcmaxha = 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330 ; @@ -1656,7 +1656,7 @@ data: fates_turb_leaf_diameter = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04 ; - fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, + fates_turb_z0mr = 0.055, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, From 25a6dc009501dd52f93346d391f5de9915cfa51d Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 24 Mar 2025 12:12:27 +0100 Subject: [PATCH 34/64] more reverts on parameter file --- parameter_files/fates_params_default.cdl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index ee3e2756df..b99b54a77e 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1374,7 +1374,7 @@ data: fates_leaf_stomatal_intercept = 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 40000 ; - fates_leaf_stomatal_slope_ballberry = 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; + fates_leaf_stomatal_slope_ballberry = 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; fates_leaf_stomatal_slope_medlyn = 4.1, 2.3, 2.3, 4.1, 4.4, 4.4, 4.7, 4.7, 4.7, 4.7, 4.7, 2.2, 5.3, 1.6 ; @@ -1656,8 +1656,8 @@ data: fates_turb_leaf_diameter = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04 ; - fates_turb_z0mr = 0.055, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; + fates_turb_z0mr = 0.055, 0.055, 0.055, 0.075, 0.055, 0.055, 0.055, 0.055, + 0.055, 0.055, 0.055, 0.055, 0.055, 0.055 ; fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0 ; From 5ee29a6da3ef68f1e22999175bab594921ad036b Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 24 Mar 2025 12:17:21 +0100 Subject: [PATCH 35/64] removing whitespace changes to EDCanopyStructure --- biogeochem/EDCanopyStructureMod.F90 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 0e5273e164..d41a4b98b4 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1877,7 +1877,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) use EDTypesMod , only : ed_site_type, AREA use FatesPatchMod, only : fates_patch_type use FatesInterfaceTypesMod , only : bc_out_type - use FatesInterfaceTypesMod , only : hlm_day_of_year + ! ! !ARGUMENTS integer, intent(in) :: nsites @@ -1894,7 +1894,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) real(r8) :: total_canopy_area real(r8) :: total_patch_leaf_stem_area real(r8) :: weight ! Weighting for cohort variables in patch - + do s = 1,nsites ifp = 0 @@ -1904,6 +1904,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%dleaf_pa(:) = 0._r8 bc_out(s)%z0m_pa(:) = 0._r8 bc_out(s)%displa_pa(:) = 0._r8 + currentPatch => sites(s)%oldest_patch c = fcolumn(s) do while(associated(currentPatch)) @@ -1978,8 +1979,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1) bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = 1 endif - - ! ----------------------------------------------------------------------------- ! We are assuming here that grass is all located underneath tree canopies. @@ -2002,6 +2001,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) + bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label if(currentPatch%nocomp_pft_label.gt.0)then bc_out(s)%nocomp_MEGAN_pft_label_pa(ifp) = EDPftvarcon_inst%voc_pftindex(currentPatch%nocomp_pft_label) @@ -2061,7 +2061,8 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! for vegetated patches only ifp = ifp+1 bc_out(s)%canopy_fraction_pa(ifp) = bc_out(s)%canopy_fraction_pa(ifp)/total_patch_area - endif ! veg patch + endif ! veg patch + currentPatch => currentPatch%younger end do @@ -2081,6 +2082,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) ! Pass FATES Harvested C to bc_out. call UpdateHarvestC(sites(s),bc_out(s)) + end do ! This call to RecruitWaterStorage() makes an accounting of From 55c8af433ca41927cd1d7285823f6e573a85fad9 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Sat, 29 Mar 2025 12:41:33 +0100 Subject: [PATCH 36/64] fix megan emis --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index fa9193f520..80f220d065 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -252,7 +252,8 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) real(r8) :: fsun ! sun-shade fraction real(r8) :: par_per_sunla, par_per_shala ! PAR per sunlit and shaded leaf area [W/m2 leaf] real(r8) :: ac_utest, aj_utest ! Gross rubisco and rubp limited assimilation (for unit tests) - real(r8) :: ap_utest, co2_inter_c_utest ! PEP limited assimilation, and intracellular co2 (for unit tests) + real(r8) :: ap_utest, co2_inter_c_utest ! PEP limited assimilation, and (for unit tests) + real(r8),dimension(150) :: cohort_vaitop ! The top-down integrated vegetation area index ! (leaf+stem) at the top of the layer real(r8),dimension(150) :: cohort_vaibot ! The top-down integrated vegetation area index @@ -274,6 +275,9 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) real(r8) :: gstoma ! stomatal conductance at leaf bin (sun/shade combined) [m/s] real(r8) :: anet_ll ! leaf level net assimilation [umol CO2/m**2/s] real(r8) :: c13disc_ll ! leaf level c13 assimilation + real(r8) :: co2_inter_c_ll ! Leaf level intracellular co2 (Pa) + real(r8) :: co2_inter_c ! cohort level intracellular co2 (Pa) (sun/shade combined) [Pa] + real(r8) :: patch_co2_inter ! patch level level intracellular co2 (Pa) (sun/shade combined) [Pa] real(r8) :: hydr_k_lwp ! inner leaf humidity scaling coefficient [-] real(r8) :: gs0 ! stomatal intercept, possibly scaled by btran depending on hypothesis real(r8) :: gs1 ! stomatal slope, possibly scaled by btran depending on hypothesis @@ -355,6 +359,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) bc_out(s)%ci_pa(ifp) = 0._r8 g_sb_leaves = 0._r8 + patch_co2_inter = 0._r8 patch_la = 0._r8 ! Part II. Filter out patches @@ -479,6 +484,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) call LowstorageMainRespReduction(frac,currentCohort%pft, & maintresp_reduction_factor) + co2_inter_c = 0.0_r8 ! are there any leaves of this pft in this layer? canopy_mask_if: if(currentPatch%canopy_mask(cl,ft) == 1)then @@ -699,6 +705,8 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) gb_mol = (1._r8/bc_in(s)%rb_pa(ifp)) * vmol_cf gstoma = 0._r8 + co2_inter_c_ll = 0.0_r8 + do_sunsha: do isunsha = 1,2 ! Determine absorbed PAR per square meter of leaf @@ -783,7 +791,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) gstoma_ll, & ! out anet_ll, & ! out c13disc_ll, & ! out - co2_inter_c_utest, & ! out (unit tests) + co2_inter_c_ll, & ! out (unit tests) solve_iter) ! out performance tracking ! Average output quantities across sunlit and shaded leaves @@ -794,7 +802,8 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) psn_z(iv,ft,cl) = psn_z(iv,ft,cl) + area_frac * psn_ll anet_av_z(iv,ft,cl) = anet_av_z(iv,ft,cl) + area_frac * anet_ll c13disc_z(iv,ft,cl) = c13disc_z(iv,ft,cl) + area_frac * c13disc_ll - + internal_co2_z(iv,ft,cl) = internal_co2_z(iv,ft,cl) & + + area_frac * co2_inter_c_ll end do do_sunsha ! Stomatal resistance of the leaf-layer @@ -838,6 +847,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) rs_z(1:nv,ft,cl), & !in currentPatch%elai_profile(cl,ft,1:nv), & !in c13disc_z(1:nv,ft,cl), & !in + internal_co2_z(1:nv,ft,cl), & !in currentCohort%c_area, & !in currentCohort%n, & !in bc_in(s)%rb_pa(ifp), & !in @@ -846,6 +856,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) currentCohort%gpp_tstep, & !out currentCohort%rdark, & !out currentCohort%c13disc_clm, & !out + co2_inter_c, & !out cohort_eleaf_area) !out else @@ -858,6 +869,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) rs_z(1:nv,ft,cl), & !in cohort_layer_elai(1:nv), & !in c13disc_z(1:nv,ft,cl), & !in + internal_co2_z(1:nv,ft,cl), & !in currentCohort%c_area, & !in currentCohort%n, & !in bc_in(s)%rb_pa(ifp), & !in @@ -866,6 +878,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) currentCohort%gpp_tstep, & !out currentCohort%rdark, & !out currentCohort%c13disc_clm, & !out + co2_inter_c, & !out cohort_eleaf_area) !out end if @@ -883,6 +896,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) currentCohort%rdark = 0.0_r8 currentCohort%g_sb_laweight = 0.0_r8 currentCohort%ts_net_uptake(:) = 0.0_r8 + co2_inter_c = 0.0_r8 end if canopy_mask_if @@ -1066,7 +1080,8 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! of each cohort and has units of [m/s] * [m2 leaf] g_sb_leaves = g_sb_leaves + currentCohort%g_sb_laweight - + ! accumulate lead intercellular co2 + patch_co2_inter = patch_co2_inter + co2_inter_c ! Accumulate the total effective leaf area from all cohorts ! in this patch. Normalize by canopy area outside the loop patch_la = patch_la + cohort_eleaf_area @@ -1087,6 +1102,8 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! units of [m/s]*[m2] / [m2] = [m/s] g_sb_leaves = g_sb_leaves / patch_la + + patch_co2_inter = patch_co2_inter / patch_la if_above_mincond: if( g_sb_leaves > (1._r8/rsmax0) ) then @@ -1119,7 +1136,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) bc_out(s)%rssha_pa(ifp) = r_stomata if(hlm_use_nocomp .eq. itrue)then - bc_out(s)%ci_pa(ifp) = internal_co2_z(1,currentpatch%nocomp_pft_label,1) + bc_out(s)%ci_pa(ifp) = patch_co2_inter else bc_out(s)%ci_pa(ifp) = -999 endif @@ -1225,7 +1242,8 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in lmr_llz, & ! in rs_llz, & ! in elai_llz, & ! in - c13disc_llz, & ! in + c13disc_llz, & ! in + internal_co2_llz, & ! in c_area, & ! in nplant, & ! in rb, & ! in @@ -1234,6 +1252,7 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in gpp, & ! out rdark, & ! out c13disc_clm, & ! out + co2_inter, & ! out cohort_eleaf_area ) ! out ! ------------------------------------------------------------------------------------ @@ -1253,6 +1272,7 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in real(r8), intent(in) :: rs_llz(nv) ! leaf layer stomatal resistance [s/m] real(r8), intent(in) :: elai_llz(nv) ! exposed LAI per layer [m2 leaf/ m2 pft footprint] real(r8), intent(in) :: c13disc_llz(nv) ! leaf layer c13 discrimination, weighted mean + real(r8), intent(in) :: internal_co2_llz(nv) !Intercellular co2 pressure per layer Pa real(r8), intent(in) :: c_area ! crown area m2/m2 real(r8), intent(in) :: nplant ! indiv/m2 real(r8), intent(in) :: rb ! leaf boundary layer resistance (s/m) @@ -1263,6 +1283,7 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in real(r8), intent(out) :: rdark ! Dark Leaf Respiration (kgC/indiv/s) real(r8), intent(out) :: cohort_eleaf_area ! Effective leaf area of the cohort [m2] real(r8), intent(out) :: c13disc_clm ! unpacked Cohort level c13 discrimination + real(r8), intent(out) :: co2_inter ! Intercellular co2 pressure weighted by leaf area [P]*[m2] real(r8) :: sum_weight ! sum of weight for unpacking d13c flux (c13disc_z) from ! (canopy_layer, pft, leaf_layer) matrix to cohort (c13disc_clm) @@ -1277,6 +1298,7 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in g_sb_laweight = 0.0_r8 gpp = 0.0_r8 rdark = 0.0_r8 + co2_inter = 0.0_r8 do il = 1, nv ! Loop over the leaf layers this cohort participates in @@ -1297,6 +1319,8 @@ subroutine ScaleLeafLayerFluxToCohort(nv, & ! in ! on total leaf area, and not really footprint area ! [m/s] * [m2 cohort's leaf layer] g_sb_laweight = g_sb_laweight + 1.0_r8/(rs_llz(il)+rb) * cohort_layer_eleaf_area + ! same for intercellular co2 [Pa] * [m2 cohort's leaf layer] + co2_inter = co2_inter * cohort_layer_eleaf_area ! GPP [umolC/m2leaf/s] * [m2 leaf ] -> [umolC/s] gpp = gpp + psn_llz(il) * cohort_layer_eleaf_area From 823d67bda28c886bd4fc617ca06fc1ba63bf3e4b Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Sat, 29 Mar 2025 12:41:54 +0100 Subject: [PATCH 37/64] update paramfile to latest calibration --- parameter_files/fates_params_default.cdl | 100 ++++++++++++----------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 238f7a4308..15d1da7014 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -993,8 +993,8 @@ data: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; - fates_alloc_storage_cushion = 1.2, 1.2, 1.2, 1.2, 2.4, 1.2, 1.2, 2.4, 1.2, - 1.5, 1.4, 1.2, 1.2, 1.2 ; + fates_alloc_storage_cushion = 1.2, 2.4, 2.4, 1.2, 2.4, 2.4, 2.4, 2.4, 2.4, + 2.4, 2.4, 2.4, 2.4, 2.4 ; fates_alloc_store_priority_frac = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7, 0.6, 0.6, 0.8, 0.8 ; @@ -1022,8 +1022,8 @@ data: fates_allom_cmode = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_allom_d2bl1 = 0.04, 0.07, 0.07, 0.01, 0.04, 0.07, 0.07, 0.07, 0.07, - 0.0481934, 0.0481934, 0.0004, 0.0004, 0.0012 ; + fates_allom_d2bl1 = 0.04, 0.08, 0.08, 0.01, 0.04, 0.07, 0.07, 0.07, 0.05, + 0.0481934, 0.0481934, 0.05, 0.04, 0.04 ; fates_allom_d2bl2 = 1.6019679, 1.5234373, 1.3051237, 1.9621397, 1.6019679, 1.3998939, 1.3, 1.3, 1.3, 1.0600586, 1.7176758, 1.7092, 1.7092, 1.5879 ; @@ -1072,7 +1072,7 @@ data: fates_allom_hmode = 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 3, 3, 3 ; - fates_allom_l2fr = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.67, 0.67, 1.41 ; + fates_allom_l2fr = 1, 0.75, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1.41 ; fates_allom_la_per_sa_int = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ; @@ -1318,14 +1318,14 @@ data: 0.75, 0.75 ; fates_hydro_vg_alpha_node = - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, - 0.12, 0.12, - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, - 0.12, 0.12, - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, - 0.12, 0.12, - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, - 0.12, 0.12 ; + 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.005, 0.005, 0.005, 0.005, 0.005, + 0.005, 0.005, 0.005, 0.005, + 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.005, 0.005, 0.005, 0.005, 0.005, + 0.005, 0.005, 0.005, 0.005, + 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.005, 0.005, 0.005, 0.005, 0.005, + 0.005, 0.005, 0.005, 0.005, + 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.005, 0.005, 0.005, 0.005, 0.005, + 0.005, 0.005, 0.005, 0.005 ; fates_hydro_vg_m_node = 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, @@ -1369,24 +1369,26 @@ data: fates_leaf_jmaxse = 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495 ; - fates_leaf_slamax = 0.0954, 0.0954, 0.0954, 0.0954, 0.0954, 0.0954, 0.012, - 0.03, 0.03, 0.012, 0.032, 0.05, 0.05, 0.05 ; + fates_leaf_slamax = 0.03, 0.03, 0.025, 0.03, 0.05, 0.05, 0.012, 0.03, 0.03, + 0.012, 0.032, 0.05, 0.05, 0.05 ; - fates_leaf_slatop = 0.012, 0.005, 0.024, 0.009, 0.03, 0.03, 0.012, 0.03, - 0.03, 0.01, 0.032, 0.027, 0.05, 0.05 ; + fates_leaf_slatop = 0.024, 0.01, 0.021, 0.024, 0.02, 0.03, 0.012, 0.03, + 0.03, 0.01, 0.032, 0.027, 0.04, 0.04 ; fates_leaf_stomatal_btran_model = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_leaf_stomatal_intercept = 10000, 10000, 10000, 10000, 10000, 10000, - 10000, 10000, 10000, 10000, 10000, 10000, 10000, 40000 ; + fates_leaf_stomatal_intercept = 50000, 21529.33, 13370.411, 26779.681, + 12869.022, 6205.777, 10000, 10000, 3750.669, 10000, 10000, 1624.209, + 313709.616, 439459.319 ; - fates_leaf_stomatal_slope_ballberry = 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; + fates_leaf_stomatal_slope_ballberry = 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; - fates_leaf_stomatal_slope_medlyn = 4.1, 2.3, 2.3, 4.1, 4.4, 4.4, 4.7, 4.7, - 4.7, 4.7, 4.7, 2.2, 5.3, 1.6 ; + fates_leaf_stomatal_slope_medlyn = 2.038, 2.482, 2.571, 4.038, 3.459, 4.353, + 4.7, 4.7, 2.503, 4.7, 4.7, 2.423, 5.799, 0.967 ; fates_leaf_vcmax25top = - 50, 62, 39, 61, 58, 58, 62, 54, 54, 38, 54, 86, 78, 78 ; + 53.142, 40, 20.443, 20.252, 38.393, 34.363, 62, 54, 43.712, 38, 54, 39.168, + 64, 17.955 ; fates_leaf_vcmaxha = 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330 ; @@ -1404,9 +1406,8 @@ data: fates_leafn_vert_scaler_coeff2 = 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43 ; - fates_maintresp_leaf_atkin2017_baserate = 1.756, 1.4995, 1.4995, 1.756, - 1.756, 1.756, 2.0749, 2.0749, 2.0749, 2.0749, 2.0749, 2.1956, 2.1956, - 2.1956 ; + fates_maintresp_leaf_atkin2017_baserate = 1.734, 2.169, 2.104, 2.104, 2.069, + 1.622, 2.0749, 2.0749, 3.054, 2.0749, 2.0749, 2.079, 2.0749, 2.182 ; fates_maintresp_leaf_ryan1991_baserate = 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, @@ -1417,7 +1418,7 @@ data: 0.00963, 0.00963, 0.00963 ; fates_maintresp_leaf_vert_scaler_coeff2 = 2.43, 2.43, 2.43, 2.43, 2.43, - 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43 ; + 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.43, 2.25 ; fates_maintresp_reduction_curvature = 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ; @@ -1462,11 +1463,13 @@ data: fates_mort_upthresh_cstarvation = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_nonhydro_smpsc = -255000, -255000, -255000, -255000, -255000, -255000, - -255000, -255000, -255000, -255000, -255000, -255000, -255000, -255000 ; + fates_nonhydro_smpsc = -177537.967, -352444.342, -214798.413, -307679.665, + -347451.834, -175120.945, -255000, -255000, -134673.93, -255000, -255000, + -317882.916, -200123.906, -360214.919 ; - fates_nonhydro_smpso = -66000, -66000, -66000, -66000, -66000, -66000, - -66000, -66000, -66000, -66000, -66000, -66000, -66000, -66000 ; + fates_nonhydro_smpso = -34844.846, -87067.176, -33560.298, -98998.485, + -98986.971, -33160.364, -66000, -66000, -33137.782, -66000, -66000, + -96187.704, -35291.509, -51250.654 ; fates_phen_cold_size_threshold = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; @@ -1474,7 +1477,7 @@ data: -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4 ; - fates_phen_evergreen = 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 ; + fates_phen_evergreen = 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 ; fates_phen_flush_fraction = _, _, 0.5, _, 0.5, 0.5, _, 0.5, 0.5, _, 0.5, 0.5, 0.5, 0.5 ; @@ -1492,7 +1495,7 @@ data: fates_phen_stem_drop_fraction = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; - fates_phen_stress_decid = 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1 ; + fates_phen_stress_decid = 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1 ; fates_prescribed_npp_canopy = 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4 ; @@ -1534,7 +1537,7 @@ data: fates_recruit_height_min = 1.3, 1.3, 1.3, 1.3, 1.3, 1.3, 0.2, 0.2, 0.2, 0.8, 0.8, 0.11, 0.2, 0.2 ; - fates_recruit_init_density = 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, + fates_recruit_init_density = 2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.16, 0.2, 0.2, 0.2, 0.2 ; fates_recruit_prescribed_rate = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, @@ -1552,7 +1555,8 @@ data: fates_recruit_seed_germination_rate = 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.4, 0.49, 0.29, 0.5, 0.5 ; - fates_recruit_seed_supplement = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; + fates_recruit_seed_supplement = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, 0.1, 0.1 ; fates_seed_dispersal_fraction = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; @@ -1662,28 +1666,28 @@ data: fates_turb_leaf_diameter = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04 ; - fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, - 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; + fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, + 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0 ; - fates_turnover_fnrt = 1, 2, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 1, 1 ; + fates_turnover_fnrt = 1, 2, 1.5, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.5, 0.5 ; fates_turnover_leaf_canopy = - 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 1, 1 ; + 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 0.5, 0.15, 0.5 ; fates_turnover_leaf_ustory = - 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 1, 1 ; + 2.5, 5, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.15, 0.5 ; fates_turnover_senleaf_fdrought = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; fates_wood_density = 0.548327, 0.44235, 0.454845, 0.754336, 0.548327, 0.566452, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7 ; - fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; + fates_woody = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ; - fates_voc_pftindex = 4, 1, 3, 5, 6, 7, 9, 10, 10, 9, 11, 12, 13, 14 ; + fates_voc_pftindex = 4, 1, 3, 5, 6, 7, 9, 10, 10, 9, 11, 12, 13, 14 ; fates_hlm_pft_map = 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1733,11 +1737,11 @@ data: fates_cnp_eca_plant_escalar = 1.25e-05 ; - fates_cohort_age_fusion_tol = 0.08 ; + fates_cohort_age_fusion_tol = 0.25 ; - fates_cohort_size_fusion_tol = 0.08 ; + fates_cohort_size_fusion_tol = 0.25 ; - fates_comp_excln = 3 ; + fates_comp_excln = -1 ; fates_damage_canopy_layer_code = 1 ; @@ -1823,7 +1827,7 @@ data: fates_mort_understorey_death = 0.55983 ; - fates_patch_fusion_tol = 0.05 ; + fates_patch_fusion_tol = 0.15 ; fates_phen_chilltemp = 5 ; @@ -1853,7 +1857,7 @@ data: fates_trs_seedling_mort_par_timescale = 32 ; - fates_vai_top_bin_width = 1 ; + fates_vai_top_bin_width = 0.5 ; - fates_vai_width_increase_factor = 1 ; + fates_vai_width_increase_factor = 1.1 ; } From 1fc3209f745099e828ab944c2692d89ade126f89 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 1 Apr 2025 17:00:14 -0600 Subject: [PATCH 38/64] fix to trivial radiation transmission (cherry picked from commit 545312057f6400185468cf39d443260edfc3b4de) --- main/FatesInterfaceMod.F90 | 2 +- radiation/FatesRadiationDriveMod.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 896dff2a39..1ea3dd17cc 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -380,7 +380,7 @@ subroutine zero_bcs(fates,s) fates%bc_out(s)%fabd_parb(:,:) = 0.0_r8 ! no rad absorbed by veg fates%bc_out(s)%fabi_parb(:,:) = 0.0_r8 ! no rad absorbed by veg fates%bc_out(s)%ftdd_parb(:,:) = 1.0_r8 ! rad flux to soil at bottom of veg is 100% - fates%bc_out(s)%ftid_parb(:,:) = 1.0_r8 ! rad flux to soil at bottom of veg is 100% + fates%bc_out(s)%ftid_parb(:,:) = 0.0_r8 ! rad flux to soil at bottom of veg is 100% fates%bc_out(s)%ftii_parb(:,:) = 1.0_r8 ! rad flux to soil at bottom of veg is 100% fates%bc_out(s)%elai_pa(:) = 0.0_r8 diff --git a/radiation/FatesRadiationDriveMod.F90 b/radiation/FatesRadiationDriveMod.F90 index 5145dfc297..6a972d8c31 100644 --- a/radiation/FatesRadiationDriveMod.F90 +++ b/radiation/FatesRadiationDriveMod.F90 @@ -113,7 +113,7 @@ subroutine FatesNormalizedCanopyRadiation(sites, bc_in, bc_out ) bc_out(s)%fabi_parb(ifp,:) = 0._r8 bc_out(s)%fabd_parb(ifp,:) = 0._r8 bc_out(s)%ftdd_parb(ifp,:) = 1._r8 - bc_out(s)%ftid_parb(ifp,:) = 1._r8 + bc_out(s)%ftid_parb(ifp,:) = 0._r8 bc_out(s)%ftii_parb(ifp,:) = 1._r8 ! Zero diagnostics From cae3fc0b8b383da2d0c57e486948b1473b1ba2b7 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Wed, 9 Apr 2025 18:10:01 +0200 Subject: [PATCH 39/64] make consistent with ctsm --- main/FatesInterfaceMod.F90 | 8 ++++---- radiation/FatesRadiationDriveMod.F90 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 1ea3dd17cc..025af97745 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -375,13 +375,13 @@ subroutine zero_bcs(fates,s) fates%bc_out(s)%rssun_pa(:) = 0.0_r8 fates%bc_out(s)%rssha_pa(:) = 0.0_r8 - fates%bc_out(s)%albd_parb(:,:) = 0.0_r8 ! zero albedo, soil absorbs all rad - fates%bc_out(s)%albi_parb(:,:) = 0.0_r8 ! zero albedo, soil absorbs all rad + fates%bc_out(s)%albd_parb(:,:) = 1.0_r8 ! zero albedo, soil absorbs all rad + fates%bc_out(s)%albi_parb(:,:) = 1.0_r8 ! zero albedo, soil absorbs all rad fates%bc_out(s)%fabd_parb(:,:) = 0.0_r8 ! no rad absorbed by veg fates%bc_out(s)%fabi_parb(:,:) = 0.0_r8 ! no rad absorbed by veg - fates%bc_out(s)%ftdd_parb(:,:) = 1.0_r8 ! rad flux to soil at bottom of veg is 100% + fates%bc_out(s)%ftdd_parb(:,:) = 0.0_r8 ! rad flux to soil at bottom of veg is 100% fates%bc_out(s)%ftid_parb(:,:) = 0.0_r8 ! rad flux to soil at bottom of veg is 100% - fates%bc_out(s)%ftii_parb(:,:) = 1.0_r8 ! rad flux to soil at bottom of veg is 100% + fates%bc_out(s)%ftii_parb(:,:) = 0.0_r8 ! rad flux to soil at bottom of veg is 100% fates%bc_out(s)%elai_pa(:) = 0.0_r8 fates%bc_out(s)%esai_pa(:) = 0.0_r8 diff --git a/radiation/FatesRadiationDriveMod.F90 b/radiation/FatesRadiationDriveMod.F90 index 6a972d8c31..b14fa45581 100644 --- a/radiation/FatesRadiationDriveMod.F90 +++ b/radiation/FatesRadiationDriveMod.F90 @@ -108,13 +108,13 @@ subroutine FatesNormalizedCanopyRadiation(sites, bc_in, bc_out ) ! Initialize output boundary conditions with trivial assumption ! of a black body soil and fully transmitting canopy - bc_out(s)%albd_parb(ifp,:) = 0._r8 - bc_out(s)%albi_parb(ifp,:) = 0._r8 + bc_out(s)%albd_parb(ifp,:) = 1._r8 + bc_out(s)%albi_parb(ifp,:) = 1._r8 bc_out(s)%fabi_parb(ifp,:) = 0._r8 bc_out(s)%fabd_parb(ifp,:) = 0._r8 - bc_out(s)%ftdd_parb(ifp,:) = 1._r8 + bc_out(s)%ftdd_parb(ifp,:) = 0._r8 bc_out(s)%ftid_parb(ifp,:) = 0._r8 - bc_out(s)%ftii_parb(ifp,:) = 1._r8 + bc_out(s)%ftii_parb(ifp,:) = 0._r8 ! Zero diagnostics currentPatch%f_sun (:,:,:) = 0._r8 From 1eda02c5c489b68b6ff1256e9483f895bd4378a0 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Sun, 13 Apr 2025 17:24:49 +0200 Subject: [PATCH 40/64] add fix for rad_error --- main/FatesRestartInterfaceMod.F90 | 3 ++- radiation/FatesRadiationDriveMod.F90 | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 8e4c28d674..f77ba7c54c 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -29,6 +29,7 @@ module FatesRestartInterfaceMod use FatesInterfaceTypesMod, only : hlm_use_potentialveg use FatesInterfaceTypesMod, only : fates_maxElementsPerSite use FatesInterfaceTypesMod, only : hlm_use_tree_damage + use FatesInterfaceTypesMod , only : hlm_hio_ignore_val use FatesHydraulicsMemMod, only : nshell use FatesHydraulicsMemMod, only : n_hypool_ag use FatesHydraulicsMemMod, only : n_hypool_troot @@ -3875,7 +3876,7 @@ subroutine update_3dpatch_radiation(this, nsites, sites, bc_out) ! zero diagnostic radiation profiles currentPatch%nrmlzd_parprof_pft_dir_z(:,:,:,:) = 0._r8 currentPatch%nrmlzd_parprof_pft_dif_z(:,:,:,:) = 0._r8 - currentPatch%rad_error(:) = 0._r8 + currentPatch%rad_error(:) = hlm_hio_ignore_val if_notbareground: if(currentPatch%nocomp_pft_label.ne.nocomp_bareground) then diff --git a/radiation/FatesRadiationDriveMod.F90 b/radiation/FatesRadiationDriveMod.F90 index b14fa45581..0251d0837a 100644 --- a/radiation/FatesRadiationDriveMod.F90 +++ b/radiation/FatesRadiationDriveMod.F90 @@ -318,8 +318,12 @@ subroutine FatesSunShadeFracs(nsites, sites,bc_in,bc_out) ! Convert normalized radiation error units from fraction of radiation to W/m2 do ib = 1,num_swb - cpatch%rad_error(ib) = cpatch%rad_error(ib) * & + if (cpatch%rad_error(ib) /= hlm_hio_ignore_val) then + cpatch%rad_error(ib) = cpatch%rad_error(ib) * & (bc_in(s)%solad_parb(ifp,ib) + bc_in(s)%solai_parb(ifp,ib)) + else + cpatch%rad_error(ib) = hlm_hio_ignore_val + endif end do ! output the actual PAR profiles through the canopy for diagnostic purposes From f4494ea0dc5d4c1a460595fe2d677114173c6562 Mon Sep 17 00:00:00 2001 From: Charles D Koven Date: Thu, 6 Mar 2025 17:37:27 -0800 Subject: [PATCH 41/64] added grazing and burn fluxes as bc_out variables so that HLMs can calculate NBP --- biogeochem/EDPatchDynamicsMod.F90 | 41 +++++++++++------- biogeochem/EDPhysiologyMod.F90 | 70 ++++++++++++++++--------------- main/EDMainMod.F90 | 4 +- main/FatesInterfaceMod.F90 | 6 ++- main/FatesInterfaceTypesMod.F90 | 4 ++ 5 files changed, 74 insertions(+), 51 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index b1fc9af66d..80af058f02 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -48,6 +48,7 @@ module EDPatchDynamicsMod use FatesConstantsMod , only : nocomp_bareground use FatesInterfaceTypesMod , only : hlm_use_planthydro use FatesInterfaceTypesMod , only : bc_in_type + use FatesInterfaceTypesMod , only : bc_out_type use FatesInterfaceTypesMod , only : numpft use FatesInterfaceTypesMod , only : hlm_stepsize use FatesInterfaceTypesMod , only : hlm_use_sp @@ -482,7 +483,7 @@ end subroutine disturbance_rates ! ============================================================================ - subroutine spawn_patches( currentSite, bc_in) + subroutine spawn_patches( currentSite, bc_in, bc_out) ! ! !DESCRIPTION: ! In this subroutine, the following happens, @@ -509,6 +510,7 @@ subroutine spawn_patches( currentSite, bc_in) ! !ARGUMENTS: type (ed_site_type), intent(inout) :: currentSite type (bc_in_type), intent(in) :: bc_in + type (bc_out_type), intent(in) :: bc_out ! ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: newPatch @@ -768,13 +770,13 @@ subroutine spawn_patches( currentSite, bc_in) end if case (dtype_ifire) call fire_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis,bc_in) + newPatch, patch_site_areadis,bc_in, bc_out) case (dtype_ifall) call mortality_litter_fluxes(currentSite, currentPatch, & newPatch, patch_site_areadis,bc_in) case (dtype_ilandusechange) call landusechange_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis,bc_in, & + newPatch, patch_site_areadis,bc_in, bc_out, & clearing_matrix(i_donorpatch_landuse_type,i_landusechange_receiverpatchlabel)) ! if land use change, then may need to change nocomp pft, so tag as having transitioned LU @@ -1068,11 +1070,8 @@ subroutine spawn_patches( currentSite, bc_in) currentSite%mass_balance(el)%burn_flux_to_atm + & leaf_burn_frac * leaf_m * nc%n - ! This diagnostic only tracks - currentSite%flux_diags%elem(el)%burned_liveveg = & - currentSite%flux_diags%elem(el)%burned_liveveg + & - leaf_burn_frac * leaf_m * nc%n * area_inv - + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + & + leaf_burn_frac * leaf_m * nc%n end do ! Here the mass is removed from the plant @@ -1989,7 +1988,9 @@ subroutine TransLitterNewPatch(currentSite, & curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass*retain_m2 site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + ! Transfer below ground CWD (none burns) do sl = 1,currentSite%nlevsoil @@ -2018,7 +2019,9 @@ subroutine TransLitterNewPatch(currentSite, & curr_litt%leaf_fines(dcmpy) = curr_litt%leaf_fines(dcmpy) + donatable_mass*retain_m2 site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + ! Transfer root fines (none burns) do sl = 1,currentSite%nlevsoil donatable_mass = curr_litt%root_fines(dcmpy,sl) * patch_site_areadis @@ -2068,7 +2071,7 @@ end subroutine TransLitterNewPatch ! ============================================================================ subroutine fire_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis, bc_in) + newPatch, patch_site_areadis, bc_in, bc_out) ! ! !DESCRIPTION: ! CWD pool burned by a fire. @@ -2088,6 +2091,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in + type(bc_out_type) , intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -2229,8 +2233,8 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - - + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2292,6 +2296,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & burned_mass = num_dead_trees * SF_val_CWD_frac_adj(c) * bstem * & currentCohort%fraction_crown_burned site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass endif new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass * donate_m2 curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass * retain_m2 @@ -2542,7 +2547,7 @@ end subroutine mortality_litter_fluxes ! ============================================================================ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis, bc_in, & + newPatch, patch_site_areadis, bc_in, bc_out, & clearing_matrix_element) ! ! !DESCRIPTION: @@ -2559,6 +2564,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in + type(bc_out_type) , intent(in) :: bc_out logical , intent(in) :: clearing_matrix_element ! whether or not to clear vegetation ! @@ -2702,7 +2708,9 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & end do site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2762,6 +2770,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & EDPftvarcon_inst%landusechange_frac_burned(pft) site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass else ! all other pools can end up as timber products or burn or go to litter donatable_mass = donatable_mass * (1.0_r8-EDPftvarcon_inst%landusechange_frac_exported(pft)) * & (1.0_r8-EDPftvarcon_inst%landusechange_frac_burned(pft)) @@ -2775,6 +2784,8 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + trunk_product_site = trunk_product_site + & woodproduct_mass diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 3b1d61e914..c856b963ea 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -429,7 +429,7 @@ end subroutine GenerateDamageAndLitterFluxes ! ============================================================================ - subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) + subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out ) ! ----------------------------------------------------------------------------------- ! @@ -437,8 +437,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) ! associated with seed turnover, seed influx, litterfall from live and ! dead plants, germination, and fragmentation. ! - ! At this time we do not have explicit herbivory, and burning losses to litter - ! are handled elsewhere. + ! Herbivory is handled here. burning losses to litter are handled elsewhere. ! ! Note: The processes conducted here DO NOT handle litter fluxes associated ! with disturbance. Those fluxes are handled elsewhere (EDPatchDynamcisMod) @@ -452,6 +451,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) type(ed_site_type), intent(inout) :: currentSite type(fates_patch_type), intent(inout) :: currentPatch type(bc_in_type), intent(in) :: bc_in + type(bc_out_type), intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -470,34 +470,34 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) site_mass => currentSite%mass_balance(el), & diag => currentSite%flux_diags%elem(el)) - ! Calculate loss rate of viable seeds to litter - call SeedDecay(litt, currentPatch, bc_in) - - ! Calculate seed germination rate, the status flags prevent - ! germination from occuring when the site is in a drought - ! (for drought deciduous) or too cold (for cold deciduous) - call SeedGermination(litt, currentSite%cstatus, currentSite%dstatus(1:numpft), bc_in, currentPatch) - - ! Send fluxes from newly created litter into the litter pools - ! This litter flux is from non-disturbance inducing mortality, as well - ! as litter fluxes from live trees - call CWDInput(currentSite, currentPatch, litt,bc_in) - - ! Only calculate fragmentation flux over layers that are active - ! (RGK-Mar2019) SHOULD WE MAX THIS AT 1? DONT HAVE TO - - nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) - call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) - - ! Fragmentation flux to soil decomposition model [kg/site/day] - site_mass%frag_out = site_mass%frag_out + currentPatch%area * & - ( sum(litt%ag_cwd_frag) + sum(litt%bg_cwd_frag) + & - sum(litt%leaf_fines_frag) + sum(litt%root_fines_frag) + & - sum(litt%seed_decay) + sum(litt%seed_germ_decay)) - - ! Track total seed decay diagnostic in [kg/m2/day] - diag%tot_seed_turnover = diag%tot_seed_turnover + & - (sum(litt%seed_decay) + sum(litt%seed_germ_decay))*currentPatch%area*area_inv + ! Calculate loss rate of viable seeds to litter + call SeedDecay(litt, currentPatch, bc_in) + + + ! Calculate seed germination rate, the status flags prevent + ! germination from occuring when the site is in a drought + ! (for drought deciduous) or too cold (for cold deciduous) + call SeedGermination(litt, currentSite%cstatus, currentSite%dstatus(1:numpft), bc_in, currentPatch) + + ! Send fluxes from newly created litter into the litter pools + ! This litter flux is from non-disturbance inducing mortality, as well + ! as litter fluxes from live trees + call CWDInput(currentSite, currentPatch, litt,bc_in, bc_out) + + ! Only calculate fragmentation flux over layers that are active + ! (RGK-Mar2019) SHOULD WE MAX THIS AT 1? DONT HAVE TO + + nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) + call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) + + site_mass => currentSite%mass_balance(el) + + ! Fragmentation flux to soil decomposition model [kg/site/day] + site_mass%frag_out = site_mass%frag_out + currentPatch%area * & + ( sum(litt%ag_cwd_frag) + sum(litt%bg_cwd_frag) + & + sum(litt%leaf_fines_frag) + sum(litt%root_fines_frag) + & + sum(litt%seed_decay) + sum(litt%seed_germ_decay)) + end associate end do @@ -2788,7 +2788,7 @@ end subroutine recruitment ! ====================================================================================== - subroutine CWDInput( currentSite, currentPatch, litt, bc_in) + subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) ! ! !DESCRIPTION: @@ -2808,6 +2808,7 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in) type(fates_patch_type),intent(inout), target :: currentPatch type(litter_type),intent(inout),target :: litt type(bc_in_type),intent(in) :: bc_in + type(bc_out_type),intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -2955,12 +2956,15 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in) elflux_diags%root_litter_input(pft) + & (fnrt_m_turnover + store_m_turnover ) * currentCohort%n - ! send the part of the herbivory flux that doesn't go to litter to the atmosphere + ! send the part of the herbivory flux that doesn't go to litter to the atmosphere (and also for tracking) site_mass%herbivory_flux_out = & site_mass%herbivory_flux_out + & leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + bc_out%grazing_closs_to_atm_si = bc_out%grazing_closs_to_atm_si + & + leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + ! Assumption: turnover from deadwood and sapwood are lumped together in CWD pool !update partitioning of stem wood (struct + sapw) to cwd based on cohort dbh diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 979aa2960d..339615ec58 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -294,7 +294,7 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out) ! make new patches from disturbed land if (do_patch_dynamics.eq.itrue ) then - call spawn_patches(currentSite, bc_in) + call spawn_patches(currentSite, bc_in, bc_out) call TotalBalanceCheck(currentSite,3) @@ -782,7 +782,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) call GenerateDamageAndLitterFluxes( currentSite, currentPatch, bc_in) - call PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in) + call PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out) call PreDisturbanceIntegrateLitter(currentPatch ) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 025af97745..152f4220b3 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -371,7 +371,11 @@ subroutine zero_bcs(fates,s) write(fates_log(), *) 'hlm_parteh_mode: ',hlm_parteh_mode call endrun(msg=errMsg(sourcefile, __LINE__)) end select - + + ! carbon loss to atmosphere pathways + fates%bc_out(s)%grazing_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%fire_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%rssun_pa(:) = 0.0_r8 fates%bc_out(s)%rssha_pa(:) = 0.0_r8 diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 4681845cce..0168f6b909 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -823,6 +823,10 @@ module FatesInterfaceTypesMod real(r8) :: gpp_site ! Site level GPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] real(r8) :: ar_site ! Site level Autotrophic Resp, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] + ! direct carbon loss to atm pathways + real(r8) :: grazing_closs_to_atm_si ! Loss of carbon to atmosphere via grazing [Site-Level, gC m-2 s-1] + real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, gC m-2 s-1] + end type bc_out_type From 26832fa2fdf8dcfc486e8d98fcddf9d4fe3a84b7 Mon Sep 17 00:00:00 2001 From: Charles D Koven Date: Fri, 7 Mar 2025 15:45:18 -0800 Subject: [PATCH 42/64] fixes on new bc_out vars --- biogeochem/EDPatchDynamicsMod.F90 | 43 +++++++++++++++++-------------- biogeochem/EDPhysiologyMod.F90 | 7 ++--- main/FatesInterfaceMod.F90 | 4 +-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 80af058f02..a530a6857d 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -510,7 +510,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) ! !ARGUMENTS: type (ed_site_type), intent(inout) :: currentSite type (bc_in_type), intent(in) :: bc_in - type (bc_out_type), intent(in) :: bc_out + type (bc_out_type), intent(inout) :: bc_out ! ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: newPatch @@ -755,7 +755,9 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) call CopyPatchMeansTimers(currentPatch, newPatch) - call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, i_disturbance_type) + + call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out) + ! Transfer in litter fluxes from plants in various contexts of death and destruction select case(i_disturbance_type) @@ -1071,7 +1073,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) leaf_burn_frac * leaf_m * nc%n bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + & - leaf_burn_frac * leaf_m * nc%n + leaf_burn_frac * leaf_m * nc%n * ha_per_m2 * days_per_sec end do ! Here the mass is removed from the plant @@ -1420,7 +1422,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) allocate(temp_patch) - call split_patch(currentSite, currentPatch, temp_patch, fraction_to_keep, newp_area) + call split_patch(currentSite, currentPatch, temp_patch, fraction_to_keep, newp_area, bc_out) ! temp_patch%nocomp_pft_label = 0 @@ -1523,7 +1525,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) ! split buffer patch in two, keeping the smaller buffer patch to put into new patches allocate(temp_patch) - call split_patch(currentSite, buffer_patch, temp_patch, fraction_to_keep, newp_area) + call split_patch(currentSite, buffer_patch, temp_patch, fraction_to_keep, newp_area, bc_out) ! give the new patch the intended nocomp PFT label temp_patch%nocomp_pft_label = i_pft @@ -1632,7 +1634,7 @@ end subroutine spawn_patches ! ----------------------------------------------------------------------------------------- - subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, area_to_remove) + subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, area_to_remove, bc_out) ! ! !DESCRIPTION: ! Split a patch into two patches that are identical except in their areas @@ -1643,6 +1645,7 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a type(fates_patch_type) , intent(inout), pointer :: new_patch ! New Patch real(r8), intent(in) :: fraction_to_keep ! fraction of currentPatch to keep, the rest goes to newpatch real(r8), intent(in), optional :: area_to_remove ! area of currentPatch to remove, the rest goes to newpatch + type(bc_out_type) , intent(inout) :: bc_out ! ! !LOCAL VARIABLES: integer :: el ! element loop index @@ -1679,7 +1682,10 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a call CopyPatchMeansTimers(currentPatch, new_patch) - call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, 0) + call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out) + + currentPatch%burnt_frac_litter(:) = 0._r8 + ! Next, we loop through the cohorts in the donor patch, copy them with ! area modified number density into the new-patch, and apply survivorship. @@ -1813,8 +1819,7 @@ end subroutine check_patch_area subroutine TransLitterNewPatch(currentSite, & currentPatch, & newPatch, & - patch_site_areadis, & - dist_type) + patch_site_areadis, bc_out) ! ----------------------------------------------------------------------------------- ! @@ -1863,7 +1868,7 @@ subroutine TransLitterNewPatch(currentSite, & type(fates_patch_type) , intent(inout) :: newPatch ! New patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated ! by current patch - integer, intent(in) :: dist_type ! disturbance type + type(bc_out_type) , intent(inout) :: bc_out ! locals @@ -1989,7 +1994,7 @@ subroutine TransLitterNewPatch(currentSite, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec ! Transfer below ground CWD (none burns) @@ -2020,7 +2025,7 @@ subroutine TransLitterNewPatch(currentSite, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec ! Transfer root fines (none burns) do sl = 1,currentSite%nlevsoil @@ -2091,7 +2096,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in - type(bc_out_type) , intent(in) :: bc_out + type(bc_out_type) , intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2233,7 +2238,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2296,7 +2301,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & burned_mass = num_dead_trees * SF_val_CWD_frac_adj(c) * bstem * & currentCohort%fraction_crown_burned site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec endif new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass * donate_m2 curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass * retain_m2 @@ -2564,7 +2569,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in - type(bc_out_type) , intent(in) :: bc_out + type(bc_out_type) , intent(inout) :: bc_out logical , intent(in) :: clearing_matrix_element ! whether or not to clear vegetation ! @@ -2709,7 +2714,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2770,7 +2775,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & EDPftvarcon_inst%landusechange_frac_burned(pft) site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec else ! all other pools can end up as timber products or burn or go to litter donatable_mass = donatable_mass * (1.0_r8-EDPftvarcon_inst%landusechange_frac_exported(pft)) * & (1.0_r8-EDPftvarcon_inst%landusechange_frac_burned(pft)) @@ -2784,7 +2789,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec trunk_product_site = trunk_product_site + & woodproduct_mass diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index c856b963ea..d3db3c059b 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -451,7 +451,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out type(ed_site_type), intent(inout) :: currentSite type(fates_patch_type), intent(inout) :: currentPatch type(bc_in_type), intent(in) :: bc_in - type(bc_out_type), intent(in) :: bc_out + type(bc_out_type), intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2808,7 +2808,7 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) type(fates_patch_type),intent(inout), target :: currentPatch type(litter_type),intent(inout),target :: litt type(bc_in_type),intent(in) :: bc_in - type(bc_out_type),intent(in) :: bc_out + type(bc_out_type),intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2963,7 +2963,8 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n bc_out%grazing_closs_to_atm_si = bc_out%grazing_closs_to_atm_si + & - leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n * & + ha_per_m2 * days_per_sec ! Assumption: turnover from deadwood and sapwood are lumped together in CWD pool diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 152f4220b3..54a4017d02 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -373,8 +373,8 @@ subroutine zero_bcs(fates,s) end select ! carbon loss to atmosphere pathways - fates%bc_out(s)%grazing_closs_to_atm_si(:) = 0.0_r8 - fates%bc_out(s)%fire_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%grazing_closs_to_atm_si = 0.0_r8 + fates%bc_out(s)%fire_closs_to_atm_si = 0.0_r8 fates%bc_out(s)%rssun_pa(:) = 0.0_r8 fates%bc_out(s)%rssha_pa(:) = 0.0_r8 From dc87f5ba49f9da63fc7d5da85b042f48e7e29364 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 29 Apr 2025 15:48:12 +0200 Subject: [PATCH 43/64] merge conflicts to do with dist_type use --- biogeochem/EDPatchDynamicsMod.F90 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index a530a6857d..1d8b824f92 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -756,7 +756,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) call CopyPatchMeansTimers(currentPatch, newPatch) - call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out) + call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out, i_disturbance_type) ! Transfer in litter fluxes from plants in various contexts of death and destruction @@ -1682,9 +1682,7 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a call CopyPatchMeansTimers(currentPatch, new_patch) - call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out) - - currentPatch%burnt_frac_litter(:) = 0._r8 + call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out, 0) ! Next, we loop through the cohorts in the donor patch, copy them with @@ -1819,7 +1817,7 @@ end subroutine check_patch_area subroutine TransLitterNewPatch(currentSite, & currentPatch, & newPatch, & - patch_site_areadis, bc_out) + patch_site_areadis, bc_out, dist_type) ! ----------------------------------------------------------------------------------- ! @@ -1869,7 +1867,7 @@ subroutine TransLitterNewPatch(currentSite, & real(r8) , intent(in) :: patch_site_areadis ! Area being donated ! by current patch type(bc_out_type) , intent(inout) :: bc_out - + integer, intent(in) :: dist_type ! disturbance type ! locals type(site_massbal_type), pointer :: site_mass From 8816e46557e8906edb909b0151f21abc93ce486e Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 29 Apr 2025 15:48:58 +0200 Subject: [PATCH 44/64] adding references to fates constants --- biogeochem/EDPhysiologyMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index d3db3c059b..e79abceed7 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -33,6 +33,8 @@ module EDPhysiologyMod use FatesConstantsMod, only : megajoules_per_joule use FatesConstantsMod, only : mpa_per_mm_suction use FatesConstantsMod, only : g_per_kg + use FatesConstantsMod, only : ha_per_m2 + use FatesConstantsMod, only : days_per_sec use FatesConstantsMod, only : ndays_per_year use FatesConstantsMod, only : nocomp_bareground use FatesConstantsMod, only : nocomp_bareground_land @@ -490,7 +492,6 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) - site_mass => currentSite%mass_balance(el) ! Fragmentation flux to soil decomposition model [kg/site/day] site_mass%frag_out = site_mass%frag_out + currentPatch%area * & From d5ae0537e596a8566712badf5eaad08b27d285e4 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 13 May 2025 11:13:18 +0200 Subject: [PATCH 45/64] change name of internal FATES_NEP --- main/FatesHistoryInterfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index f18dd6de9c..f9125565c8 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -8530,7 +8530,7 @@ subroutine define_history_vars(this, initialize_variables) upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & index = ih_livestem_mr_si) - call this%set_history_var(vname='FATES_NEP', units='kg m-2 s-1', & + call this%set_history_var(vname='FATES_NEP_INT', units='kg m-2 s-1', & long='net ecosystem production in kg carbon per m2 per second', & use_default='active', avgflag='A', vtype=site_r8, hlms='CLM:ALM', & upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & From 3dea7ea462ea543cf38ed928449fb900abc51301 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:19:05 +0200 Subject: [PATCH 46/64] add the calculation of instantaneous site NPP to the accumulatefluxes routine --- biogeophys/EDAccumulateFluxesMod.F90 | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/biogeophys/EDAccumulateFluxesMod.F90 b/biogeophys/EDAccumulateFluxesMod.F90 index b4f93ba5c9..b38b186681 100644 --- a/biogeophys/EDAccumulateFluxesMod.F90 +++ b/biogeophys/EDAccumulateFluxesMod.F90 @@ -41,7 +41,12 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) use FatesPatchMod, only : fates_patch_type use FatesCohortMod, only : fates_cohort_type use FatesInterfaceTypesMod , only : bc_in_type,bc_out_type - + use EDtypesMod , only : AREA_INV + use clm_time_manager , only : get_curr_days_per_year + use FatesConstantsMod , only : sec_per_day + use FatesConstantsMod , only : days_per_year + use FatesConstantsMod , only : g_per_kg + ! ! !ARGUMENTS integer, intent(in) :: nsites @@ -57,8 +62,9 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) integer :: c ! clm/alm column integer :: s ! ed site integer :: ifp ! index fates patch + real :: ind_per_m2 !---------------------------------------------------------------------- - + do s = 1, nsites ! Note: Do not attempt to accumulate or log any @@ -66,6 +72,9 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) ! It is likely this has not been calculated yet (ELM/CLM) cpatch => sites(s)%oldest_patch + bc_out(s)%npp_acc_site = 0._r8 + bc_out(s)%npp_site = 0._r8 + do while (associated(cpatch)) ifp = cpatch%patchno @@ -75,13 +84,27 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) if( bc_in(s)%filter_photo_pa(ifp) == 3 ) then ccohort => cpatch%shortest do while(associated(ccohort)) - + ind_per_m2 = ccohort%n * AREA_INV ! Accumulate fluxes from hourly to daily values. ! _tstep fluxes are KgC/indiv/timestep _acc are KgC/indiv/day ccohort%gpp_acc = ccohort%gpp_acc + ccohort%gpp_tstep ccohort%resp_m_acc = ccohort%resp_m_acc + ccohort%resp_m_tstep + ! Make npp_acc variable for the site level to add to the NBP balance check + ! Convert from kgC/ind to gC/m2 (i don't think there are actually time units here) + bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + ccohort%gpp_acc - ccohort%resp_m_acc * ind_per_m2 + + ! Net Ecosystem Production [kgC/m2/s]. Use yesterday's growth respiration + ! This is taken from the NEP history variable calculation. + ! first add GPP-Rm and convert units from kgC/indiv/timestep to gC/m2/s + ! then smooth out yesterdays's calculated growth respiration and + ! convert units from kgC/indiv/year to gC/m2/s. + bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & + * ind_per_m2 * g_per_kg / dt_time - & + (ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & + ind_per_m2 * g_per_kg / (days_per_year*sec_per_day) + ccohort%sym_nfix_daily = ccohort%sym_nfix_daily + ccohort%sym_nfix_tstep ! weighted mean of D13C by gpp From ba6a701ff4756dd5319ce8f1b622d9b2dcefa0c6 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:20:34 +0200 Subject: [PATCH 47/64] add bc_out C flux variables to fatesinterface --- main/FatesInterfaceTypesMod.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 0168f6b909..4e3500f7d8 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -822,7 +822,10 @@ module FatesInterfaceTypesMod real(r8) :: hrv_deadstemc_to_prod100c ! Harvested C flux to 100-yr wood product pool [Site-Level, gC m-2 s-1] real(r8) :: gpp_site ! Site level GPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] real(r8) :: ar_site ! Site level Autotrophic Resp, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] - + real(r8) :: npp_site ! Site level timestep-specific NPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] + real(r8) :: npp_acc_site ! Sitelevel, timestep-specific accumulated NPP to account for assimilate but not allocated C in HLM balance check + real(r8) :: fates_total_carbon_site ! Site level total carbon in FATES (g/m2) for HLM balance check + ! direct carbon loss to atm pathways real(r8) :: grazing_closs_to_atm_si ! Loss of carbon to atmosphere via grazing [Site-Level, gC m-2 s-1] real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, gC m-2 s-1] From f3771b98eb4e96a3acafaaffa562d5346fcca1cf Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:28:18 +0200 Subject: [PATCH 48/64] add the total carbon stock to the bc_out variable --- main/EDMainMod.F90 | 13 ++++++++++--- main/FatesInterfaceMod.F90 | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 339615ec58..53777942fe 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -320,7 +320,6 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out) ! Final instantaneous mass balance check call TotalBalanceCheck(currentSite,5) - end subroutine ed_ecosystem_dynamics !-------------------------------------------------------------------------------! @@ -641,7 +640,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) bc_out%ar_site = bc_out%ar_site + (currentCohort%resp_m_acc_hold + & currentCohort%resp_g_acc_hold + currentCohort%resp_excess_hold) * & AREA_INV * currentCohort%n / hlm_days_per_year / sec_per_day - + ! Update the mass balance tracking for the daily nutrient uptake flux ! Then zero out the daily uptakes, they have been used @@ -835,6 +834,11 @@ subroutine ed_update_site( currentSite, bc_in, bc_out, is_restarting ) type(bc_out_type) , intent(inout) :: bc_out logical,intent(in) :: is_restarting ! is this called during restart read? ! + real(r8) :: biomass_stock ! total biomass in Kg/site + real(r8) :: litter_stock ! total litter in Kg/site + real(r8) :: seed_stock ! total seed mass in Kg/site + real(r8) :: total_stock ! total ED carbon in Kg/site + ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: currentPatch !----------------------------------------------------------------------- @@ -856,6 +860,9 @@ subroutine ed_update_site( currentSite, bc_in, bc_out, is_restarting ) call TotalBalanceCheck(currentSite,final_check_id) + call SiteMassStock(currentSite,1,total_stock,biomass_stock,litter_stock,seed_stock) + bc_out%fates_total_carbon_site = total_stock + ! Update recruit L2FRs based on new canopy position call SetRecruitL2FR(currentSite) @@ -968,7 +975,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) call SiteMassStock(currentSite,el,total_stock,biomass_stock,litter_stock,seed_stock) change_in_stock = total_stock - site_mass%old_stock - + flux_in = site_mass%seed_in + & site_mass%net_root_uptake + & site_mass%gpp_acc + & diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 54a4017d02..268a25e6d9 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -412,6 +412,9 @@ subroutine zero_bcs(fates,s) ! Land Use realated fates%bc_out(s)%gpp_site = 0.0_r8 fates%bc_out(s)%ar_site = 0.0_r8 + fates%bc_out(s)%npp_site = 0.0_r8 + fates%bc_out(s)%npp_acc_site = 0.0_r8 + fates%bc_out(s)%fates_total_carbon_site = 0.0_r8 fates%bc_out(s)%hrv_deadstemc_to_prod10c = 0.0_r8 fates%bc_out(s)%hrv_deadstemc_to_prod100c = 0.0_r8 From df85c8c17b1a1aa8bd1c34c76a3a3b5c32f27ad8 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Sun, 25 May 2025 18:20:39 +0200 Subject: [PATCH 49/64] change logic in EDaccumulatefluxes --- biogeophys/EDAccumulateFluxesMod.F90 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/biogeophys/EDAccumulateFluxesMod.F90 b/biogeophys/EDAccumulateFluxesMod.F90 index b38b186681..9befde6321 100644 --- a/biogeophys/EDAccumulateFluxesMod.F90 +++ b/biogeophys/EDAccumulateFluxesMod.F90 @@ -85,26 +85,34 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) ccohort => cpatch%shortest do while(associated(ccohort)) ind_per_m2 = ccohort%n * AREA_INV + ! Accumulate fluxes from hourly to daily values. ! _tstep fluxes are KgC/indiv/timestep _acc are KgC/indiv/day - ccohort%gpp_acc = ccohort%gpp_acc + ccohort%gpp_tstep ccohort%resp_m_acc = ccohort%resp_m_acc + ccohort%resp_m_tstep ! Make npp_acc variable for the site level to add to the NBP balance check - ! Convert from kgC/ind to gC/m2 (i don't think there are actually time units here) - bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + ccohort%gpp_acc - ccohort%resp_m_acc * ind_per_m2 + ! Convert from kgC/ind to gC/m2 + if(.not.ccohort%isnew)then + bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + & + (ccohort%gpp_acc - ccohort%resp_m_acc) & + * ind_per_m2 * g_per_kg & + -(ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & + ind_per_m2 * g_per_kg * dt_time/(days_per_year*sec_per_day) + ! gresp is converted from kgC/indiv/year to gC/m2/timestep. + endif ! Net Ecosystem Production [kgC/m2/s]. Use yesterday's growth respiration ! This is taken from the NEP history variable calculation. ! first add GPP-Rm and convert units from kgC/indiv/timestep to gC/m2/s ! then smooth out yesterdays's calculated growth respiration and ! convert units from kgC/indiv/year to gC/m2/s. - bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & + if(.not.ccohort%isnew)then + bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & * ind_per_m2 * g_per_kg / dt_time - & (ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & ind_per_m2 * g_per_kg / (days_per_year*sec_per_day) - + endif ccohort%sym_nfix_daily = ccohort%sym_nfix_daily + ccohort%sym_nfix_tstep ! weighted mean of D13C by gpp @@ -130,7 +138,8 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) cpatch => cpatch%younger end do ! while(associated(cpatch)) - end do + + end do return end subroutine AccumulateFluxes_ED From c953c44703950ecb1e9bbfa1db8284fc242379f3 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 5 Jun 2025 08:45:56 +0200 Subject: [PATCH 50/64] rename FATES_NEP --- main/FatesHistoryInterfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index f9125565c8..f18dd6de9c 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -8530,7 +8530,7 @@ subroutine define_history_vars(this, initialize_variables) upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & index = ih_livestem_mr_si) - call this%set_history_var(vname='FATES_NEP_INT', units='kg m-2 s-1', & + call this%set_history_var(vname='FATES_NEP', units='kg m-2 s-1', & long='net ecosystem production in kg carbon per m2 per second', & use_default='active', avgflag='A', vtype=site_r8, hlms='CLM:ALM', & upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & From 47ffce840c3143bd4428913ba67679db096b609b Mon Sep 17 00:00:00 2001 From: Charles D Koven Date: Thu, 6 Mar 2025 17:37:27 -0800 Subject: [PATCH 51/64] added grazing and burn fluxes as bc_out variables so that HLMs can calculate NBP --- biogeochem/EDPatchDynamicsMod.F90 | 41 +++++++++++------- biogeochem/EDPhysiologyMod.F90 | 70 ++++++++++++++++--------------- main/EDMainMod.F90 | 4 +- main/FatesInterfaceMod.F90 | 6 ++- main/FatesInterfaceTypesMod.F90 | 4 ++ 5 files changed, 74 insertions(+), 51 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index b1fc9af66d..80af058f02 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -48,6 +48,7 @@ module EDPatchDynamicsMod use FatesConstantsMod , only : nocomp_bareground use FatesInterfaceTypesMod , only : hlm_use_planthydro use FatesInterfaceTypesMod , only : bc_in_type + use FatesInterfaceTypesMod , only : bc_out_type use FatesInterfaceTypesMod , only : numpft use FatesInterfaceTypesMod , only : hlm_stepsize use FatesInterfaceTypesMod , only : hlm_use_sp @@ -482,7 +483,7 @@ end subroutine disturbance_rates ! ============================================================================ - subroutine spawn_patches( currentSite, bc_in) + subroutine spawn_patches( currentSite, bc_in, bc_out) ! ! !DESCRIPTION: ! In this subroutine, the following happens, @@ -509,6 +510,7 @@ subroutine spawn_patches( currentSite, bc_in) ! !ARGUMENTS: type (ed_site_type), intent(inout) :: currentSite type (bc_in_type), intent(in) :: bc_in + type (bc_out_type), intent(in) :: bc_out ! ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: newPatch @@ -768,13 +770,13 @@ subroutine spawn_patches( currentSite, bc_in) end if case (dtype_ifire) call fire_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis,bc_in) + newPatch, patch_site_areadis,bc_in, bc_out) case (dtype_ifall) call mortality_litter_fluxes(currentSite, currentPatch, & newPatch, patch_site_areadis,bc_in) case (dtype_ilandusechange) call landusechange_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis,bc_in, & + newPatch, patch_site_areadis,bc_in, bc_out, & clearing_matrix(i_donorpatch_landuse_type,i_landusechange_receiverpatchlabel)) ! if land use change, then may need to change nocomp pft, so tag as having transitioned LU @@ -1068,11 +1070,8 @@ subroutine spawn_patches( currentSite, bc_in) currentSite%mass_balance(el)%burn_flux_to_atm + & leaf_burn_frac * leaf_m * nc%n - ! This diagnostic only tracks - currentSite%flux_diags%elem(el)%burned_liveveg = & - currentSite%flux_diags%elem(el)%burned_liveveg + & - leaf_burn_frac * leaf_m * nc%n * area_inv - + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + & + leaf_burn_frac * leaf_m * nc%n end do ! Here the mass is removed from the plant @@ -1989,7 +1988,9 @@ subroutine TransLitterNewPatch(currentSite, & curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass*retain_m2 site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + ! Transfer below ground CWD (none burns) do sl = 1,currentSite%nlevsoil @@ -2018,7 +2019,9 @@ subroutine TransLitterNewPatch(currentSite, & curr_litt%leaf_fines(dcmpy) = curr_litt%leaf_fines(dcmpy) + donatable_mass*retain_m2 site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + ! Transfer root fines (none burns) do sl = 1,currentSite%nlevsoil donatable_mass = curr_litt%root_fines(dcmpy,sl) * patch_site_areadis @@ -2068,7 +2071,7 @@ end subroutine TransLitterNewPatch ! ============================================================================ subroutine fire_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis, bc_in) + newPatch, patch_site_areadis, bc_in, bc_out) ! ! !DESCRIPTION: ! CWD pool burned by a fire. @@ -2088,6 +2091,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in + type(bc_out_type) , intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -2229,8 +2233,8 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - - + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2292,6 +2296,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & burned_mass = num_dead_trees * SF_val_CWD_frac_adj(c) * bstem * & currentCohort%fraction_crown_burned site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass endif new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass * donate_m2 curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass * retain_m2 @@ -2542,7 +2547,7 @@ end subroutine mortality_litter_fluxes ! ============================================================================ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & - newPatch, patch_site_areadis, bc_in, & + newPatch, patch_site_areadis, bc_in, bc_out, & clearing_matrix_element) ! ! !DESCRIPTION: @@ -2559,6 +2564,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in + type(bc_out_type) , intent(in) :: bc_out logical , intent(in) :: clearing_matrix_element ! whether or not to clear vegetation ! @@ -2702,7 +2708,9 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & end do site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - + + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2762,6 +2770,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & EDPftvarcon_inst%landusechange_frac_burned(pft) site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass else ! all other pools can end up as timber products or burn or go to litter donatable_mass = donatable_mass * (1.0_r8-EDPftvarcon_inst%landusechange_frac_exported(pft)) * & (1.0_r8-EDPftvarcon_inst%landusechange_frac_burned(pft)) @@ -2775,6 +2784,8 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + trunk_product_site = trunk_product_site + & woodproduct_mass diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 1f247de245..b961e27370 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -432,7 +432,7 @@ end subroutine GenerateDamageAndLitterFluxes ! ============================================================================ - subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) + subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out ) ! ----------------------------------------------------------------------------------- ! @@ -440,8 +440,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) ! associated with seed turnover, seed influx, litterfall from live and ! dead plants, germination, and fragmentation. ! - ! At this time we do not have explicit herbivory, and burning losses to litter - ! are handled elsewhere. + ! Herbivory is handled here. burning losses to litter are handled elsewhere. ! ! Note: The processes conducted here DO NOT handle litter fluxes associated ! with disturbance. Those fluxes are handled elsewhere (EDPatchDynamcisMod) @@ -455,6 +454,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) type(ed_site_type), intent(inout) :: currentSite type(fates_patch_type), intent(inout) :: currentPatch type(bc_in_type), intent(in) :: bc_in + type(bc_out_type), intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -473,34 +473,34 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in ) site_mass => currentSite%mass_balance(el), & diag => currentSite%flux_diags%elem(el)) - ! Calculate loss rate of viable seeds to litter - call SeedDecay(litt, currentPatch, bc_in) - - ! Calculate seed germination rate, the status flags prevent - ! germination from occuring when the site is in a drought - ! (for drought deciduous) or too cold (for cold deciduous) - call SeedGermination(litt, currentSite%cstatus, currentSite%dstatus(1:numpft), bc_in, currentPatch) - - ! Send fluxes from newly created litter into the litter pools - ! This litter flux is from non-disturbance inducing mortality, as well - ! as litter fluxes from live trees - call CWDInput(currentSite, currentPatch, litt,bc_in) - - ! Only calculate fragmentation flux over layers that are active - ! (RGK-Mar2019) SHOULD WE MAX THIS AT 1? DONT HAVE TO - - nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) - call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) - - ! Fragmentation flux to soil decomposition model [kg/site/day] - site_mass%frag_out = site_mass%frag_out + currentPatch%area * & - ( sum(litt%ag_cwd_frag) + sum(litt%bg_cwd_frag) + & - sum(litt%leaf_fines_frag) + sum(litt%root_fines_frag) + & - sum(litt%seed_decay) + sum(litt%seed_germ_decay)) - - ! Track total seed decay diagnostic in [kg/m2/day] - diag%tot_seed_turnover = diag%tot_seed_turnover + & - (sum(litt%seed_decay) + sum(litt%seed_germ_decay))*currentPatch%area*area_inv + ! Calculate loss rate of viable seeds to litter + call SeedDecay(litt, currentPatch, bc_in) + + + ! Calculate seed germination rate, the status flags prevent + ! germination from occuring when the site is in a drought + ! (for drought deciduous) or too cold (for cold deciduous) + call SeedGermination(litt, currentSite%cstatus, currentSite%dstatus(1:numpft), bc_in, currentPatch) + + ! Send fluxes from newly created litter into the litter pools + ! This litter flux is from non-disturbance inducing mortality, as well + ! as litter fluxes from live trees + call CWDInput(currentSite, currentPatch, litt,bc_in, bc_out) + + ! Only calculate fragmentation flux over layers that are active + ! (RGK-Mar2019) SHOULD WE MAX THIS AT 1? DONT HAVE TO + + nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) + call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) + + site_mass => currentSite%mass_balance(el) + + ! Fragmentation flux to soil decomposition model [kg/site/day] + site_mass%frag_out = site_mass%frag_out + currentPatch%area * & + ( sum(litt%ag_cwd_frag) + sum(litt%bg_cwd_frag) + & + sum(litt%leaf_fines_frag) + sum(litt%root_fines_frag) + & + sum(litt%seed_decay) + sum(litt%seed_germ_decay)) + end associate end do @@ -2785,7 +2785,7 @@ end subroutine recruitment ! ====================================================================================== - subroutine CWDInput( currentSite, currentPatch, litt, bc_in) + subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) ! ! !DESCRIPTION: @@ -2805,6 +2805,7 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in) type(fates_patch_type),intent(inout), target :: currentPatch type(litter_type),intent(inout),target :: litt type(bc_in_type),intent(in) :: bc_in + type(bc_out_type),intent(in) :: bc_out ! ! !LOCAL VARIABLES: @@ -2952,12 +2953,15 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in) elflux_diags%root_litter_input(pft) + & (fnrt_m_turnover + store_m_turnover ) * currentCohort%n - ! send the part of the herbivory flux that doesn't go to litter to the atmosphere + ! send the part of the herbivory flux that doesn't go to litter to the atmosphere (and also for tracking) site_mass%herbivory_flux_out = & site_mass%herbivory_flux_out + & leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + bc_out%grazing_closs_to_atm_si = bc_out%grazing_closs_to_atm_si + & + leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + ! Assumption: turnover from deadwood and sapwood are lumped together in CWD pool !update partitioning of stem wood (struct + sapw) to cwd based on cohort dbh diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index bfba6d7d56..d36e3d825c 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -294,7 +294,7 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out) ! make new patches from disturbed land if (do_patch_dynamics.eq.itrue ) then - call spawn_patches(currentSite, bc_in) + call spawn_patches(currentSite, bc_in, bc_out) call TotalBalanceCheck(currentSite,3) @@ -784,7 +784,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) call GenerateDamageAndLitterFluxes( currentSite, currentPatch, bc_in) - call PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in) + call PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out) call PreDisturbanceIntegrateLitter(currentPatch ) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index e949f4acab..038b8e6ddb 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -371,7 +371,11 @@ subroutine zero_bcs(fates,s) write(fates_log(), *) 'hlm_parteh_mode: ',hlm_parteh_mode call endrun(msg=errMsg(sourcefile, __LINE__)) end select - + + ! carbon loss to atmosphere pathways + fates%bc_out(s)%grazing_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%fire_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%rssun_pa(:) = 0.0_r8 fates%bc_out(s)%rssha_pa(:) = 0.0_r8 diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 9655d833e0..d1404d546c 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -805,6 +805,10 @@ module FatesInterfaceTypesMod real(r8) :: gpp_site ! Site level GPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] real(r8) :: ar_site ! Site level Autotrophic Resp, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] + ! direct carbon loss to atm pathways + real(r8) :: grazing_closs_to_atm_si ! Loss of carbon to atmosphere via grazing [Site-Level, gC m-2 s-1] + real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, gC m-2 s-1] + end type bc_out_type From 6f591b79297b413840d8f18d73e7c5fc13baf09f Mon Sep 17 00:00:00 2001 From: Charles D Koven Date: Fri, 7 Mar 2025 15:45:18 -0800 Subject: [PATCH 52/64] fixes on new bc_out vars --- biogeochem/EDPatchDynamicsMod.F90 | 43 +++++++++++++++++-------------- biogeochem/EDPhysiologyMod.F90 | 7 ++--- main/FatesInterfaceMod.F90 | 4 +-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 80af058f02..a530a6857d 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -510,7 +510,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) ! !ARGUMENTS: type (ed_site_type), intent(inout) :: currentSite type (bc_in_type), intent(in) :: bc_in - type (bc_out_type), intent(in) :: bc_out + type (bc_out_type), intent(inout) :: bc_out ! ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: newPatch @@ -755,7 +755,9 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) call CopyPatchMeansTimers(currentPatch, newPatch) - call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, i_disturbance_type) + + call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out) + ! Transfer in litter fluxes from plants in various contexts of death and destruction select case(i_disturbance_type) @@ -1071,7 +1073,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) leaf_burn_frac * leaf_m * nc%n bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + & - leaf_burn_frac * leaf_m * nc%n + leaf_burn_frac * leaf_m * nc%n * ha_per_m2 * days_per_sec end do ! Here the mass is removed from the plant @@ -1420,7 +1422,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) allocate(temp_patch) - call split_patch(currentSite, currentPatch, temp_patch, fraction_to_keep, newp_area) + call split_patch(currentSite, currentPatch, temp_patch, fraction_to_keep, newp_area, bc_out) ! temp_patch%nocomp_pft_label = 0 @@ -1523,7 +1525,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) ! split buffer patch in two, keeping the smaller buffer patch to put into new patches allocate(temp_patch) - call split_patch(currentSite, buffer_patch, temp_patch, fraction_to_keep, newp_area) + call split_patch(currentSite, buffer_patch, temp_patch, fraction_to_keep, newp_area, bc_out) ! give the new patch the intended nocomp PFT label temp_patch%nocomp_pft_label = i_pft @@ -1632,7 +1634,7 @@ end subroutine spawn_patches ! ----------------------------------------------------------------------------------------- - subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, area_to_remove) + subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, area_to_remove, bc_out) ! ! !DESCRIPTION: ! Split a patch into two patches that are identical except in their areas @@ -1643,6 +1645,7 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a type(fates_patch_type) , intent(inout), pointer :: new_patch ! New Patch real(r8), intent(in) :: fraction_to_keep ! fraction of currentPatch to keep, the rest goes to newpatch real(r8), intent(in), optional :: area_to_remove ! area of currentPatch to remove, the rest goes to newpatch + type(bc_out_type) , intent(inout) :: bc_out ! ! !LOCAL VARIABLES: integer :: el ! element loop index @@ -1679,7 +1682,10 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a call CopyPatchMeansTimers(currentPatch, new_patch) - call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, 0) + call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out) + + currentPatch%burnt_frac_litter(:) = 0._r8 + ! Next, we loop through the cohorts in the donor patch, copy them with ! area modified number density into the new-patch, and apply survivorship. @@ -1813,8 +1819,7 @@ end subroutine check_patch_area subroutine TransLitterNewPatch(currentSite, & currentPatch, & newPatch, & - patch_site_areadis, & - dist_type) + patch_site_areadis, bc_out) ! ----------------------------------------------------------------------------------- ! @@ -1863,7 +1868,7 @@ subroutine TransLitterNewPatch(currentSite, & type(fates_patch_type) , intent(inout) :: newPatch ! New patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated ! by current patch - integer, intent(in) :: dist_type ! disturbance type + type(bc_out_type) , intent(inout) :: bc_out ! locals @@ -1989,7 +1994,7 @@ subroutine TransLitterNewPatch(currentSite, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec ! Transfer below ground CWD (none burns) @@ -2020,7 +2025,7 @@ subroutine TransLitterNewPatch(currentSite, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec ! Transfer root fines (none burns) do sl = 1,currentSite%nlevsoil @@ -2091,7 +2096,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in - type(bc_out_type) , intent(in) :: bc_out + type(bc_out_type) , intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2233,7 +2238,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2296,7 +2301,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, & burned_mass = num_dead_trees * SF_val_CWD_frac_adj(c) * bstem * & currentCohort%fraction_crown_burned site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec endif new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass * donate_m2 curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass * retain_m2 @@ -2564,7 +2569,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & type(fates_patch_type) , intent(inout), target :: newPatch ! New Patch real(r8) , intent(in) :: patch_site_areadis ! Area being donated type(bc_in_type) , intent(in) :: bc_in - type(bc_out_type) , intent(in) :: bc_out + type(bc_out_type) , intent(inout) :: bc_out logical , intent(in) :: clearing_matrix_element ! whether or not to clear vegetation ! @@ -2709,7 +2714,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, & bc_in%max_rooting_depth_index_col) @@ -2770,7 +2775,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & EDPftvarcon_inst%landusechange_frac_burned(pft) site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec else ! all other pools can end up as timber products or burn or go to litter donatable_mass = donatable_mass * (1.0_r8-EDPftvarcon_inst%landusechange_frac_exported(pft)) * & (1.0_r8-EDPftvarcon_inst%landusechange_frac_burned(pft)) @@ -2784,7 +2789,7 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, & site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass - bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass + bc_out%fire_closs_to_atm_si = bc_out%fire_closs_to_atm_si + burned_mass * ha_per_m2 * days_per_sec trunk_product_site = trunk_product_site + & woodproduct_mass diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index b961e27370..c339e159f4 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -454,7 +454,7 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out type(ed_site_type), intent(inout) :: currentSite type(fates_patch_type), intent(inout) :: currentPatch type(bc_in_type), intent(in) :: bc_in - type(bc_out_type), intent(in) :: bc_out + type(bc_out_type), intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2805,7 +2805,7 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) type(fates_patch_type),intent(inout), target :: currentPatch type(litter_type),intent(inout),target :: litt type(bc_in_type),intent(in) :: bc_in - type(bc_out_type),intent(in) :: bc_out + type(bc_out_type),intent(inout) :: bc_out ! ! !LOCAL VARIABLES: @@ -2960,7 +2960,8 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in, bc_out) leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n bc_out%grazing_closs_to_atm_si = bc_out%grazing_closs_to_atm_si + & - leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n + leaf_herbivory * (1._r8 - herbivory_element_use_efficiency) * currentCohort%n * & + ha_per_m2 * days_per_sec ! Assumption: turnover from deadwood and sapwood are lumped together in CWD pool diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 038b8e6ddb..8cda9ec283 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -373,8 +373,8 @@ subroutine zero_bcs(fates,s) end select ! carbon loss to atmosphere pathways - fates%bc_out(s)%grazing_closs_to_atm_si(:) = 0.0_r8 - fates%bc_out(s)%fire_closs_to_atm_si(:) = 0.0_r8 + fates%bc_out(s)%grazing_closs_to_atm_si = 0.0_r8 + fates%bc_out(s)%fire_closs_to_atm_si = 0.0_r8 fates%bc_out(s)%rssun_pa(:) = 0.0_r8 fates%bc_out(s)%rssha_pa(:) = 0.0_r8 From 29c11ed403b330cbeaca34860c29bf666c65e531 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 29 Apr 2025 15:48:12 +0200 Subject: [PATCH 53/64] merge conflicts to do with dist_type use --- biogeochem/EDPatchDynamicsMod.F90 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index a530a6857d..1d8b824f92 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -756,7 +756,7 @@ subroutine spawn_patches( currentSite, bc_in, bc_out) call CopyPatchMeansTimers(currentPatch, newPatch) - call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out) + call TransLitterNewPatch( currentSite, currentPatch, newPatch, patch_site_areadis, bc_out, i_disturbance_type) ! Transfer in litter fluxes from plants in various contexts of death and destruction @@ -1682,9 +1682,7 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a call CopyPatchMeansTimers(currentPatch, new_patch) - call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out) - - currentPatch%burnt_frac_litter(:) = 0._r8 + call TransLitterNewPatch( currentSite, currentPatch, new_patch, temp_area, bc_out, 0) ! Next, we loop through the cohorts in the donor patch, copy them with @@ -1819,7 +1817,7 @@ end subroutine check_patch_area subroutine TransLitterNewPatch(currentSite, & currentPatch, & newPatch, & - patch_site_areadis, bc_out) + patch_site_areadis, bc_out, dist_type) ! ----------------------------------------------------------------------------------- ! @@ -1869,7 +1867,7 @@ subroutine TransLitterNewPatch(currentSite, & real(r8) , intent(in) :: patch_site_areadis ! Area being donated ! by current patch type(bc_out_type) , intent(inout) :: bc_out - + integer, intent(in) :: dist_type ! disturbance type ! locals type(site_massbal_type), pointer :: site_mass From f492cc565b72ab58d5f7573a3d12669b9536eb86 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 29 Apr 2025 15:48:58 +0200 Subject: [PATCH 54/64] adding references to fates constants --- biogeochem/EDPhysiologyMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index c339e159f4..c58b718a1f 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -34,6 +34,8 @@ module EDPhysiologyMod use FatesConstantsMod, only : megajoules_per_joule use FatesConstantsMod, only : mpa_per_mm_suction use FatesConstantsMod, only : g_per_kg + use FatesConstantsMod, only : ha_per_m2 + use FatesConstantsMod, only : days_per_sec use FatesConstantsMod, only : ndays_per_year use FatesConstantsMod, only : nocomp_bareground use FatesConstantsMod, only : nocomp_bareground_land @@ -493,7 +495,6 @@ subroutine PreDisturbanceLitterFluxes( currentSite, currentPatch, bc_in, bc_out nlev_eff_decomp = max(bc_in%max_rooting_depth_index_col, 1) call CWDOut(litt,currentPatch%fragmentation_scaler,nlev_eff_decomp) - site_mass => currentSite%mass_balance(el) ! Fragmentation flux to soil decomposition model [kg/site/day] site_mass%frag_out = site_mass%frag_out + currentPatch%area * & From 1ce8da8067f35c1c292d31c996163c341cc3a310 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 13 May 2025 11:13:18 +0200 Subject: [PATCH 55/64] change name of internal FATES_NEP --- main/FatesHistoryInterfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 86d3bbeddb..01129f08f4 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -8830,7 +8830,7 @@ subroutine define_history_vars(this, initialize_variables) upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & index = ih_livestem_mr_si) - call this%set_history_var(vname='FATES_NEP', units='kg m-2 s-1', & + call this%set_history_var(vname='FATES_NEP_INT', units='kg m-2 s-1', & long='net ecosystem production in kg carbon per m2 per second', & use_default='active', avgflag='A', vtype=site_r8, hlms='CLM:ALM', & upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & From dca5d75c85168d66f0dcca5a6cf20791ec81489c Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:19:05 +0200 Subject: [PATCH 56/64] add the calculation of instantaneous site NPP to the accumulatefluxes routine --- biogeophys/EDAccumulateFluxesMod.F90 | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/biogeophys/EDAccumulateFluxesMod.F90 b/biogeophys/EDAccumulateFluxesMod.F90 index b4f93ba5c9..b38b186681 100644 --- a/biogeophys/EDAccumulateFluxesMod.F90 +++ b/biogeophys/EDAccumulateFluxesMod.F90 @@ -41,7 +41,12 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) use FatesPatchMod, only : fates_patch_type use FatesCohortMod, only : fates_cohort_type use FatesInterfaceTypesMod , only : bc_in_type,bc_out_type - + use EDtypesMod , only : AREA_INV + use clm_time_manager , only : get_curr_days_per_year + use FatesConstantsMod , only : sec_per_day + use FatesConstantsMod , only : days_per_year + use FatesConstantsMod , only : g_per_kg + ! ! !ARGUMENTS integer, intent(in) :: nsites @@ -57,8 +62,9 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) integer :: c ! clm/alm column integer :: s ! ed site integer :: ifp ! index fates patch + real :: ind_per_m2 !---------------------------------------------------------------------- - + do s = 1, nsites ! Note: Do not attempt to accumulate or log any @@ -66,6 +72,9 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) ! It is likely this has not been calculated yet (ELM/CLM) cpatch => sites(s)%oldest_patch + bc_out(s)%npp_acc_site = 0._r8 + bc_out(s)%npp_site = 0._r8 + do while (associated(cpatch)) ifp = cpatch%patchno @@ -75,13 +84,27 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) if( bc_in(s)%filter_photo_pa(ifp) == 3 ) then ccohort => cpatch%shortest do while(associated(ccohort)) - + ind_per_m2 = ccohort%n * AREA_INV ! Accumulate fluxes from hourly to daily values. ! _tstep fluxes are KgC/indiv/timestep _acc are KgC/indiv/day ccohort%gpp_acc = ccohort%gpp_acc + ccohort%gpp_tstep ccohort%resp_m_acc = ccohort%resp_m_acc + ccohort%resp_m_tstep + ! Make npp_acc variable for the site level to add to the NBP balance check + ! Convert from kgC/ind to gC/m2 (i don't think there are actually time units here) + bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + ccohort%gpp_acc - ccohort%resp_m_acc * ind_per_m2 + + ! Net Ecosystem Production [kgC/m2/s]. Use yesterday's growth respiration + ! This is taken from the NEP history variable calculation. + ! first add GPP-Rm and convert units from kgC/indiv/timestep to gC/m2/s + ! then smooth out yesterdays's calculated growth respiration and + ! convert units from kgC/indiv/year to gC/m2/s. + bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & + * ind_per_m2 * g_per_kg / dt_time - & + (ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & + ind_per_m2 * g_per_kg / (days_per_year*sec_per_day) + ccohort%sym_nfix_daily = ccohort%sym_nfix_daily + ccohort%sym_nfix_tstep ! weighted mean of D13C by gpp From c9db9bd84e00e4fa2ace5daee8b59721c8ee2373 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:20:34 +0200 Subject: [PATCH 57/64] add bc_out C flux variables to fatesinterface --- main/FatesInterfaceTypesMod.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index d1404d546c..16aa9563bd 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -804,7 +804,10 @@ module FatesInterfaceTypesMod real(r8) :: hrv_deadstemc_to_prod100c ! Harvested C flux to 100-yr wood product pool [Site-Level, gC m-2 s-1] real(r8) :: gpp_site ! Site level GPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] real(r8) :: ar_site ! Site level Autotrophic Resp, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] - + real(r8) :: npp_site ! Site level timestep-specific NPP, for NBP diagnosis in HLM [Site-Level, gC m-2 s-1] + real(r8) :: npp_acc_site ! Sitelevel, timestep-specific accumulated NPP to account for assimilate but not allocated C in HLM balance check + real(r8) :: fates_total_carbon_site ! Site level total carbon in FATES (g/m2) for HLM balance check + ! direct carbon loss to atm pathways real(r8) :: grazing_closs_to_atm_si ! Loss of carbon to atmosphere via grazing [Site-Level, gC m-2 s-1] real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, gC m-2 s-1] From 7a304a2023ee90ad6ef21eed24d759b76d8ad39e Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 20 May 2025 18:28:18 +0200 Subject: [PATCH 58/64] add the total carbon stock to the bc_out variable --- main/EDMainMod.F90 | 16 ++++++++++++---- main/FatesInterfaceMod.F90 | 3 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index d36e3d825c..8fa97d3b6d 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -320,7 +320,6 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out) ! Final instantaneous mass balance check call TotalBalanceCheck(currentSite,5) - end subroutine ed_ecosystem_dynamics !-------------------------------------------------------------------------------! @@ -642,8 +641,9 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) bc_out%gpp_site = bc_out%gpp_site + currentCohort%gpp_acc_hold * & AREA_INV * currentCohort%n / real( hlm_days_per_year,r8) / sec_per_day bc_out%ar_site = bc_out%ar_site + (currentCohort%resp_m_acc_hold + & - currentCohort%resp_g_acc_hold + currentCohort%resp_excess_hold*real(hlm_days_per_year,r8) ) * & - AREA_INV * currentCohort%n / real( hlm_days_per_year,r8) / sec_per_day + currentCohort%resp_g_acc_hold + currentCohort%resp_excess_hold) * & + AREA_INV * currentCohort%n / hlm_days_per_year / sec_per_day + ! Update the mass balance tracking for the daily nutrient uptake flux ! Then zero out the daily uptakes, they have been used @@ -837,6 +837,11 @@ subroutine ed_update_site( currentSite, bc_in, bc_out, is_restarting ) type(bc_out_type) , intent(inout) :: bc_out logical,intent(in) :: is_restarting ! is this called during restart read? ! + real(r8) :: biomass_stock ! total biomass in Kg/site + real(r8) :: litter_stock ! total litter in Kg/site + real(r8) :: seed_stock ! total seed mass in Kg/site + real(r8) :: total_stock ! total ED carbon in Kg/site + ! !LOCAL VARIABLES: type (fates_patch_type) , pointer :: currentPatch !----------------------------------------------------------------------- @@ -858,6 +863,9 @@ subroutine ed_update_site( currentSite, bc_in, bc_out, is_restarting ) call TotalBalanceCheck(currentSite,final_check_id) + call SiteMassStock(currentSite,1,total_stock,biomass_stock,litter_stock,seed_stock) + bc_out%fates_total_carbon_site = total_stock + ! Update recruit L2FRs based on new canopy position call SetRecruitL2FR(currentSite) @@ -970,7 +978,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) call SiteMassStock(currentSite,el,total_stock,biomass_stock,litter_stock,seed_stock) change_in_stock = total_stock - site_mass%old_stock - + flux_in = site_mass%seed_in + & site_mass%net_root_uptake + & site_mass%gpp_acc + & diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 8cda9ec283..27326c8b9d 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -412,6 +412,9 @@ subroutine zero_bcs(fates,s) ! Land Use realated fates%bc_out(s)%gpp_site = 0.0_r8 fates%bc_out(s)%ar_site = 0.0_r8 + fates%bc_out(s)%npp_site = 0.0_r8 + fates%bc_out(s)%npp_acc_site = 0.0_r8 + fates%bc_out(s)%fates_total_carbon_site = 0.0_r8 fates%bc_out(s)%hrv_deadstemc_to_prod10c = 0.0_r8 fates%bc_out(s)%hrv_deadstemc_to_prod100c = 0.0_r8 From a99ed54ad2c100ceb86c9bfe02770213fa69e336 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Sun, 25 May 2025 18:20:39 +0200 Subject: [PATCH 59/64] change logic in EDaccumulatefluxes --- biogeophys/EDAccumulateFluxesMod.F90 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/biogeophys/EDAccumulateFluxesMod.F90 b/biogeophys/EDAccumulateFluxesMod.F90 index b38b186681..9befde6321 100644 --- a/biogeophys/EDAccumulateFluxesMod.F90 +++ b/biogeophys/EDAccumulateFluxesMod.F90 @@ -85,26 +85,34 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) ccohort => cpatch%shortest do while(associated(ccohort)) ind_per_m2 = ccohort%n * AREA_INV + ! Accumulate fluxes from hourly to daily values. ! _tstep fluxes are KgC/indiv/timestep _acc are KgC/indiv/day - ccohort%gpp_acc = ccohort%gpp_acc + ccohort%gpp_tstep ccohort%resp_m_acc = ccohort%resp_m_acc + ccohort%resp_m_tstep ! Make npp_acc variable for the site level to add to the NBP balance check - ! Convert from kgC/ind to gC/m2 (i don't think there are actually time units here) - bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + ccohort%gpp_acc - ccohort%resp_m_acc * ind_per_m2 + ! Convert from kgC/ind to gC/m2 + if(.not.ccohort%isnew)then + bc_out(s)%npp_acc_site = bc_out(s)%npp_acc_site + & + (ccohort%gpp_acc - ccohort%resp_m_acc) & + * ind_per_m2 * g_per_kg & + -(ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & + ind_per_m2 * g_per_kg * dt_time/(days_per_year*sec_per_day) + ! gresp is converted from kgC/indiv/year to gC/m2/timestep. + endif ! Net Ecosystem Production [kgC/m2/s]. Use yesterday's growth respiration ! This is taken from the NEP history variable calculation. ! first add GPP-Rm and convert units from kgC/indiv/timestep to gC/m2/s ! then smooth out yesterdays's calculated growth respiration and ! convert units from kgC/indiv/year to gC/m2/s. - bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & + if(.not.ccohort%isnew)then + bc_out(s)%npp_site = bc_out(s)%npp_site + (ccohort%gpp_tstep-ccohort%resp_m_tstep) & * ind_per_m2 * g_per_kg / dt_time - & (ccohort%resp_g_acc_hold+ccohort%resp_excess_hold) * & ind_per_m2 * g_per_kg / (days_per_year*sec_per_day) - + endif ccohort%sym_nfix_daily = ccohort%sym_nfix_daily + ccohort%sym_nfix_tstep ! weighted mean of D13C by gpp @@ -130,7 +138,8 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) cpatch => cpatch%younger end do ! while(associated(cpatch)) - end do + + end do return end subroutine AccumulateFluxes_ED From 96979bf2802dd885c9ed43d85363b3655f432d47 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 5 Jun 2025 08:45:56 +0200 Subject: [PATCH 60/64] rename FATES_NEP --- main/FatesHistoryInterfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 01129f08f4..86d3bbeddb 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -8830,7 +8830,7 @@ subroutine define_history_vars(this, initialize_variables) upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & index = ih_livestem_mr_si) - call this%set_history_var(vname='FATES_NEP_INT', units='kg m-2 s-1', & + call this%set_history_var(vname='FATES_NEP', units='kg m-2 s-1', & long='net ecosystem production in kg carbon per m2 per second', & use_default='active', avgflag='A', vtype=site_r8, hlms='CLM:ALM', & upfreq=group_hifr_simple, ivar=ivar, initialize=initialize_variables, & From e3737335f65b02c9fe722596493c58098f53d09c Mon Sep 17 00:00:00 2001 From: kjetilaas Date: Fri, 27 Jun 2025 15:41:18 +0200 Subject: [PATCH 61/64] Update default fates cdl parameter file to NorESM3b1 version --- parameter_files/fates_params_default.cdl | 75 +++++++++++++----------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index a4737d6eee..009cabe640 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1,4 +1,4 @@ -netcdf fates_params_default { +netcdf fates_params_api.40.0.0_14pft_c250627_noresm_v21 { dimensions: fates_NCWD = 4 ; fates_history_age_bins = 7 ; @@ -679,13 +679,13 @@ variables: fates_woody:units = "logical flag" ; fates_woody:long_name = "Binary woody lifeform flag" ; double fates_voc_pftindex(fates_pft) ; - fates_voc_pftindex: units = "Integer PFT index" ; - fates_voc_pftindex: long_name = "integer index for MEGAN PFT definitions" ; + fates_voc_pftindex:units = "Integer PFT index" ; + fates_voc_pftindex:long_name = "integer index for MEGAN PFT definitions" ; double fates_hlm_pft_map(fates_hlm_pftno, fates_pft) ; fates_hlm_pft_map:units = "area fraction" ; fates_hlm_pft_map:long_name = "In fixed biogeog mode, fraction of HLM area associated with each FATES PFT" ; - double fates_wesley_pft_index_fordrydep(fates_pft) ; - fates_wesley_pft_index_fordrydep:units = "integer index"; + double fates_wesley_pft_index_fordrydep(fates_pft) ; + fates_wesley_pft_index_fordrydep:units = "integer index" ; fates_wesley_pft_index_fordrydep:long_name = "index to map from fates pfts into the wesley pft space used to determing dry deposition veolcity." ; double fates_fire_FBD(fates_litterclass) ; fates_fire_FBD:units = "kg Biomass/m3" ; @@ -923,7 +923,9 @@ variables: fates_vai_width_increase_factor:long_name = "factor by which each leaf+stem scattering element increases in VAI width (1 = uniform spacing)" ; // global attributes: - :history = "This file was generated by BatchPatchParams.py:\nCDL Base File = fates_params_default.cdl\nXML patch file = archive/api36.1.0_100224_pr1255-2.xml" ; + :history = "This file was generated by BatchPatchParams.py:\n", + "CDL Base File = fates_params_default.cdl\n", + "XML patch file = archive/api36.1.0_100224_pr1255-2.xml" ; data: fates_history_ageclass_bin_edges = 0, 1, 2, 5, 10, 20, 50 ; @@ -990,7 +992,7 @@ data: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; - fates_alloc_storage_cushion = 1.2, 2.4, 2.4, 1.2, 2.4, 2.4, 2.4, 2.4, 2.4, + fates_alloc_storage_cushion = 1.2, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4, 2.4 ; fates_alloc_store_priority_frac = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, @@ -1069,7 +1071,7 @@ data: fates_allom_hmode = 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 3, 3, 3 ; - fates_allom_l2fr = 1, 0.75, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1.41 ; + fates_allom_l2fr = 1, 0.75, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1.41 ; fates_allom_la_per_sa_int = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ; @@ -1211,8 +1213,8 @@ data: fates_frag_seed_decay_rate = 0.51, 0.51, 0.51, 0.51, 0.51, 0.51, 0.51, 0.51, 0.51, 0.74, 0.46, 0.35, 0.51, 0.51 ; - fates_grperc = 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.12, - 0.11, 0.16, 0.11, 0.11 ; + fates_grperc = 0.35, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, + 0.25, 0.25, 0.25, 0.25 ; fates_hydro_avuln_gs = 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5 ; @@ -1369,23 +1371,24 @@ data: fates_leaf_slamax = 0.03, 0.03, 0.025, 0.03, 0.05, 0.05, 0.012, 0.03, 0.03, 0.012, 0.032, 0.05, 0.05, 0.05 ; - fates_leaf_slatop = 0.024, 0.01, 0.021, 0.024, 0.02, 0.03, 0.012, 0.03, + fates_leaf_slatop = 0.024, 0.01, 0.026, 0.024, 0.02, 0.03, 0.012, 0.03, 0.03, 0.01, 0.032, 0.027, 0.04, 0.04 ; fates_leaf_stomatal_btran_model = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_leaf_stomatal_intercept = 50000, 21529.33, 13370.411, 26779.681, + fates_leaf_stomatal_intercept = 16033.365, 21529.33, 13370.411, 26779.681, 12869.022, 6205.777, 10000, 10000, 3750.669, 10000, 10000, 1624.209, 313709.616, 439459.319 ; - fates_leaf_stomatal_slope_ballberry = 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ; + fates_leaf_stomatal_slope_ballberry = 10, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8 ; fates_leaf_stomatal_slope_medlyn = 2.038, 2.482, 2.571, 4.038, 3.459, 4.353, 4.7, 4.7, 2.503, 4.7, 4.7, 2.423, 5.799, 0.967 ; fates_leaf_vcmax25top = - 53.142, 40, 20.443, 20.252, 38.393, 34.363, 62, 54, 43.712, 38, 54, 39.168, - 64, 17.955 ; + 53.142, 24, 40, 40, 38.393, 34.363, 62, 54, 43.712, 38, 54, 39.168, 64, + 17.955 ; fates_leaf_vcmaxha = 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330 ; @@ -1433,12 +1436,13 @@ data: fates_mort_hf_flc_threshold = 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ; - fates_mort_hf_sm_threshold = 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, - 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06 ; + fates_mort_hf_sm_threshold = 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, + 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05 ; fates_mort_ip_age_senescence = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; - fates_mort_ip_size_senescence = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; + fates_mort_ip_size_senescence = 170, 150, 150, 150, 150, 150, 150, _, _, _, + _, _, _, _ ; fates_mort_prescribed_canopy = 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194, 0.0194 ; @@ -1448,9 +1452,10 @@ data: fates_mort_r_age_senescence = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; - fates_mort_r_size_senescence = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; + fates_mort_r_size_senescence = 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, + 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045 ; - fates_mort_scalar_coldstress = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3.5, 2.3, 3, 3 ; + fates_mort_scalar_coldstress = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; fates_mort_scalar_cstarvation = 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.57, 0.6, 0.6, 0.6 ; @@ -1537,19 +1542,19 @@ data: 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02 ; fates_recruit_seed_alloc = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, - 0.07, 0.1, 0, 0, 0 ; + 0.07, 0.1, 0.1, 0.1, 0.1 ; fates_recruit_seed_alloc_mature = 0, 0, 0, 0, 0, 0, 0.9, 0.9, 0.9, 0.9, 0.9, - 0.25, 0.25, 0.2 ; + 0.25, 0.25, 0.9 ; fates_recruit_seed_dbh_repro_threshold = 90, 80, 80, 80, 90, 80, 3, 3, 2, - 2.4, 1.9, 3, 3, 3 ; + 2.4, 1.9, 3, 3, 30 ; fates_recruit_seed_germination_rate = 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.4, 0.49, 0.29, 0.5, 0.5 ; - fates_recruit_seed_supplement = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, - 0.1, 0.1, 0.1, 0.1, 0.1 ; + fates_recruit_seed_supplement = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.001, + 0.001 ; fates_seed_dispersal_fraction = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; @@ -1659,13 +1664,13 @@ data: fates_turb_leaf_diameter = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04 ; - fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, + fates_turb_z0mr = 0.075, 0.055, 0.055, 0.075, 0.055, 0.055, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ; fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0 ; - fates_turnover_fnrt = 1, 2, 1.5, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.5, 0.5 ; + fates_turnover_fnrt = 1, 2, 2, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.5, 0.5 ; fates_turnover_leaf_canopy = 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 0.5, 0.15, 0.5 ; @@ -1698,7 +1703,7 @@ data: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ; - fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11 ,3, 3, 3, 3, 3; + fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11, 3, 3, 3, 3, 3 ; fates_fire_FBD = 15.4, 16.8, 19.6, 999, 4, 4 ; @@ -1720,9 +1725,9 @@ data: fates_frag_cwd_frac = 0.045, 0.075, 0.21, 0.67 ; - fates_landuse_crop_lu_pft_vector = -999, -999, -999, -999, 11 ; + fates_landuse_crop_lu_pft_vector = -999, -999, -999, -999, 13 ; - fates_landuse_grazing_rate = 0, 0, 0, 0, 0 ; + fates_landuse_grazing_rate = 0, 0, 0.01, 0.02, 0 ; fates_max_nocomp_pfts_by_landuse = 4, 4, 1, 1, 1 ; @@ -1788,9 +1793,9 @@ data: fates_landuse_grazing_phosphorus_use_eff = 0.5 ; - fates_landuse_logging_coll_under_frac = 0. ; + fates_landuse_logging_coll_under_frac = 0 ; - fates_landuse_logging_collateral_frac = 0. ; + fates_landuse_logging_collateral_frac = 0 ; fates_landuse_logging_dbhmax = _ ; @@ -1798,13 +1803,13 @@ data: fates_landuse_logging_dbhmin = 0 ; - fates_landuse_logging_direct_frac = 1. ; + fates_landuse_logging_direct_frac = 1 ; fates_landuse_logging_event_code = -30 ; fates_landuse_logging_export_frac = 0.8 ; - fates_landuse_logging_mechanical_frac = 0. ; + fates_landuse_logging_mechanical_frac = 0 ; fates_leaf_photo_temp_acclim_thome_time = 30 ; @@ -1854,5 +1859,5 @@ data: fates_vai_top_bin_width = 0.5 ; - fates_vai_width_increase_factor = 1.1 ; + fates_vai_width_increase_factor = 1.25 ; } From 7617344717452b52490fc3e58eb20759b0a3f8a5 Mon Sep 17 00:00:00 2001 From: Marit Sandstad Date: Tue, 12 Aug 2025 09:56:26 +0200 Subject: [PATCH 62/64] Updating parameterfile --- parameter_files/fates_params_default.cdl | 32 +++++++++++------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 009cabe640..45e14ba1f1 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1,4 +1,4 @@ -netcdf fates_params_api.40.0.0_14pft_c250627_noresm_v21 { +netcdf fates_params_api.40.0.0_14pft_c250807_noresm_v250812__noresm_v25 { dimensions: fates_NCWD = 4 ; fates_history_age_bins = 7 ; @@ -996,7 +996,7 @@ data: 2.4, 2.4, 2.4, 2.4, 2.4 ; fates_alloc_store_priority_frac = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, - 0.8, 0.7, 0.6, 0.6, 0.8, 0.8 ; + 0.8, 0.7, 0.6, 0.3, 0.3, 0.3 ; fates_allom_agb1 = 0.0673, 0.1364012, 0.0393057, 0.2653695, 0.0673, 0.0728698, 0.06896, 0.06896, 0.06896, 0.06896, 0.06896, 0.001, 0.001, @@ -1071,7 +1071,7 @@ data: fates_allom_hmode = 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 3, 3, 3 ; - fates_allom_l2fr = 1, 0.75, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1.41 ; + fates_allom_l2fr = 1.5, 0.75, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1.5, 3, 3 ; fates_allom_la_per_sa_int = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ; @@ -1372,7 +1372,7 @@ data: 0.012, 0.032, 0.05, 0.05, 0.05 ; fates_leaf_slatop = 0.024, 0.01, 0.026, 0.024, 0.02, 0.03, 0.012, 0.03, - 0.03, 0.01, 0.032, 0.027, 0.04, 0.04 ; + 0.03, 0.01, 0.032, 0.027, 0.027, 0.03 ; fates_leaf_stomatal_btran_model = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; @@ -1409,7 +1409,7 @@ data: fates_maintresp_leaf_atkin2017_baserate = 1.734, 2.169, 2.104, 2.104, 2.069, 1.622, 2.0749, 2.0749, 3.054, 2.0749, 2.0749, 2.079, 2.0749, 2.182 ; - fates_maintresp_leaf_ryan1991_baserate = 2.525e-06, 2.525e-06, 2.525e-06, + fates_maintresp_leaf_ryan1991_baserate = 2.6e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06, 2.525e-06 ; @@ -1436,8 +1436,8 @@ data: fates_mort_hf_flc_threshold = 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ; - fates_mort_hf_sm_threshold = 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, - 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05 ; + fates_mort_hf_sm_threshold = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, 0.1, 0.1 ; fates_mort_ip_age_senescence = _, _, _, _, _, _, _, _, _, _, _, _, _, _ ; @@ -1457,11 +1457,10 @@ data: fates_mort_scalar_coldstress = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_mort_scalar_cstarvation = 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, - 0.6, 0.57, 0.6, 0.6, 0.6 ; + fates_mort_scalar_cstarvation = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.6, + 0.1, 0.1, 0.1, 0.1, 0.1 ; - fates_mort_scalar_hydrfailure = 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, - 0.6, 0.8, 0.6, 0.6, 0.6 ; + fates_mort_scalar_hydrfailure = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; fates_mort_upthresh_cstarvation = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; @@ -1484,7 +1483,7 @@ data: fates_phen_fnrt_drop_fraction = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; - fates_phen_leaf_habit = 1, 1, 2, 1, 3, 2, 1, 3, 2, 1, 2, 2, 3, 3 ; + fates_phen_leaf_habit = 1, 1, 2, 1, 3, 2, 1, 3, 2, 1, 2, 2, 1, 1 ; fates_phen_mindaysoff = 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 ; @@ -1535,8 +1534,7 @@ data: fates_recruit_height_min = 1.3, 1.3, 1.3, 1.3, 1.3, 1.3, 0.2, 0.2, 0.2, 0.8, 0.8, 0.11, 0.2, 0.2 ; - fates_recruit_init_density = 2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, - 0.16, 0.2, 0.2, 0.2, 0.2 ; + fates_recruit_init_density = 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 5, 2, 2 ; fates_recruit_prescribed_rate = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02 ; @@ -1670,13 +1668,13 @@ data: fates_turnover_branch = 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0 ; - fates_turnover_fnrt = 1, 2, 2, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.5, 0.5 ; + fates_turnover_fnrt = 1, 2, 2, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1.5, 0.5, 0.2 ; fates_turnover_leaf_canopy = - 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 0.5, 0.15, 0.5 ; + 1.5, 4, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.2, 0.15 ; fates_turnover_leaf_ustory = - 2.5, 5, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.15, 0.5 ; + 2.5, 5, 1, 1.5, 1, 1, 1.5, 1, 1, 1.5, 1, 1, 0.2, 0.15 ; fates_turnover_senleaf_fdrought = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; From 3e3792f074c35d2da72eff16cec4c12135643659 Mon Sep 17 00:00:00 2001 From: Marit Sandstad Date: Tue, 12 Aug 2025 11:41:45 +0200 Subject: [PATCH 63/64] Update parameter_files/fates_params_default.cdl Co-authored-by: Rosie Fisher --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 45e14ba1f1..4c83df1fc6 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1457,7 +1457,7 @@ data: fates_mort_scalar_coldstress = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - fates_mort_scalar_cstarvation = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.6, + fates_mort_scalar_cstarvation = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ; fates_mort_scalar_hydrfailure = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; From 34aa04b4d723a8cf6b7d3079a0b6e2f0cfc0569e Mon Sep 17 00:00:00 2001 From: Marit Sandstad Date: Fri, 26 Sep 2025 14:34:09 +0200 Subject: [PATCH 64/64] Correct fire_closs_to_atm_si unit comment to conform to actual output of EDPatchDynamicsMod --- main/FatesInterfaceTypesMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 16aa9563bd..32b5a3dd3c 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -810,7 +810,7 @@ module FatesInterfaceTypesMod ! direct carbon loss to atm pathways real(r8) :: grazing_closs_to_atm_si ! Loss of carbon to atmosphere via grazing [Site-Level, gC m-2 s-1] - real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, gC m-2 s-1] + real(r8) :: fire_closs_to_atm_si ! Loss of carbon to atmosphere via burning (includes burning from land use change) [Site-Level, kgC m-2 s-1] end type bc_out_type