36 character(len=500) :: errormsg
38 call loginfo(
"Allocating areas...")
41 call checkalloc(alloc_st, errormsg,
"seedrain")
44 call checkalloc(alloc_st, errormsg,
"stockability")
48 call checkalloc(alloc_st, errormsg,
"landcoverfilter")
52 call checkalloc(alloc_st, errormsg,
"stocksum")
56 call checkalloc(alloc_st, errormsg,
"stocksumcum")
64 call checkalloc(alloc_st, errormsg,
"stateGrid")
68 call checkalloc(alloc_st, errormsg,
"oldBioClim%bc")
71 call checkalloc(alloc_st, errormsg,
"newBioClim%bc")
99 INTEGER,
INTENT(in) :: rad
100 character*10,
INTENT(in):: vartxt
102 character(len=500) :: errormsg
107 allocate (
kernel(-rad:rad, -rad:rad), stat=alloc_st, errmsg=errormsg)
111 allocate (
kernel1(-rad:rad, -rad:rad), stat=alloc_st, errmsg=errormsg)
115 allocate (
kernel2(-rad:rad, -rad:rad), stat=alloc_st, errmsg=errormsg)
119 allocate (
kernelfine(-rad:rad, -rad:rad), stat=alloc_st, errmsg=errormsg)
122 call logwarning(
"Cannot allocate "//trim(vartxt)//
". Not defined!>")
153 INTEGER,
INTENT(in) :: rad, ispec
155 character*17 :: vartxt
156 character(len=500) :: errormsg
158 if (
allocated(
spec(ispec)%kernel))
deallocate (
spec(ispec)%kernel)
159 allocate (
spec(ispec)%kernel(-rad:rad, -rad:rad), stat=alloc_st, errmsg=errormsg)
160 vartxt =
"species "//char(ispec)//
" kernel"
162 spec(ispec)%kernel(-rad:rad, -rad:rad) = 0
185 INTEGER,
INTENT(in) :: ispec
187 character*17 :: vartxt
188 character(len=500) :: errormsg
190 if (
allocated(
spec(ispec)%kernel_FT))
deallocate (
spec(ispec)%kernel_FT)
191 allocate (
spec(ispec)%kernel_FT(0 :
spec(ispec)%maxlatExt/2, 1 :
spec(ispec)%maxlonExt), stat=alloc_st, errmsg=errormsg)
192 vartxt =
"species "//char(ispec)//
" transformed kernel"
194 spec(ispec)%kernel_FT(0:
spec(ispec)%maxlatExt/2, 1:
spec(ispec)%maxlonExt) = 0.
216 INTEGER,
INTENT(in) :: alloc_st
217 character(len=*),
INTENT(in):: errormsg
218 character(len=*),
INTENT(in):: txt
219 if (alloc_st /= 0)
then
220 call logerror(
"Could not allocate '"//trim(txt)//
"', "//trim(errormsg))
subroutine allocatespeckernel(rad, ispec)
AllocateSpecKernel.
subroutine allocatespectransformedkernel(ispec)
AllocateSpecTransformedKernel.
subroutine checkalloc(alloc_st, errormsg, txt)
CheckAlloc.
subroutine allocateareas
AllocateAreas.
subroutine allocatekernel(rad, vartxt)
AllocateKernel.
real, dimension(:, :), allocatable landcoverfilter
real, dimension(:, :), allocatable stockability
real, dimension(:, :), allocatable kernel2
real, dimension(:,:, 1:maxspc, 0:3), allocatable avbio
type(specproperties), dimension(maxspc) spec
type(currstateincell), dimension(:, :), allocatable stategrid
real, dimension(:, :), allocatable kernel1
type(bioclimdata) newbioclim
real, dimension(:, :), allocatable kernel
type(newseedsincell), dimension(:, :), allocatable seedrain
real, dimension(:), allocatable stocksumcum
real, dimension(:, :), allocatable kernelfine
integer, parameter maxspc
type(bioclimdata) oldbioclim
real, dimension(:), allocatable stocksum
subroutine logwarning(msg)
LogError
subroutine loginfo(msg)
LogInfo
subroutine logerror(msg)
LogError