32 INTEGER,
INTENT(in) :: nspc, lat, lon
82 INTEGER,
INTENT(in) :: isp, lat, lon
85 INTEGER :: seeds_inAir, seeds_onGround, &
97 producedseeds =
stategrid(lat, lon)%sp(isp)%producedSeeds
100 if (producedseeds > 0.0)
then
104 looplatwin:
do latwin = -
spec(isp)%rad, +
spec(isp)%rad
105 looplonwin:
do lonwin = -
spec(isp)%rad, +
spec(isp)%rad
112 if_inallowedarea:
IF (dodisp)
then
114 prob =
spec(isp)%kernel(latwin, lonwin)
116 seeds_inair = producedseeds
118 contrib = seeds_onground
120 contrib = prob * producedseeds
123 seedrain(wlat, wlon)%sp(isp)%verynewSeeds =
seedrain(wlat, wlon)%sp(isp)%verynewSeeds + contrib
125 end if if_inallowedarea
164 INTEGER,
INTENT(in) :: nspc, iam, lats, late, lons, lone, year
165 LOGICAL,
INTENT(in) :: doDispersal
171 if ((lats < 1) .or. (lats >
maxlat) .or. (late < 1) .or. (late >
maxlat) .or. &
172 (lons < 1) .or. (lons >
maxlon) .or. (lone < 1) .or. (lone >
maxlon))
then
173 call logerror(
"Coordinates out of bounds in updateNewseeds")
174 write (
logmessage,
"(7A15)")
"iam",
"lats",
"lons",
"late",
"lone",
"maxlat",
"maxlon"
181 if (dodispersal)
then
182 loopspc2:
do isp = 1, nspc
183 if (year >=
spec(isp)%immi%dat(1)%year)
then
184 looplatwin2:
do latwin = lats, late
185 looplonwin2:
do lonwin = lons, lone
186 seedrain(latwin, lonwin)%sp(isp)%newSeeds =
seedrain(latwin, lonwin)%sp(isp)%verynewSeeds
188 seedrain(latwin, lonwin)%sp(isp)%verynewSeeds = 0.0
222 INTEGER,
INTENT(in) :: nspc, lats, late, lons, lone, year
223 LOGICAL,
INTENT(in) :: doDispersal
228 if (dodispersal)
then
230 loopspc2:
do isp = 1, nspc
231 if (year >=
spec(isp)%immi%dat(1)%year)
then
232 looplatwin2:
do latwin = lats, late
233 looplonwin2:
do lonwin = lons, lone
268 INTEGER,
INTENT(in) :: maxlat, maxlon
269 character(1),
INTENT(in) :: boundaries
270 INTEGER,
INTENT(inout) :: wlat, &
272 LOGICAL,
INTENT(out) :: dodisp
278 select case (boundaries)
280 if ((wlat < 1) .OR. (wlat .gt. maxlat) .OR. &
281 (wlon < 1) .OR. (wlon .gt. maxlon)) dodisp = .false.
283 if (wlon .ge. 0)
then
284 wlon = mod(wlon, maxlon)
286 wlon = maxlon - mod(abs(wlon), maxlon)
288 if (wlon == 0) wlon=maxlon
289 if ((wlat < 1) .OR. (wlat .gt. maxlat)) dodisp = .false.
291 if (wlat .ge. 0)
then
292 wlat = mod(wlat, maxlat)
294 wlat = maxlat - mod(abs(wlat), maxlat)
296 if (wlat == 0) wlat = maxlat
297 if ((wlon < 1) .OR. (wlon .gt. maxlon)) dodisp = .false.
299 if (wlat .ge. 0)
then
300 wlat = mod(wlat, maxlat)
302 wlat = maxlat - mod(abs(wlat), maxlat)
304 if (wlat == 0) wlat = maxlat
305 if (wlon .ge. 0)
then
306 wlon = mod(wlon,maxlon)
308 wlon = maxlon - mod(abs(wlon), maxlon)
310 if (wlon == 0) wlon = maxlon
312 write(70,*)
'wrong boundary conditions : ', boundaries,
', choose one of a, c, s, w; set to absorbing'
313 if ((wlat < 1) .OR. (wlat .gt. maxlat) .OR. &
314 (wlon < 1) .OR. (wlon .gt. maxlon)) dodisp = .false.
subroutine drawfromdistri(n, p, ix)
DrawFromDistri
subroutine updatenewseeds(nspc, iam, dodispersal, year, lats, late, lons, lone)
UpdateNewSeeds.
subroutine seedsfromoutssimregion(nspc, dodispersal, year, lats, late, lons, lone)
SeedsFromOutsSimRegion.
subroutine seedsdispersedfromthiscell(nspc, lat, lon)
SeedsDispersedFromThisCell: Does the explicit seed dispersal for all species.
subroutine boundaryconditions(wlat, maxlat, wlon, maxlon, dodisp, boundaries)
BoundaryConditions, evaluates whether the sink cell is in the simulation domain.
subroutine seedsdispfromthiscellandspec(isp, lat, lon)
SeedsDispFromThisCellAndSpec, for brute force dispersal without FFT.
real, dimension(:, :), allocatable stockability
type(specproperties), dimension(maxspc) spec
type(currstateincell), dimension(:, :), allocatable stategrid
type(newseedsincell), dimension(:, :), allocatable seedrain
character(len=:), allocatable boundaries
character(len=1024) logmessage
subroutine logerror(msg)
LogError