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

Go to the source code of this file.

Functions/Subroutines

subroutine calculateandstoredispersalkernelofspecies (isp, dofft)
 CalculateAndStoreDispersalKernelOfSpecies

 
subroutine dispersalkernel (isp)
 DispersalKernel

 
subroutine singlekernel (alpha, cellsidelength, epskernel, rad_c)
 SingleKernel

 
subroutine doublekernel (dispfac, alfa1, alfa2, cellsidelength, epskernel, rad_c)
 DoubleKernel

 
real function centertocentervalue (alpha, cellsidelength, latwin, lonwin)
 CenterToCenterValue

 
real function kernelvalue (dist, alpha)
 KernelValue

 

Function/Subroutine Documentation

◆ calculateandstoredispersalkernelofspecies()

subroutine calculateandstoredispersalkernelofspecies ( integer, intent(in) isp,
logical, intent(in) dofft )

CalculateAndStoreDispersalKernelOfSpecies


-Calculates the dispersal kernel of one species and stores it to spec.
-sets the dimensions for the FFT (if dispersal by FFT) -calculates the FF transformed kernel (if dispersal by FFT)

  • USE: FileListModule, All_par
  • IN:
    • Parameters
      isp!>> species index
      doFFT!>> flag whether dispersal is done by FFT or not
    • from ALL_par:
      • readDispersalKernel: LOGICAL: read in a previously stored dispersal kernel?
      • spec(maxspc):TYPE(SpecProperties) !>> : species properties; here a.o. all species parameters are put to spec
      • kernelType: INTEGER: 3 different options for shape of kernel: 0: radius, 1: single exponential, 2: double exponential
    • from FileListModule:
      • File: TYPE
      • DispersalKernel_File: TYPE(File): file from which to read in dispersal kernel if wished
      • DispersalKernelNew_File: TYPE(File): file to which to write out dispersal kernel
  • OUT:
    • via All_par:
      • spec(maxspc) :TYPE(SpecProperties): species properties; here a.o. the dispersal kernels are put to spec
  • CALLS:

Definition at line 46 of file DispersalKernel.f90.

◆ centertocentervalue()

real function centertocentervalue ( real, intent(in) alpha,
real, intent(in) cellsidelength,
integer, intent(in) latwin,
integer, intent(in) lonwin )

CenterToCenterValue


Calculates the value of the dispersal kernel between the centers of a source cell and and a target cell

  • IN:
    • Parameters
      latwin,lonwin: coordinates of target cell
      alpha: Parameter characterizing slope of kernel; mean dispersal distance
      cellSideLength: Side-lenght of grid cells
  • OUT:
    • Parameters
      CenterToCenterValue: value of dispersal kernel in the given target cell
  • CALLS:
  • CALLED from:

Definition at line 342 of file DispersalKernel.f90.

◆ dispersalkernel()

subroutine dispersalkernel ( integer, intent(in) isp)

DispersalKernel


Calculates the generatl dispersal kernel of one species, either by a single or a double kernel Allocates the kernel and stores it and its radius in spec

  • USE: FileListModule, All_par
  • IN:
    • Parameters
      isp: species index
    • from ALL_par:
      • spec(maxspc): TYPE(SpecProperties): species properties dispFac, alfa1, alfa2
      • dispersalDifferent: LOGICAL: different kernels for the species? Usually FALSE
      • kernelType: INTEGER: 3 different options for shape of kernel: 0: radius, 1: single exponential, 2: double exponential
      • epsKernel: REAL: threshold for cut-off of kernel , all values smaller than this are set to 0
      • cellSideLength: REAL: Side-lenght of grid cells
      • alpha_all: REAL: Alpha-value of kernel if all kernels are the same
      • kernel(:, :): REAL, allocatable: intermediate array for kernel
  • OUT:
    • via All_par:
      • TYPE(SpecProperties) : spec(maxspc): species properties kernel and rad
  • CALLS:
  • CALLED FROM:

Definition at line 142 of file DispersalKernel.f90.

◆ doublekernel()

subroutine doublekernel ( real, intent(in) dispfac,
real, intent(in) alfa1,
real, intent(in) alfa2,
real, intent(in) cellsidelength,
real, intent(in) epskernel,
integer, intent(out) rad_c )

DoubleKernel


Calculates the double dispersal kernel of one species by adding two single kernels

  • USE: All_par
  • IN:
    • Parameters
      dispFac: proportion of short distance dispersal
      alfa1,alfa2: Parameter characterizing slope of kernel; mean dispersal distance
      cellSideLength: Side-lenght of grid cells
      epsKernel: threshold for cut-off of kernel , all values smaller than this are set to 0
  • OUT:
    • Parameters
      rad_c: radius of combined kernel -*via All_par:*
      • REAL, allocatable:: kernel(:, :) !>> intermediate array for kernel in actual discretization
      • REAL, allocatable:: kernelFine(:, :) !>> intermediate array for kernel in fine discretization
  • CALLS:
  • CALLED from:

Definition at line 293 of file DispersalKernel.f90.

◆ kernelvalue()

real function kernelvalue ( real, intent(in) dist,
real, intent(in) alpha )

KernelValue


Calculates the value of the dispersal kernel at a certain distance

  • IN:
    • Parameters
      alpha: Parameter characterizing slope of kernel; mean dispersal distance
      dist: euclidian distance between source cell and sink cell
  • OUT:
    • Parameters
      KernelValue: value of dispersal kernel
  • CALLED from:

Definition at line 364 of file DispersalKernel.f90.

◆ singlekernel()

subroutine singlekernel ( real, intent(in) alpha,
real, intent(in) cellsidelength,
real, intent(in) epskernel,
integer, intent(out) rad_c )

SingleKernel


Calculates the single dispersal kernel of one species

  1. dimensions and resolution of the actual kernel and a fine discretization kernel are determined
  2. the values of this fine resolution kernel are calculated between the centers of the center cell and of the other grid cells for one quadrant
  3. this quadrant is copied to the other 3 quadrants
  4. the kernel values all fine discretization cells within one actual discretization cell are summed
  5. the actual kernel is normalized The idea of using the fine dispersal kernel is to reduce the discretization error, which would arise by simply calculating the actual dispersal kernel values between the centers of the actual discretization cells
  • USE: All_par
  • IN:
    • Parameters
      alpha_all: Parameter characterizing slope of kernel; mean dispersal distance
      cellSideLength: Side-lenght of grid cells
      epsKernel: threshold for cut-off of kernel , all values smaller than this are set to 0
  • OUT:
    • Parameters
      rad: radius of kernel
    • via All_par:
      • REAL, allocatable: kernel(:, :) : intermediate array for kernel in actual discretization
      • REAL, allocatable: kernelFine(:, :) : intermediate array for kernel in fine discretization
  • CALLS:
  • CALLED from:

Definition at line 198 of file DispersalKernel.f90.