Skip to content

Commit

Permalink
added seed homogenization mode to prevent compettive exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoven committed Jan 27, 2017
1 parent 043c03a commit ac46e0f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
41 changes: 40 additions & 1 deletion components/clm/src/ED/biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ subroutine seeds_in( currentSite, cp_pnt )
!
! !USES:
use EDTypesMod, only : AREA
use EDTypesMod, only : homogenize_seed_pfts
!
! !ARGUMENTS
type(ed_site_type), intent(inout), target :: currentSite
Expand All @@ -650,19 +651,57 @@ subroutine seeds_in( currentSite, cp_pnt )
type(ed_patch_type), pointer :: currentPatch
type(ed_cohort_type), pointer :: currentCohort
integer :: p
logical :: pft_present(numpft_ed)
real(r8) :: npfts_present
!----------------------------------------------------------------------

currentPatch => cp_pnt

currentPatch%seeds_in(:) = 0.0_r8


if ( homogenize_seed_pfts ) then
! special mode to remove intergenerational filters on PFT existence: each PFT seeds all PFTs
! first loop over all patches and cohorts to see what and how many PFTs are present on this site
pft_present(:) = .false.
npfts_present = 0._r8
currentPatch => currentSite%oldest_patch
do while(associated(currentPatch))
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
p = currentCohort%pft
if (.not. pft_present(p)) then
pft_present(p) = .true.
npfts_present = npfts_present + 1._r8
endif
currentCohort => currentCohort%shorter
enddo !cohort loop
currentPatch => currentPatch%younger
enddo ! patch loop

! now calculate the homogenized seed flux into each PFT pool
currentPatch => cp_pnt
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
do p = 1, numpft_ed
if (pft_present(p)) then
currentPatch%seeds_in(p) = currentPatch%seeds_in(p) + currentCohort%seed_prod * currentCohort%n / &
(currentPatch%area * npfts_present)
endif
end do
currentCohort => currentCohort%shorter
enddo !cohort loop
else

! normal case: each PFT seeds its own type
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
p = currentCohort%pft
currentPatch%seeds_in(p) = currentPatch%seeds_in(p) + currentCohort%seed_prod * currentCohort%n/currentPatch%area
currentCohort => currentCohort%shorter
enddo !cohort loop

endif

currentPatch => currentSite%oldest_patch

do while(associated(currentPatch))
Expand Down
3 changes: 3 additions & 0 deletions components/clm/src/ED/main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ module EDTypesMod

character*4 yearchar

! special mode to cause PFTs to create seed mass of all currently-existing PFTs
logical, parameter :: homogenize_seed_pfts = .true.

!the lower limit of the size classes of ED cohorts
!0-10,10-20...
integer, parameter :: nlevsclass_ed = 13 ! Number of dbh size classes for size structure analysis
Expand Down

0 comments on commit ac46e0f

Please sign in to comment.