TreeMig Code
Loading...
Searching...
No Matches
Interact.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine seedsdispersedfromthiscell (nspc, lat, lon)
 SeedsDispersedFromThisCell: Does the explicit seed dispersal for all species.
 
subroutine seedsdispfromthiscellandspec (isp, lat, lon)
 SeedsDispFromThisCellAndSpec, for brute force dispersal without FFT.
 
subroutine updatenewseeds (nspc, iam, dodispersal, year, lats, late, lons, lone)
 UpdateNewSeeds.
 
subroutine seedsfromoutssimregion (nspc, dodispersal, year, lats, late, lons, lone)
 SeedsFromOutsSimRegion.
 
subroutine boundaryconditions (wlat, maxlat, wlon, maxlon, dodisp, boundaries)
 BoundaryConditions, evaluates whether the sink cell is in the simulation domain.
 

Function/Subroutine Documentation

◆ boundaryconditions()

subroutine boundaryconditions ( integer, intent(inout) wlat,
integer, intent(in) maxlat,
integer, intent(inout) wlon,
integer, intent(in) maxlon,
logical, intent(out) dodisp,
character(1), intent(in) boundaries )

BoundaryConditions, evaluates whether the sink cell is in the simulation domain.


Determines whether - under prescribed boundary conditions - a sink cell is valid, and if not puts the seeds somewhere else it is quite a mess with these preprocessor statements, no idea why ( maybe for efficiency) this was introduced (by Julia?). The case part should be reactivated and then the variable be read in from control pars again.

  • IN:
    • Parameters
      maxlat,maxlon:number of rows and columns of simulation domain
      lat,wlon: absolute coordinates for latitude longitude of sink cell as originally proposed [=..]
      wlat,wlon: absolute coordinates for latitude longitude of sink cell, potentially modified [=..]
      boundariesboundary condition, absorbing (a), cyclic (c), half-cyclic south-north (s), half-cyclic west-east (w)
  • OUT:
    • Parameters
      dodisp: do dispersal into the originally determined sink cell? [=..]
      wlat,wlon: absolute coordinates for latitude longitude of sink cell, potentially modified [=..]
  • CALLED FROM:

Definition at line 262 of file Interact.f90.

◆ seedsdispersedfromthiscell()

subroutine seedsdispersedfromthiscell ( integer, intent(in) nspc,
integer, intent(in) lat,
integer, intent(in) lon )

SeedsDispersedFromThisCell: Does the explicit seed dispersal for all species.


  • IN:
    • Parameters
      nspcnumber of species
      lat,loncoordinates (relative) of current grid cell.
  • CALLS:
  • CALLED FROM:

Definition at line 29 of file Interact.f90.

◆ seedsdispfromthiscellandspec()

subroutine seedsdispfromthiscellandspec ( integer, intent(in) isp,
integer, intent(in) lat,
integer, intent(in) lon )

SeedsDispFromThisCellAndSpec, for brute force dispersal without FFT.


Does the explicit seed dispersal for one species from one source cell (lat,lon) to all sink cells

  1. explicit, brute force convolution
  2. if the source cell is stockable and has produced seeds of this species,
  3. all sink cells around the source cell within the range of the species's dispersal kernel are reached and
  4. the probability of seeds landing there is determined from the dispersal kernel
  5. According to the boundary conditions (absorbing, cyclic,...) it is determined whether the sink cell is the correct one
  6. The number of seeds landing in the sink cell is calculated
    1. either as a binomial distribution with the produced number of seeds (set to the next lower integer number) and the probability
    2. or as a fraction of the produced seeds
  7. This number of seeds landing in the sink cell is added to all seeds landing there.
  • USE: All_par
  • IN:
    • Parameters
      ispindex of species
      lat,loncoordinates (relative) of current grid cell
    • from All_Par:
      • maxlat, maxlon: INTEGER, number of rows and columns of simulation domain
      • doStochSeedDisp: LOGICAL, do dispersal stochastic or deterministic (i.e. interprete probabilities as fractions)
      • boundaries: CHAR*1, what type of boundary conditions, cyclic, absorbing, half-cyclic
      • spec(maxspc): TYPE(SpecProperties) : species properties; contains a.o. the species parameters are put to spec
      • stateGrid : TYPE(CurrStateInCell), dimension(:, :), allocatable : current state in each cell (the entire grid)
      • stockability: REAL, dimension(:,:), allocatable : stockability in each cell (the entire grid)
  • OUT:
    • via All_par:
      • seedrain: TYPE(NewSeedsInCell), dimension(:, :), allocatable: arriving seeds of all species in each cell (the entire grid)
  • CALLS:
  • CALLED FROM:

Definition at line 77 of file Interact.f90.

◆ seedsfromoutssimregion()

subroutine seedsfromoutssimregion ( integer, intent(in) nspc,
logical, intent(in) dodispersal,
integer, intent(in) year,
integer, intent(in) lats,
integer, intent(in) late,
integer, intent(in) lons,
integer, intent(in) lone )

SeedsFromOutsSimRegion.


adds a given number of seeds to all grid cells in seedrainnewSeeds; same for all species; default is 0.

  • USE: All_par
  • IN:
    • Parameters
      nspcnumber of species
      lats,late,lons,lonestart and end of coordinates (relative) of current grid subarea
      yearcurrent simulation year (relative)
      doDispersalif explicit dispersal has to be done done; normally the case; corresponds to idisp
    • from All_Par:
      • spec(maxspc): TYPE(SpecProperties) : species properties; contains a.o. the species parameters are put to spec
      • outerSeeds: INTEGER: number of seeds/patch entering cells from outside the total simulation area ("extraterrestrial seeds"). Read in in ReadControlPars.f90
  • OUT:
    • via All_par:
      • seedrain: TYPE(NewSeedsInCell), dimension(:, :), allocatable: arriving seeds of all species in each cell (the entire grid)
  • CALLED FROM:

Definition at line 217 of file Interact.f90.

◆ updatenewseeds()

subroutine updatenewseeds ( integer, intent(in) nspc,
integer, intent(in) iam,
logical, intent(in) dodispersal,
integer, intent(in) year,
integer, intent(in) lats,
integer, intent(in) late,
integer, intent(in) lons,
integer, intent(in) lone )

UpdateNewSeeds.


updates the seeds in the sink cells in a given subarea; in verynewseeds the current seeds landing in the subarea are collected. Once this is finished, all the seeds are transfered to the final variable newseeds.

Todo
not clear and confusing why this double storing is required. Should be checked.
  • USE: All_par
  • IN:
    • Parameters
      nspcnumber of species
      lats,late,lons,lonestart and end of coordinates (relative) of current grid subarea
      yearcurrent simulation year (relative)
      iamidentifier of processor (slave) if parallel computing
      doDispersalif explicit dispersal has to be done done; normally the case; corresponds to idisp
    • from All_Par:
      • spec(maxspc): TYPE(SpecProperties) : species properties; contains a.o. the species parameters are put to spec
  • OUT:
    • via All_par:
      • seedrain: TYPE(NewSeedsInCell), dimension(:, :), allocatable: arriving seeds of all species in each cell (the entire grid) CALLS support routines:
    • LogError in Logger.f90
    • LogMessage in Logger.f90
  • CALLED FROM:
    • SpatialDynOneTimeStep in SpatialDynOneTimeStep.f90
      Parameters
      [in]dodispersalLocal variables>------------------------------------------------------------------------------—

Definition at line 158 of file Interact.f90.