This module contains generic subroutines that can be used to define, accumulate and extract user-specified fields over user-defined intervals. Each interval and accumulation type is unique to each field processed. Subroutine [init_accumulator] defines the values of the accumulated field data structure. Subroutine [update_accum_field] does the actual accumulation for a given field. Four types of accumulations are possible: - Average over time interval. Time average fields are only valid at the end of the averaging interval. - Running mean over time interval. Running means are valid once the length of the simulation exceeds the - Running accumulation over time interval. Accumulated fields are continuously accumulated. The trigger value "-99999." resets the accumulation to zero.
use shr_kind_mod, only: r8 => shr_kind_r8 use abortutils , only: endrun use clm_varctl , only: iulog use nanMod , only: bigintPUBLIC TYPES:
implicit none savePUBLIC MEMBER FUNCTIONS:
public :: accumulRest ! Write/read restart of accumulation fields public :: init_accum_field ! Initialize an accumulator field public :: print_accum_fields ! Print info about accumulator fields public :: extract_accum_field ! Extracts the current value of an accumulator field public :: update_accum_field ! Update the current value of an accumulator field interface extract_accum_field module procedure extract_accum_field_sl ! Extract current val of single-level accumulator field module procedure extract_accum_field_ml ! Extract current val of multi-level accumulator field end interface interface update_accum_field ! Updates the current value of an accumulator field module procedure update_accum_field_sl ! Update single-level accumulator field module procedure update_accum_field_ml ! Update multi-level accumulator field end interfaceREVISION HISTORY:
Created by Sam Levis Updated to clm2.1 data structures by Mariana Vertenstein Updated to include all subgrid type and multilevel fields, M. Vertenstein 03/2003 privatePRIVATE TYPES: