Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross grid seed dispersal #1005

Merged
merged 115 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
33c2f5b
calculating seed_out and track mass balance
YanlanLiu May 25, 2021
a58b3c4
calculate seed out in EDphysiology
YanlanLiu Jun 15, 2021
8ced31c
track seed_out in the recruitment submodule
YanlanLiu Jun 15, 2021
fa0f43b
cleaned repetitive EDphysiologyMod
YanlanLiu Jun 21, 2021
2d11c71
Benchmark: correctly print out seed production
YanlanLiu Jun 21, 2021
b903ffa
track seed_out in site_mass
YanlanLiu Jun 21, 2021
5973c48
updated seed_out
YanlanLiu Jun 22, 2021
3ddc341
bench mark, compare with master
YanlanLiu Jun 22, 2021
2cf0588
corrected sitemass%seed_out
YanlanLiu Jun 23, 2021
43f24e6
corrected site_mass%seed_out, cleaned
YanlanLiu Jun 23, 2021
386dade
notation
YanlanLiu Jun 23, 2021
d02791c
corrected position for seed_out
YanlanLiu Jun 26, 2021
2d494d2
added bc_out in SeedIn()
YanlanLiu Jun 26, 2021
c7b5ea7
added seed_out(numpft) in bc_out
YanlanLiu Jun 26, 2021
903b7f8
benchmark edits within FATES
YanlanLiu Jun 26, 2021
f0d6016
added seed_in in bc_in
YanlanLiu Jun 26, 2021
91d945c
added seed_in in bc_in
YanlanLiu Jun 26, 2021
d1d15d7
added bc%seed_in to seed_external
YanlanLiu May 18, 2022
bf1568c
cleaned printouts
YanlanLiu May 20, 2022
b3845dc
pring out seed_in
YanlanLiu Jun 2, 2022
d537948
Merge branch 'master' into cross_grid_glemieux
glemieux Jun 3, 2022
b329750
bug corrected in areal normalization of external seed
YanlanLiu Jun 16, 2022
fc472cf
wholesale copy of @mpaiao version of the vincety algorithm
glemieux Jun 28, 2022
ef30ae8
updating gcd import code with fates constants. Adding new constant p…
glemieux Jun 28, 2022
715f3b5
crossgrid seed exchange for all PFTs
YanlanLiu Jul 6, 2022
710814c
Merge branch 'cross_grid_seed' into cross_grid_glemieux
glemieux Jul 8, 2022
4772c52
making great circle distance public
glemieux Jul 21, 2022
8b0ed78
Merge branch 'cross_grid_glemieux-geodesy' into cross_grid_glemieux
glemieux Jul 27, 2022
8186d50
correct conversion to radians
glemieux Aug 3, 2022
fda77af
Merge pull request #2 from glemieux/cross_grid_glemieux
YanlanLiu Aug 4, 2022
fe2ac8a
refactored neighborhood code into fates
glemieux Aug 11, 2022
b48bc3c
temporarily updating distance weighting to use a generic type-bound p…
glemieux Aug 11, 2022
e9afae9
add dispersal module with multiple kernels
glemieux Aug 18, 2022
f882f84
update calls for new dispersal location
glemieux Aug 18, 2022
2f481ff
fix errors
glemieux Aug 18, 2022
88af674
add dispersal type
glemieux Oct 18, 2022
4a62529
add pft dimension to outgoing and incoming seed arrays
glemieux Oct 22, 2022
0777a86
update probability density call to accept pft index and neighbor type…
glemieux Oct 25, 2022
de40547
update dispersal kernel to use parameter file
glemieux Oct 25, 2022
0ec9b53
add param file with seed dispersal params and update relevant param f…
glemieux Oct 26, 2022
d491d8f
add pft dependent dispersal calls and correct error in parameter calls
glemieux Oct 28, 2022
4e4054b
adding new seed dispersal parameter file
glemieux Oct 28, 2022
f05214c
Revert "adding new seed dispersal parameter file"
glemieux Oct 29, 2022
c4ac180
add new seed dispersal param file
glemieux Oct 29, 2022
f1efd31
Add seed dispersal max distance to parameter file
glemieux Nov 2, 2022
33bb12c
remove duplicated hard coded dispersal mode
glemieux Nov 2, 2022
c5b3b20
clean up comments
glemieux Nov 2, 2022
2baaaff
minor cleanup
glemieux Nov 2, 2022
e4d0330
change name of SeedIn routine to SeedUpdate now that it also updates …
glemieux Nov 2, 2022
696ba25
Merge pull request #3 from glemieux/cross_grid_seed-caseselect
YanlanLiu Nov 4, 2022
a0fefc2
update SeedUpdate use and public calls
glemieux Nov 4, 2022
fe2bc4b
Merge pull request #4 from glemieux/cross_grid_seed-seedudpate_fix
YanlanLiu Nov 8, 2022
bd9d357
update seed dispersal run mode check for DetermineGridCellNeighbors
glemieux Nov 8, 2022
a7fa496
add clarifying comment
glemieux Nov 8, 2022
6f2daa9
add gridcell seed out and in diagnostic history outputs
glemieux Nov 17, 2022
18cad9e
add type for index
glemieux Nov 17, 2022
4793dee
add missing use of bc_out type
glemieux Nov 17, 2022
d582af7
add logical function to check if it is dispersal time
glemieux Nov 23, 2022
86ae4be
correct use call for dispersal timing function
glemieux Nov 23, 2022
9e48e86
refactor dispersal check function and add initialization
glemieux Dec 6, 2022
7fbde3f
Merge branch 'cross_grid_seed-addhistorydiag' of github.com:glemieux/…
glemieux Dec 6, 2022
ca7723a
correct logic for setting new date
glemieux Dec 6, 2022
b092904
update isitdispersal function to avoid time lag of dispersal
glemieux Dec 6, 2022
846c8bc
correct getcadencedate function name
glemieux Dec 7, 2022
6df29f8
convert dispersal fraction into a parameter file variable
glemieux Dec 7, 2022
f5e1153
remove old local dispersal fraction defintion
glemieux Dec 8, 2022
0eef9c0
comment out diagnostic write statment
glemieux Dec 8, 2022
e27983b
Merge pull request #5 from glemieux/cross_grid_seed-addhistorydiag
YanlanLiu Jan 19, 2023
645fcbf
add check to return dispersal time check as being off if dispersal mo…
glemieux Feb 14, 2023
dcfcbd3
add local dispersal fraction variable that depends on the dispersal k…
glemieux Feb 14, 2023
5d90def
update parameter file checks for all seed_dispersal params
glemieux Feb 14, 2023
db94598
comment clarification
glemieux Feb 14, 2023
f9d6a42
Merge pull request #6 from glemieux/cross_grid_seed-isitdisptime_fix
YanlanLiu Feb 14, 2023
09a502f
Merge tag 'sci.1.65.2_api.25.4.0' into cross_grid_seed
glemieux Mar 23, 2023
a61a28d
Fix minor bad-merge issue
glemieux Mar 23, 2023
de9376f
Add xmlpatch file with dispersal variables
glemieux Mar 23, 2023
e5cef9c
Remove redundant parameter file
glemieux Mar 23, 2023
1d8090a
Fixing additional dropped commits from merge
glemieux Mar 23, 2023
68f1789
Fix grid cell neighbor indexing
glemieux Mar 30, 2023
67e7899
Implement reviewer suggested improvements
glemieux Apr 25, 2023
c7662c1
Add clarifying language per reviewer suggestions
glemieux May 10, 2023
fa6df9f
Merge tag 'sci.1.65.7_api.25.4.0' into cross_grid_seed
glemieux Jul 18, 2023
9317261
fix type of unset used
glemieux Jul 18, 2023
3a0c352
replace use of ldecomp
glemieux Jul 18, 2023
ef3e76f
add loop names to seedupdate
glemieux Jul 19, 2023
e229d6f
move dispersal fraction outside of element loop
glemieux Jul 19, 2023
145d77d
Refactor seed disperal out of bc types
glemieux Jul 19, 2023
204e5aa
Merge branch 'cross_grid_seed' into cross_grid_seed_bc-to-site_refactor
glemieux Jul 19, 2023
69691b5
remove bc_out argument due to refactor
glemieux Jul 20, 2023
822699a
Correct seed_in_external and seed_out calculations
glemieux Jul 24, 2023
5f3dd90
Merge tag 'sci.1.66.0_api.25.5.0' into cross_grid_seed
glemieux Jul 24, 2023
2e4cc83
update parameter patch file for api25.5
glemieux Jul 24, 2023
f08b81f
add api25.5 param file to archive
glemieux Jul 24, 2023
4a6aca7
correct call to previously archived default (api25.5)
glemieux Jul 24, 2023
c62e401
remove archive and api update
glemieux Jul 24, 2023
a276f25
Merge tag 'sci.1.67.0_api.25.5.0' into cross_grid_seed
glemieux Jul 24, 2023
6f9ceee
Merge tag 'sci.1.67.2_api.27.0.0' into cross_grid_seed
glemieux Aug 23, 2023
7b0cbf5
make global number of gridcells an input argument
glemieux Aug 24, 2023
e067714
restore accidentally deleted error status variables
glemieux Aug 24, 2023
74228ca
add site x pft restart variable for seed_in from dispersal
glemieux Aug 24, 2023
e5cd151
add seed_out to restart
glemieux Aug 30, 2023
efbb302
refactoring code to accomodate use of mpi_allgatherv in place of a re…
glemieux Sep 1, 2023
6a792e8
updates to pass bag compiler build
glemieux Sep 5, 2023
90e1400
change the dispersal cadence to be a hlm defined switch
glemieux Sep 25, 2023
540caa1
update kernel mode check to cadence check
glemieux Sep 25, 2023
34fe689
reverse dispersal type dimensions for memory continuity for mpi colle…
glemieux Sep 11, 2023
4173192
add neighbor array list to neighborhood data structure
glemieux Sep 26, 2023
c24643b
fix bad merge
glemieux Sep 26, 2023
57aae11
Merge branch 'cross_grid_seed' into cross_grid_seed-hlm_modeswitch
glemieux Sep 26, 2023
3a00e84
add missing unset
glemieux Sep 27, 2023
a7e4ee0
remove unnecessary dispersal cadence logic gates
glemieux Sep 27, 2023
a92057d
seed dispersal comment clean up
glemieux Sep 27, 2023
866721a
Merge tag 'sci.1.67.5_api.27.0.0' into cross_grid_seed
glemieux Oct 18, 2023
df403b3
remove elm incompatible gindex uses from fatesinterfacemod
glemieux Oct 20, 2023
c4642a7
remove old diagnostic write statements
glemieux Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 38 additions & 25 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ module EDPhysiologyMod
public :: PreDisturbanceLitterFluxes
public :: PreDisturbanceIntegrateLitter
public :: GenerateDamageAndLitterFluxes
public :: SeedIn
public :: SeedUpdate
public :: UpdateRecruitL2FR
public :: UpdateRecruitStoicH
public :: SetRecruitL2FR
Expand Down Expand Up @@ -555,7 +555,6 @@ subroutine PreDisturbanceIntegrateLitter(currentPatch)
litt%seed_germ_in(pft) - &
litt%seed_germ_decay(pft)


enddo

! Update the Coarse Woody Debris pools (above and below)
Expand Down Expand Up @@ -2022,8 +2021,8 @@ subroutine assign_cohort_SP_properties(currentCohort, htop, tlai, tsai, parea, i
end subroutine assign_cohort_SP_properties

! =====================================================================================

subroutine SeedIn( currentSite, bc_in )
subroutine SeedUpdate( currentSite )

! -----------------------------------------------------------------------------------
! Flux from plants into the seed pool.
Expand All @@ -2040,10 +2039,11 @@ subroutine SeedIn( currentSite, bc_in )
! !USES:
use EDTypesMod, only : area
use EDTypesMod, only : homogenize_seed_pfts
use FatesInterfaceTypesMod, only : hlm_seeddisp_cadence
use FatesInterfaceTypesMod, only : fates_dispersal_cadence_none
!
! !ARGUMENTS
type(ed_site_type), intent(inout), target :: currentSite
type(bc_in_type), intent(in) :: bc_in

type(fates_patch_type), pointer :: currentPatch
type(litter_type), pointer :: litt
Expand All @@ -2052,26 +2052,32 @@ subroutine SeedIn( currentSite, bc_in )

integer :: pft
real(r8) :: store_m_to_repro ! mass sent from storage to reproduction upon death [kg/plant]
real(r8) :: site_seed_rain(maxpft) ! This is the sum of seed-rain for the site [kg/site/day]
real(r8) :: site_seed_rain(numpft) ! This is the sum of seed-rain for the site [kg/site/day]
real(r8) :: site_disp_frac(numpft) ! Fraction of seeds from prodeced in current grid cell to
! disperse out to other gridcells
real(r8) :: seed_in_external ! Mass of externally generated seeds [kg/m2/day]
real(r8) :: seed_stoich ! Mass ratio of nutrient per C12 in seeds [kg/kg]
real(r8) :: seed_prod ! Seed produced in this dynamics step [kg/day]
glemieux marked this conversation as resolved.
Show resolved Hide resolved
integer :: n_litt_types ! number of litter element types (c,n,p, etc)
integer :: el ! loop counter for litter element types
integer :: element_id ! element id consistent with parteh/PRTGenericMod.F90
!------------------------------------------------------------------------------------

do el = 1, num_elements
! If the dispersal kernel is not turned on, keep the dispersal fraction at zero
site_disp_frac(:) = 0._r8
if (hlm_seeddisp_cadence .ne. fates_dispersal_cadence_none) then
site_disp_frac(:) = EDPftvarcon_inst%seed_dispersal_fraction(:)
end if

site_seed_rain(:) = 0._r8
el_loop: do el = 1, num_elements

site_seed_rain(:) = 0._r8
element_id = element_list(el)

site_mass => currentSite%mass_balance(el)

! Loop over all patches and sum up the seed input for each PFT
currentPatch => currentSite%oldest_patch
do while (associated(currentPatch))
seed_rain_loop: do while (associated(currentPatch))

currentCohort => currentPatch%tallest
do while (associated(currentCohort))
Expand Down Expand Up @@ -2100,14 +2106,15 @@ subroutine SeedIn( currentSite, bc_in )
currentcohort%seed_prod = seed_prod
end if


site_seed_rain(pft) = site_seed_rain(pft) + &
(seed_prod * currentCohort%n + store_m_to_repro)
(seed_prod * currentCohort%n + store_m_to_repro) ![kg/site/day, kg/ha/day]

currentCohort => currentCohort%shorter
enddo !cohort loop

currentPatch => currentPatch%younger
enddo
enddo seed_rain_loop

! We can choose to homogenize seeds. This is simple, we just
! add up all the seed from each pft at the site level, and then
Expand All @@ -2116,22 +2123,21 @@ subroutine SeedIn( currentSite, bc_in )
site_seed_rain(1:numpft) = sum(site_seed_rain(:))/real(numpft,r8)
end if


! Loop over all patches again and disperse the mixed seeds into the input flux
! arrays

! Loop over all patches and sum up the seed input for each PFT
currentPatch => currentSite%oldest_patch
do while (associated(currentPatch))
seed_in_loop: do while (associated(currentPatch))

litt => currentPatch%litter(el)
do pft = 1,numpft

if(currentSite%use_this_pft(pft).eq.itrue)then

! Seed input from local sources (within site)
litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)/area


! Seed input from local sources (within site). Note that a fraction of the
! internal seed rain is sent out to neighboring gridcells.
litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)*(1-site_disp_frac(pft))/area ![kg/m2/day]
glemieux marked this conversation as resolved.
Show resolved Hide resolved

! If we are using the Tree Recruitment Scheme (TRS) with or w/o seedling dynamics
if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. &
prt_params%allom_dbh_maxheight(pft) > min_max_dbh_for_trees) then
Expand Down Expand Up @@ -2161,22 +2167,29 @@ subroutine SeedIn( currentSite, bc_in )
end select

! Seed input from external sources (user param seed rain, or dispersal model)
seed_in_external = seed_stoich*EDPftvarcon_inst%seed_suppl(pft)*years_per_day
! Include both prescribed seed_suppl and seed_in dispersed from neighbouring gridcells
seed_in_external = seed_stoich*(currentSite%seed_in(pft)/area + EDPftvarcon_inst%seed_suppl(pft)*years_per_day) ![kg/m2/day]
litt%seed_in_extern(pft) = litt%seed_in_extern(pft) + seed_in_external

! Seeds entering externally [kg/site/day]
site_mass%seed_in = site_mass%seed_in + seed_in_external*currentPatch%area
end if !use this pft
enddo


currentPatch => currentPatch%younger
enddo
enddo seed_in_loop

end do
! Determine the total site-level seed output for the current element and update the seed_out mass
! for each element loop since the site_seed_rain is resent and updated for each element loop iteration
do pft = 1,numpft
site_mass%seed_out = site_mass%seed_out + site_seed_rain(pft)*site_disp_frac(pft) ![kg/site/day]
currentSite%seed_out(pft) = currentSite%seed_out(pft) + site_seed_rain(pft)*site_disp_frac(pft) ![kg/site/day]
end do

end do el_loop

return
end subroutine SeedIn
end subroutine SeedUpdate

! ============================================================================

Expand Down Expand Up @@ -2404,6 +2417,7 @@ subroutine SeedGermination( litt, cold_stat, drought_stat, bc_in, currentPatch )

if ((prt_params%season_decid(pft) == itrue ) .and. &
(any(cold_stat == [phen_cstat_nevercold,phen_cstat_iscold]))) then
! no germination for all PFTs when cold
litt%seed_germ_in(pft) = 0.0_r8
endif

Expand All @@ -2422,7 +2436,6 @@ end subroutine SeedGermination

! =====================================================================================


subroutine recruitment(currentSite, currentPatch, bc_in)
!
! DESCRIPTION:
Expand Down
1 change: 1 addition & 0 deletions main/ChecksBalancesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ subroutine PatchMassStock(currentPatch,el,live_stock,seed_stock,litter_stock)
seed_stock = currentPatch%area * &
(sum(litt%seed) + sum(litt%seed_germ))


! Total mass on living plants
live_stock = 0._r8
currentCohort => currentPatch%tallest
Expand Down
10 changes: 8 additions & 2 deletions main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,14 @@ subroutine init_site_vars( site_in, bc_in, bc_out )

! Initialize the static soil
! arrays from the boundary (initial) condition

site_in%zi_soil(:) = bc_in%zi_sisl(:)
site_in%dz_soil(:) = bc_in%dz_sisl(:)
site_in%z_soil(:) = bc_in%z_sisl(:)

!
! Seed dispersal
allocate(site_in%seed_in(1:numpft))
allocate(site_in%seed_out(1:numpft))

end subroutine init_site_vars

! ============================================================================
Expand Down Expand Up @@ -339,6 +341,10 @@ subroutine zero_site( site_in )
! canopy spread
site_in%spread = 0._r8

! Seed dispersal
site_in%seed_in(:) = 0.0_r8
site_in%seed_out(:) = 0.0_r8

site_in%area_pft(:) = 0._r8
site_in%use_this_pft(:) = fates_unset_int
site_in%area_by_age(:) = 0._r8
Expand Down
8 changes: 5 additions & 3 deletions main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module EDMainMod
use EDPhysiologyMod , only : satellite_phenology
use EDPhysiologyMod , only : recruitment
use EDPhysiologyMod , only : trim_canopy
use EDPhysiologyMod , only : SeedIn
use EDPhysiologyMod , only : SeedUpdate
use EDPhysiologyMod , only : ZeroAllocationRates
use EDPhysiologyMod , only : ZeroLitterFluxes
use EDPhysiologyMod , only : PreDisturbanceLitterFluxes
Expand Down Expand Up @@ -246,6 +246,8 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out)

! adds small cohort of each PFT
call recruitment(currentSite, currentPatch, bc_in)
!YL --------------
! call recruitment(currentSite, currentPatch, bc_in, bc_out)

currentPatch => currentPatch%younger
enddo
Expand Down Expand Up @@ -717,8 +719,8 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out )
! With growth and mortality rates now calculated we can determine the seed rain
! fluxes. However, because this is potentially a cross-patch mixing model
! we will calculate this as a group

call SeedIn(currentSite,bc_in)
call SeedUpdate(currentSite)

! Calculate all other litter fluxes
! -----------------------------------------------------------------------------------
Expand Down
104 changes: 103 additions & 1 deletion main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ module EDPftvarcon
real(r8), allocatable :: germination_rate(:) ! Fraction of seed mass germinating per year (yr-1)
real(r8), allocatable :: seed_decay_rate(:) ! Fraction of seed mass (both germinated and
! ungerminated), decaying per year (yr-1)

real(r8), allocatable :: seed_dispersal_pdf_scale(:) ! Seed dispersal scale parameter, Bullock et al. (2017)
real(r8), allocatable :: seed_dispersal_pdf_shape(:) ! Seed dispersal shape parameter, Bullock et al. (2017)
real(r8), allocatable :: seed_dispersal_max_dist(:) ! Maximum seed dispersal distance parameter (m)
real(r8), allocatable :: seed_dispersal_fraction(:) ! Fraction of seed rain to disperse, per pft

real(r8), allocatable :: repro_frac_seed(:) ! fraciton of reproductive carbon that is seed
real(r8), allocatable :: a_emerg(:) ! mean fraction of seed bank emerging [day-1]
real(r8), allocatable :: b_emerg(:) ! seedling emergence sensitivity to soil moisture
Expand Down Expand Up @@ -676,7 +680,23 @@ subroutine Register_PFT(this, fates_params)
name = 'fates_frag_seed_decay_rate'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_seed_dispersal_pdf_scale'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_seed_dispersal_pdf_shape'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_seed_dispersal_max_dist'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_seed_dispersal_fraction'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_trim_limit'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)
Expand Down Expand Up @@ -1116,6 +1136,22 @@ subroutine Receive_PFT(this, fates_params)
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%seed_decay_rate)

name = 'fates_seed_dispersal_pdf_scale'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%seed_dispersal_pdf_scale)

name = 'fates_seed_dispersal_pdf_shape'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%seed_dispersal_pdf_shape)

name = 'fates_seed_dispersal_max_dist'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%seed_dispersal_max_dist)

name = 'fates_seed_dispersal_fraction'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%seed_dispersal_fraction)

name = 'fates_trim_limit'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%trim_limit)
Expand Down Expand Up @@ -1651,6 +1687,10 @@ subroutine FatesReportPFTParams(is_master)
write(fates_log(),fmt0) 'jmaxse = ',EDPftvarcon_inst%jmaxse
write(fates_log(),fmt0) 'germination_timescale = ',EDPftvarcon_inst%germination_rate
write(fates_log(),fmt0) 'seed_decay_turnover = ',EDPftvarcon_inst%seed_decay_rate
write(fates_log(),fmt0) 'seed_dispersal_pdf_scale = ',EDPftvarcon_inst%seed_dispersal_pdf_scale
write(fates_log(),fmt0) 'seed_dispersal_pdf_shape = ',EDPftvarcon_inst%seed_dispersal_pdf_shape
write(fates_log(),fmt0) 'seed_dispersal_max_dist = ',EDPftvarcon_inst%seed_dispersal_max_dist
write(fates_log(),fmt0) 'seed_dispersal_fraction = ',EDPftvarcon_inst%seed_dispersal_fraction
write(fates_log(),fmt0) 'repro_frac_seed = ',EDPftvarcon_inst%repro_frac_seed
write(fates_log(),fmt0) 'a_emerg = ',EDPftvarcon_inst%a_emerg
write(fates_log(),fmt0) 'b_emerg = ',EDPftvarcon_inst%b_emerg
Expand Down Expand Up @@ -1883,6 +1923,68 @@ subroutine FatesCheckParams(is_master)
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

! Check that the seed dispersal parameters are all set if one of them is set
!-----------------------------------------------------------------------------------
if (( EDPftvarcon_inst%seed_dispersal_pdf_scale(ipft) < fates_check_param_set ) .and. &
(( EDPftvarcon_inst%seed_dispersal_max_dist(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_pdf_shape(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_fraction(ipft) > fates_check_param_set ))) then

write(fates_log(),*) 'Seed dispersal is on per fates_seed_dispersal_pdf_scale being set'
write(fates_log(),*) 'Please provide values for all other seed_dispersal parameters'
write(fates_log(),*) 'See Bullock et al. (2017) for reasonable values'
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

if (( EDPftvarcon_inst%seed_dispersal_pdf_shape(ipft) < fates_check_param_set ) .and. &
(( EDPftvarcon_inst%seed_dispersal_max_dist(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_pdf_scale(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_fraction(ipft) > fates_check_param_set ))) then

write(fates_log(),*) 'Seed dispersal is on per fates_seed_dispersal_pdf_shape being set'
write(fates_log(),*) 'Please provide values for all other seed_dispersal parameters'
write(fates_log(),*) 'See Bullock et al. (2017) for reasonable values'
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

if (( EDPftvarcon_inst%seed_dispersal_max_dist(ipft) < fates_check_param_set ) .and. &
(( EDPftvarcon_inst%seed_dispersal_pdf_shape(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_pdf_scale(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_fraction(ipft) > fates_check_param_set ))) then

write(fates_log(),*) 'Seed dispersal is on per seed_dispersal_max_dist being set'
write(fates_log(),*) 'Please provide values for all other seed_dispersal parameters'
write(fates_log(),*) 'See Bullock et al. (2017) for reasonable values'
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

if (( EDPftvarcon_inst%seed_dispersal_fraction(ipft) < fates_check_param_set ) .and. &
(( EDPftvarcon_inst%seed_dispersal_pdf_shape(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_pdf_scale(ipft) > fates_check_param_set ) .or. &
( EDPftvarcon_inst%seed_dispersal_max_dist(ipft) > fates_check_param_set ))) then

write(fates_log(),*) 'Seed dispersal is on per seed_dispersal_fraction being set'
write(fates_log(),*) 'Please provide values for all other seed_dispersal parameters'
write(fates_log(),*) 'See Bullock et al. (2017) for reasonable values'
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

! Check that parameter ranges for the seed dispersal fraction make sense
!-----------------------------------------------------------------------------------
if (( EDPftvarcon_inst%seed_dispersal_fraction(ipft) < fates_check_param_set ) .and. &
(( EDPftvarcon_inst%seed_dispersal_fraction(ipft) > 1.0_r8 ) .or. &
( EDPftvarcon_inst%seed_dispersal_fraction(ipft) < 0.0_r8 ))) then

write(fates_log(),*) 'Seed dispersal is on per seed_dispersal_fraction being set'
write(fates_log(),*) 'Please make sure the fraction value is between 0 and 1'
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

! Check that parameter ranges for age-dependent mortality make sense
!-----------------------------------------------------------------------------------
if ( ( EDPftvarcon_inst%mort_ip_age_senescence(ipft) < fates_check_param_set ) .and. &
Expand Down
4 changes: 4 additions & 0 deletions main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ module EDTypesMod
! Canopy Spread
real(r8) :: spread ! dynamic canopy allometric term [unitless]

! Seed dispersal
real(r8), allocatable :: seed_out(:) ! amount of seed leaving the site [kg/site/day]
real(r8), allocatable :: seed_in(:) ! amount of seed dispersed into the site from neighbouring cells [kg/site/day]

! site-level variables to keep track of the disturbance rates, both actual and "potential"
real(r8) :: disturbance_rates_primary_to_primary(N_DIST_TYPES) ! actual disturbance rates from primary patches to primary patches [m2/m2/day]
real(r8) :: disturbance_rates_primary_to_secondary(N_DIST_TYPES) ! actual disturbance rates from primary patches to secondary patches [m2/m2/day]
Expand Down
Loading