Researchers will often wish to add new science subroutines to CLM to perform new simulation experiments or to develop model improvements. Since new science subroutines frequently require new variables for tracking additional quantities throughout simulations, all primary variables are declared and allocated in individual modules. Like the variables described above, new variables must be declared in the module clmtype (Section A.47) and allocated and initialized in the module clmtypeInitMod (Section A.48).
Within clmtype, quantities are arranged into process-specific derived data types. For instance, variables describing the physical state of PFTs are contained in the pft_pstate_type data type. New variables describing the physical state of PFTs should be added to this data type, usually as double precision pointers with an unspecified single dimension (e.g., real(r8), pointer :: varname(:)). Multi-level quantities would have two unspecified dimensions.
Within clmtypeInitMod, variables are allocated and initialized in subroutines having names similar to the derived data type name in which the variables reside. For example, quantities in pft_pstate_type are allocated and initialized in init_pft_pstate_type (Section A.48.8). A new PFT physical state variable should be allocated (e.g., allocate(pps%varname(beg:end))) and initialized to NaN (e.g., pps%varname(beg:end) = nan) in the order in which the quantity is declared in the derived data type in clmtype.