TreeMig Code
Loading...
Searching...
No Matches
Seedprod.f90
Go to the documentation of this file.
1!==============================================================================
2!
3! Name : Seedprod
4!
5! Purpose: Calculates the seeds, which are produced by all trees of one
6! species in one height class and in a certain light class and
7! sums them over all light classes. For each height class the
8! seeds are recorded.
9!
10! Remarks: contains the SUBROUTINEs
11!
12! Seedprod (<LocalDynOneTimeStep<DistrLocalDynThisTime<
13! TimeLoop<TreeMig)
14! SumSpecsSeedprodsOverHeights (<LocalDynOneTimeStep<LocalDynOneTimeStep<
15! DistrLocalDynThisTime<TimeLoop<TreeMig)
16!
17!==============================================================================
18! design : H. Lischke, N. Zimmermann
19! author(s) : H. Lischke, N. Zimmermann
20! implementation : H. Lischke, N. Zimmermann
21! cleaner : T.J. Loeffler
22! copyright : (c) 1999, 03 by H. Lischke
23!==============================================================================
24!=====================================================================
48!===============================================================
49
50SUBROUTINE seedprod(ispec, htcl, ntinh, year, thiscell)
51
52 ! <CALL modules for TYPE definitions and +- fixed variables>---------------------------------------------------------------
53 use all_par, only: speccl, spec, hcwidth, & ! Use species parameters
55
56 IMPLICIT NONE
57
58 ! <Passed variables>--------------------------------------------------------------------------------
59 INTEGER, INTENT(in) :: ispec, year, & ! species
60 htcl ! height class
61 REAL, INTENT(in) :: ntinh ! number of trees in this height-light class
62
63 ! <Local variables>---------------------------------------------------------------------------------
64 REAL :: maxSeedsPerTree, & ! actual number of seeds per tree
65 newSeeds, & ! actual number of seeds per tree species in this height class
66 fractionInLowHC ! fraction of seeds in lowest seed producing height class
67
68 TYPE(currstateincell), INTENT(inout):: thiscell
69 ! <Here the SUBROUTINE starts>**********************************************************************
70 !----- Determine how much seeds are produced by a tree of this species at maximum
71 maxseedspertree = spec(ispec)%maxseed !----- Repro: here also a light or density dependence of seed production could be included
72 !----- IF mast seeding desired, apply a sine-wave
73 if (mastseeding) maxseedspertree = 0.5*maxseedspertree* &
74 (1.0 + sin(6.2831853*real(year)/spec(ispec)%period))
75 !----- Calculate seeds produced by all trees of this species in this height class
76 newseeds = ntinh*speccl(ispec)%seedprod(htcl)*maxseedspertree
77 !----- If actual height class above lowest seed production height, no problem, just add the produced seeds
78 if (htcl .ge. ceiling(spec(ispec)%mathcp)) &
79 thiscell%sp(ispec)%seeds(htcl) = thiscell%sp(ispec)%seeds(htcl) + newseeds
80 !----- If actual height class just below lowest seed production height, add only proportion of the produced seeds
81 fractioninlowhc = (real(ceiling(spec(ispec)%mathcp)) - spec(ispec)%mathcp)/hcwidth
82 if (htcl == floor(spec(ispec)%mathcp)) &
83 thiscell%sp(ispec)%seeds(htcl) = thiscell%sp(ispec)%seeds(htcl) + newseeds*fractioninlowhc
84end SUBROUTINE seedprod
85!****<Here the SUBROUTINE ends>******************************************************************** !==============================================================================
86!=====================================================================
103!=====================================================================
104SUBROUTINE sumspecsseedprodsoverheights(nspc, thiscell)
105 use all_par, only: spec, currstateincell
106 IMPLICIT NONE
107 ! <Passed variables>--------------------------------------------------------------------------------
108 INTEGER, INTENT(in) :: nspc ! species
109 TYPE(currstateincell), INTENT(inout):: thiscell
110 ! <Local variables>---------------------------------------------------------------------------------
111 INTEGER:: htcl, isp
112 ! <Here the SUBROUTINE starts>**********************************************************************
113 do isp = 1, nspc
114 thiscell%sp(isp)%producedSeeds = 0.0
115 do htcl = floor(spec(isp)%mathcp), spec(isp)%maxhtc
116 thiscell%sp(isp)%producedSeeds = thiscell%sp(isp)%producedSeeds + thiscell%sp(isp)%seeds(htcl)
117 end do
118 end do
119end SUBROUTINE sumspecsseedprodsoverheights
120!done
subroutine sumspecsseedprodsoverheights(nspc, thiscell)
SumSpecsSeedprodsOverHeights.
Definition Seedprod.f90:105
subroutine seedprod(ispec, htcl, ntinh, year, thiscell)
Seedprod.
Definition Seedprod.f90:51
real hcwidth
Definition All_par.f90:357
type(specpropertiesincl), dimension(maxspc) speccl
Definition All_par.f90:346
type(specproperties), dimension(maxspc) spec
Definition All_par.f90:345
integer real
Definition All_par.f90:27
logical mastseeding
Definition All_par.f90:74