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

Go to the source code of this file.

Functions/Subroutines

subroutine seedrainbyfft (nspc, year)
 SeedRainByFFT

 
subroutine seedrainbyfftforthisspec (isp, year)
 SeedRainByFFTForThisSpec.
 
subroutine printmatrixasxy2file (array, dimystart, dimyend, dimxstart, dimxend, varname)
 PrintMatrixASXY2File.
 
subroutine calculatekerneltransformation (isp)
 CalculateKernelTransformation.
 

Function/Subroutine Documentation

◆ calculatekerneltransformation()

subroutine calculatekerneltransformation ( integer, intent(in) isp)

CalculateKernelTransformation.


Prepares and performs the FFT of the dispersal kernel of one species

  1. calculates the dimensions for the kernel arrays
  2. allocates the kernel arrays
  3. shifts the kernels so that the kernel dimensions are even
  4. does the GFT transformation of the shifted kernel
  5. stores the kernel in frequency domain in spec(isp)kernel_FT

USE: GFT, All_par

  • IN:
    • Parameters
      ispspecies index
    • FROM All_par
      • spec(maxspc) : TYPE(SpecProperties) : species properties, here to get the intermediate and large area dimensions for fft maxlatEvenext, maxlonEvenext, maxlatExt, maxlonExt for this species
      • maxlatExt, maxlonExt, INTEGER : dimensions of intermediate area (next power of 2 of original area plus a buffer)
      • maxlatEvenext,maxlonEvenext : dimensions of large area (next power of 2)
    • FROM GFT
      • GFT_Prec : INTEGER : precision of the GFT calculations
  • OUT:
    • via All_par
      • spec(isp)kernel_FT, TYPE(SpecProperties),REAL, allocatable, species properties, allocated in AllocateSpecKernel in AllocateAreasAndKernels.f90
  • CALLED FROM:
  • CALLS:

Definition at line 200 of file GFT_Interact.f90.

◆ printmatrixasxy2file()

subroutine printmatrixasxy2file ( real(kind=gft_prec), dimension(dimystart:dimyend,dimxstart:dimxend), intent(in) array,
integer, intent(in) dimystart,
integer, intent(in) dimyend,
integer, intent(in) dimxstart,
integer, intent(in) dimxend,
character(*), intent(in) varname )

PrintMatrixASXY2File.


Writes out intermediate files of FFT-arrays as y, x, z, files with y,x relative spatial indices

  • USE: GFT
  • IN:
    • Parameters
      dimystart,dimyend,dimxstart,dimxenddimensions of array
      array: to be written out
      varname: variable name of the array to be written out
    • FROM GFT
      • GFT_Prec : INTEGER : precision of the GFT calculations
  • OUT: only output file in folder AreaOutputs with varname.txt
  • CALLED FROM:

Definition at line 147 of file GFT_Interact.f90.

◆ seedrainbyfft()

subroutine seedrainbyfft ( integer, intent(in) nspc,
integer, intent(in) year )

SeedRainByFFT


Calculates the seedrain by FFT for each species. The FFT version only works in the non-parallel setting

  • IN:
    • Parameters
      nspc: number of species
      year: relative simulation year (0 to simulation duration)
  • CALLS:
  • CALLED FROM:

Definition at line 14 of file GFT_Interact.f90.

◆ seedrainbyfftforthisspec()

subroutine seedrainbyfftforthisspec ( integer, intent(in) isp,
integer, intent(in) year )

SeedRainByFFTForThisSpec.


Calculates the seedrain by FFT for one species and filters with stockability

  1. stores seed production to the small extended area, just for giving it to the convolution subprogram
  2. stores the dispersal kernel, just for giving it to the convolution subprogram
  3. does the GFT convolution between seed production and dispersal kernel
  4. cleans noise in the calculated seedrain, i.e. sets very low values to 0
  5. stores back the calculated seedrain to the smaller area
  6. masks out by stockability, i.e. sets to zero where stockability is 0

USE: All_par, GFT

  • IN:
    • Parameters
      isp: species index
      yearrelative simulation year
    • FROM All_par
      • spec(maxspc) : TYPE(SpecProperties) : species properties, here to get the intermediate and large area dimensions for fft maxlatEvenext, maxlonEvenext, maxlatExt, maxlonExt for this species
      • maxlat, maxlon : INTEGER, : dimensions of simulation area
      • seednumberthresh : REAL, parameter,=0. : threshold for reasonable amount of seeds, [1/ha]
      • epsKernel : REAL : threshold for cut-off of kernel
      • stockability : REAL, dimension(:, :), allocatable : : spatial mask to filter out the non-stockable areas in the seed rain
      • stateGrid : TYPE(CurrStateInCell), dimension(:, :), allocatable : current state in each cell (the entire grid)
  • OUT:
  • CALLS:
  • CALLED FROM:

Definition at line 57 of file GFT_Interact.f90.