@@ -2054,7 +2054,6 @@ subroutine SeedUpdate( currentSite )
20542054
20552055 ! !USES:
20562056 use EDTypesMod, only : area
2057- use EDTypesMod, only : homogenize_seed_pfts
20582057 use FatesInterfaceTypesMod, only : hlm_seeddisp_cadence
20592058 use FatesInterfaceTypesMod, only : fates_dispersal_cadence_none
20602059 !
@@ -2078,6 +2077,11 @@ subroutine SeedUpdate( currentSite )
20782077 integer :: el ! loop counter for litter element types
20792078 integer :: element_id ! element id consistent with parteh/PRTGenericMod.F90
20802079
2080+ logical , parameter :: nocomp_seed_localization = .true. ! if nocomp is on, only send a given PFT's seeds to patches of that nocomp PFT
2081+ real (r8 ) :: nocomp_seed_scaling ! scalar to handle case for nocomp_seed_localization
2082+ real (r8 ) :: seed_supply ! external seed rain scalar to handle case for nocomp_seed_localization
2083+ real (r8 ) :: nocomp_patch_areas(0 :numpft) ! vector of the total patch areas for each nocomp PFT
2084+
20812085 ! If the dispersal kernel is not turned on, keep the dispersal fraction at zero
20822086 site_disp_frac(:) = 0._r8
20832087 if (hlm_seeddisp_cadence .ne. fates_dispersal_cadence_none) then
@@ -2091,6 +2095,19 @@ subroutine SeedUpdate( currentSite )
20912095
20922096 site_mass = > currentSite% mass_balance(el)
20932097
2098+ ! If we are in nocomp configuration and we are restricting each PFT's seeds to all fall
2099+ ! only on patches that allow that PFT to grow, then we need to add up all the patch areas
2100+ ! for each nocomp PFT to normalize the seed fluxes with later.
2101+ if (nocomp_seed_localization .and. hlm_use_nocomp .eq. itrue ) then
2102+ nocomp_patch_areas(0 :numpft) = 0._r8
2103+ currentPatch = > currentSite% oldest_patch
2104+ nocomp_patch_loop: do while (associated (currentPatch))
2105+ nocomp_patch_areas(currentPatch% nocomp_pft_label) = nocomp_patch_areas(currentPatch% nocomp_pft_label) &
2106+ + currentPatch% area
2107+ currentPatch = > currentPatch% younger
2108+ end do nocomp_patch_loop
2109+ endif
2110+
20942111 ! Loop over all patches and sum up the seed input for each PFT
20952112 currentPatch = > currentSite% oldest_patch
20962113 seed_rain_loop: do while (associated (currentPatch))
@@ -2132,13 +2149,6 @@ subroutine SeedUpdate( currentSite )
21322149 currentPatch = > currentPatch% younger
21332150 enddo seed_rain_loop
21342151
2135- ! We can choose to homogenize seeds. This is simple, we just
2136- ! add up all the seed from each pft at the site level, and then
2137- ! equally distribute to the PFT pools
2138- if ( homogenize_seed_pfts ) then
2139- site_seed_rain(1 :numpft) = sum (site_seed_rain(:))/ real (numpft,r8 )
2140- end if
2141-
21422152 ! Loop over all patches again and disperse the mixed seeds into the input flux
21432153 ! arrays
21442154 ! Loop over all patches and sum up the seed input for each PFT
@@ -2150,9 +2160,25 @@ subroutine SeedUpdate( currentSite )
21502160
21512161 if (currentSite% use_this_pft(pft).eq. itrue)then
21522162
2163+ ! special case: do we want to restrict each PFT's seeds to only go to patches with that nocomp PFT label?
2164+ ! If so, then use a normalization factor that is one over the nocomp patch fraction for all patches of
2165+ ! that PFT's nocomp label, and zero for all other patches. If we don't do this, then just set scalar to one.
2166+ ! Similarly, only add external seed rain to a given PFT's nocomp patches
2167+ nocomp_seed_scaling = 1._r8
2168+ seed_supply = EDPftvarcon_inst% seed_suppl(pft)
2169+ if (nocomp_seed_localization .and. hlm_use_nocomp .eq. itrue ) then
2170+ if (currentPatch% nocomp_pft_label .eq. pft) then
2171+ nocomp_seed_scaling = AREA/ nocomp_patch_areas(pft)
2172+ else
2173+ nocomp_seed_scaling = 0._r8
2174+ seed_supply = 0._r8
2175+ endif
2176+ endif
2177+
21532178 ! Seed input from local sources (within site). Note that a fraction of the
21542179 ! internal seed rain is sent out to neighboring gridcells.
2155- litt% seed_in_local(pft) = litt% seed_in_local(pft) + site_seed_rain(pft)* (1.0_r8 - site_disp_frac(pft))/ area ! [kg/m2/day]
2180+ litt% seed_in_local(pft) = litt% seed_in_local(pft) + nocomp_seed_scaling * &
2181+ (1.0_r8 - site_disp_frac(pft)) * (site_seed_rain(pft)/ area) ! site_seed_rain conversion from [kg/site/day -> kg/m2/day]
21562182
21572183 ! If we are using the Tree Recruitment Scheme (TRS) with or w/o seedling dynamics
21582184 if ( any (hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. &
@@ -2184,7 +2210,7 @@ subroutine SeedUpdate( currentSite )
21842210
21852211 ! Seed input from external sources (user param seed rain, or dispersal model)
21862212 ! Include both prescribed seed_suppl and seed_in dispersed from neighbouring gridcells
2187- seed_in_external = seed_stoich* ( currentSite% seed_in(pft)/ area + EDPftvarcon_inst % seed_suppl(pft) * years_per_day) ! [kg/m2/day]
2213+ seed_in_external = seed_stoich * (seed_supply * years_per_day + currentSite% seed_in(pft)/ area ! [kg/m2/day]
21882214 litt% seed_in_extern(pft) = litt% seed_in_extern(pft) + seed_in_external
21892215
21902216 ! Seeds entering externally [kg/site/day]
0 commit comments