Jeff D. Hamann - 2001-07-16

/****************************************************************************/
/* This structure is use for running growth and yield models                */
/* It is a basic tree definition                                            */
/*                                                                          */
/* revised:                                                                 */
/*    gpj july 4, 2001                                                      */
/*    jdh july 8, 2001                                                      */
/****************************************************************************/

struct __TREE_RECORD
{  
    unsigned short        validated;        /* has this tree record been
                                        validated for use by model? */

    /* tree identification  */
    unsigned short  tree;           /* tree id for the plot         */
    unsigned short  sp_code;        /* species code                  */
    unsigned short  total_age;      /* total tree age               */
    unsigned short  bh_age;         /* breast height age of tree    */

    /* tree location for distance-dependent growth models */
    double          x_pos;          /* x part of location coordinate    */
    double          y_pos;          /* y part of location coordinate    */

    /* tree dimensions  */
    double          dbh;            /* diameter at breast height    */
    double          basal_diameter; /* basal diameter               */
    double          total_height;   /* total stem height            */
    double          crown_ratio;    /* crown ratio                  */
    double          crown_width;    /* crown width                  */
    double          expf;           /* expansion (weight) factor    */

    /* tree condition           */
    unsigned short    damage_code;        /* a model-defined damage code    */
    unsigned short    damage_severity;    /* damage severity                */

    /* tree dimension change    */
    double          dbh_change;
    double          basal_diameter_change;   
    double          ht_change;        
    double          cr_change;  
    double          cw_change;
    double          expf_change;      
};

/* this is the fortran90 version of the tree record */
module header
   
    implicit none

    type :: __TREE_RECORD

        sequence

        integer(2) ::   validated;

        integer(2) ::   tree;          
        integer(2) ::   sp_code;       
        integer(2) ::   total_age;     
        integer(2) ::   bh_age;        

        real(8) ::      x_pos;         
        real(8) ::      y_pos;         

        real(8) ::      dbh;           
        real(8) ::      basal_diameter;
        real(8) ::      total_height;  
        real(8) ::      crown_ratio;   
        real(8) ::      crown_width;   
        real(8) ::      expf;          

        integer(2) ::   damage_code;
        integer(2) ::   damage_severity;

        real(8) ::      dbh_change;
        real(8) ::      basal_diameter_change;   
        real(8) ::      ht_change;        
        real(8) ::      cr_change;  
        real(8) ::      cw_change;
        real(8) ::      expf_change;      

    end type __TREE_RECORD

end module header

/* we can't use the underscore for vb code. causes error */
Type TREE_RECORD
   
    validated               As Integer

    tree                    As Integer
    sp_code                 As Integer
    total_age               As Integer
    bh_age                  As Integer

    x_pos                   As Double
    y_pos                   As Double

    dbh                     As Double
    basal_diameter          As Double
    total_height            As Double
    crown_ratio             As Double
    crown_width             As Double
    expf                    As Double

    damage_code             As Integer
    damage_severity         As Integer

    dbh_change              As Double
    basal_diameter_change   As Double
    ht_change               As Double
    cr_change               As Double
    cw_change               As Double
    expf_change             As Double
   
End Type