ETHZ_Logo RAMSES_Logo_Right   RAMSES   RAMSES_Logo_Left Systems Ecology  
Start    search button      Modules:   A-Z   Function   Layer        QuickRefs:   DM   AuxLib   AuxLibE   SciLib   EasyMW   MW   ISIS   RMSLib

DEFINITION MODULE TreePopuls;

  (*******************************************************************

    Module  TreePopuls     (Version 1.0)

      Copyright (c) 2003-2006 by Dimitrios Gyalistras and ETH Zurich.

    Purpose   Data types and procedures to handle
              tree cohorts and populations.

    Remarks   This module is part of the package Trees.


    Programming

      o Design
        Dimitrios Gyalistras      19/07/2003

      o Implementation
        Dimitrios Gyalistras      19/07/2003


    ETH Zurich
    Systems Ecology
    CHN E 35.1
    Universitaetstrasse 16
    8092 Zurich
    SWITZERLAND

    URLs:
        <mailto:RAMSES@env.ethz.ch>
        <http://www.sysecol.ethz.ch>
        <http://www.sysecol.ethz.ch/SimSoftware/RAMSES>


    Last revision of definition:  22/06/2006  DG

  *******************************************************************)


  FROM SYSTEM IMPORT
    ADDRESS;

  FROM TreeSpecies IMPORT
    TreeSpecies, TSParamsPtr;


  CONST
    CohortMaxMemory  = 10;


  TYPE
    TreePopulAttr    = ADDRESS;

    CohortMemoryRArr = ARRAY [1..CohortMaxMemory] OF REAL;

    CohortPtr        = POINTER TO CohortRec;

    TreePopulPtr     = POINTER TO TreePopulRec;

    CohortRec        = RECORD
                         parentPop        : TreePopulPtr;
                         params           : TSParamsPtr;
                         cohortId         : LONGINT; (* unique id of cohort, e.g. for monitoring *)
                         attribute        : LONGINT; (* for free use *)
                         next             : CohortPtr;
                         (* cohort state *)
                         age              : INTEGER; (* age of cohort *)
                         nrTrees          : INTEGER; (* number of trees in cohort *)
                         D                : REAL;    (* diameter at breast height, cm *)
                         slowGrowth       : INTEGER; (* counter registering slow growth *)
                         (* cohort growth / state change *)
                         gALGF            : REAL;
                         gSMGF            : REAL;
                         gDDGF            : REAL;
                         gSNGF            : REAL;
                         gF               : REAL;
                         DIncMax          : REAL;    (* this year's maximum diameter increment *)
                         DInc             : REAL;    (* this year's diameter increment *)
                         relDInc          : CohortMemoryRArr;    (* stored relative diameter increments *)
                         relBAInc         : CohortMemoryRArr;    (* stored relative basal area increments *)
                         (* diagnostic variables *)
                         gH               : REAL;    (* tree height, cm *)
                         gFolA            : REAL;    (* leaf area *)
                         gSBio            : REAL;    (* FC24: dry stemwood biomass, FC26: stemwood biomass (Derbholz, diameter > 3 inches)  *)
                         gFolW            : REAL;    (* FC24 & FC26: dry foliage biomass *)
                         gTBio            : REAL;    (* FC26: dry twigwood biomass (branches and twigs, i.e. wood < 3" diameter) *)
                         gRBio            : REAL;    (* FC26: dry large root biomass *)
                         gFRBio           : REAL;    (* FC26: dry fine root biomass *)
                         biomass          : REAL;    (* biomass of cohort *)
                         (* mortality in cohort  *)
                         totNumDeaths     : INTEGER;
                       END;

    TreePopulRec     = RECORD
                         species          : TreeSpecies; (* parent species *)
                         firstCoh         : CohortPtr;
                         firstNewCoh      : CohortPtr;
                         attribute        : TreePopulAttr;  (* for free use *)
                         next             : TreePopulPtr;
                         (* general state of population *)
                         nrTrees          : REAL;        (* average #/patch *)
                         biomass          : REAL;        (* average kg/ha/patch *)
                         stemWdBiom       : REAL;
                         twigBiom         : REAL;
                         foliageBiom      : REAL;
                         coarseRtBiom     : REAL;
                         fineRtBiom       : REAL;
                         (* tree establishment for population  *)
                         nWinTemperLim    : REAL;
                         nLightLim        : REAL;
                         nBrowsingLim     : REAL;
                         nDegDaysLim      : REAL;
                         nTreeEstblFailed : REAL;
                         (* mean growth factors for population  *)
                         gALGF            : REAL;
                         gSMGF            : REAL;
                         gDDGF            : REAL;
                         gSNGF            : REAL;
                         gF               : REAL;
                         (* mortality in population  *)
                         totNumDeaths     : REAL;
                         nAgeRltdDeaths   : REAL;
                         nSlowGrwthDeaths : REAL;
                         nSlowGrwthCond1  : REAL;
                         nSlowGrwthCond2  : REAL;
                         nDstrbRltdDeaths : REAL;
                       END;

  VAR
    undefCohortPtr     : CohortPtr;     (* read only *)
    undefTreePopulPtr  : TreePopulPtr;  (* read only *)
    undefTreePopulAttr : TreePopulAttr; (* read only *)


  (*************************)
  (*#####   Cohorts   #####*)
  (*************************)

  PROCEDURE AllocCohort      ( VAR first   : CohortPtr;
                               parentPopul : TreePopulPtr;
                               parameters  : TSParamsPtr;
                               kInitDBH    : REAL;
                               nrOfTrees   : INTEGER );

  PROCEDURE DeallocCohort    ( VAR first, cohort: CohortPtr );

  PROCEDURE DeallocAllCohorts( VAR tp: TreePopulPtr );

  PROCEDURE MergeCohortLists ( VAR tp: TreePopulPtr );


  (**********************************)
  (*#####   Tree populations   #####*)
  (**********************************)

  PROCEDURE AllocTreePopul      ( VAR first : TreePopulPtr;
                                  species   : TreeSpecies );

  PROCEDURE FindTreePopul       ( VAR first : TreePopulPtr;
                                  species   : TreeSpecies ): TreePopulPtr;

  PROCEDURE DeallocTreePopul    ( VAR first : TreePopulPtr;
                                  species   : TreeSpecies );

  PROCEDURE DeallocAllTreePopuls( VAR first : TreePopulPtr );


END TreePopuls.

  Contact RAMSES@env.ethz.ch Last updated: 25-Jul-2011 [Top of page]