UW logo

Variable Infiltration Capacity (VIC)
Macroscale Hydrologic Model

Home | Links | Contact
Dept. of Civil and Env. Engineering
University of Washington
Box 352700
Seattle, WA 98195-2700
206.685.1796
vicadmin@hydro.washington.edu

VIC Compile-Time Options - user_def.h File

The header file user_def.h defines some global parameters of the simulation (known as compile-time options, since changing their values requires recompiling the model). Other global parameters, known as run-time options, are defined in the global parameter file and take effect as soon as the model reads the global parameter file.

The order of the parameters in the file is not important, but the complete option name must be followed by the required option type information. To help in understanding this file, an example file has been attached at the bottom of this page.

  • Note about compatibility with previous versions of VIC
  • Define Simulation Parameters
  • Define Data Dimensions
  • Example user_def.h File
  • Define Simulation Parameters

    The following options determine the type of simulation that will be performed

    Name

    Type

    Description

    VERBOSE

    TRUE or FALSE

    Option for controlling messages sent to the screen:

    • FALSE = Only print minimum information: errors, etc.
    • TRUE = Print much more information: file opening/closing, warnings, etc.

    CLOSE_ENERGY

    TRUE or FALSE

    Option for handling energy fluxes between components of the land surface (canopy, snow pack, ground):

    • FALSE = Estimate energy balance of each component individually, using incoming fluxes from the other components from the previous time step.
    • TRUE = Take interactions among the components by iterating: solve each component separately and update the outgoing fluxes from each component, then solve each component again using the updated incoming fluxes from the other components, and repeat until desired exit condition reached.

    Note: both methods generally give similar results, but while setting CLOSE_ENERGY to FALSE improves speed, it results in energy balance errors.

    LINK_DEBUG

    TRUE or FALSE

    Option for printing debugging messages (values of components of water or energy balance, or other internal variables):

    • FALSE = do not print debugging messages.
    • TRUE = print debugging messages.

    QUICK_FS

    TRUE or FALSE

    Option for speeding up frozen soil calculations:

    • FALSE = use full equations for estimating maximum unfrozen water content.
    • TRUE = use linearized version of maximum unfrozen water content equations, defined in global.h. These equations significantly improve speed when simulating frozen soil.

    Note: this method is not fully tested.

    QUICK_FS_TEMPS

    integer

    Number of terms to use in linearized maximum unfrozen water calcuation. This is only used if QUICK_FS is TRUE; otherwise it is ignored.

    LOW_RES_MOIST

    TRUE or FALSE

    Option for improving accuracy of soil moisture drainage calculations:

    • FALSE = assume uniform matric potential within each soil layer.
    • TRUE = use linear interpolation of logarithm of the matric potential from the two adjacent layers to estimate drainage across the layer boundary (Boone and Wetzel, 1996).

    Note: this method is not fully tested.

    NO_REWIND

    TRUE or FALSE

    Option for controlling reading of parameter files:

    • FALSE = Rewinds (goes back to the beginning of) parameter files before reading the data for each cell.
    • TRUE = Does not rewind parameter files before reading the data for each cell. This saves time but requires that the order of grid cells in all files is the same.

    OUTPUT_FORCE

    TRUE or FALSE

    Option to save VIC's internal, disaggregated forcings:

    • FALSE = Run a simulation (including disaggregating the forcings).
    • TRUE = Do not run a simulation; simply disaggregate the forcings and write them to output files. This allows us to use VIC as a meteorological forcing disaggregator. Note that in this mode of operation, VIC should be executed the same way as normal: VIC still must read a global parameter file that tells it the locations of the forcings and soil parameter file, and sets the model time step (this is the time step the forcings will be disaggregated to), the output time step (usually the same as the model time step in this case), and start/end dates.

    OUTPUT_FORCE_STATS

    TRUE or FALSE

    Option to compute the statistics of the forcings:

    • FALSE = Run a simulation (including disaggregating the forcings).
    • TRUE = Do not run a simulation; simply compute the mean, standard deviation, and min and max values of the forcing variables and write them to stdout.

    SPATIAL_FROST

    TRUE or FALSE

    Option to allow spatial heterogeneity in soil temperature:

    • FALSE = Assume soil temperature is horizontally constant (only varies with depth)
    • TRUE = Assume soil temperatures at each given depth are distributed horizontally with a uniform (linear) distribution, so that even when the mean temperature is below freezing, some portion of the soil within the grid cell at that depth is above freezing. This requires specifying a frost slope value as an extra field in the soil parameter file, so that the minimum/maximum temperatures can be computed from the mean value.

    FROST_SUBAREAS

    integer

    Number of discrete values in the soil temperature distribution. This is only used if SPATIAL_FROST is TRUE; otherwise it is ignored.

    SPATIAL_SNOW

    TRUE or FALSE

    Option to allow spatial heterogeneity in snow water equivalent (yielding partial snow coverage) when the snow pack is melting:

    • FALSE = Assume snow water equivalent is constant across grid cell
    • TRUE = Assume snow water equivalent is distributed horizontally with a uniform (linear) distribution, so that some portion of the grid cell has 0 snow pack. This requires specifying a snow slope value as an extra field in the soil parameter file, so that the minimum/maximum snow water equivalents can be computed from the mean value.

    EXCESS_ICE

    TRUE or FALSE

    Optional permafrost behavior:

    • FALSE = No excess ice in the soil; porosities, densities, etc are exactly as described in the soil parameter file.
    • TRUE = Excess ground ice in the soil. This requires user to specify the initial volumetric ice content of the soil as an additional parameter in the soil parameter file. VIC computes effective porosities, densities, etc. based on presence of excess ground ice. As the excess ice melts, these effective porosities and densities approach their ice-free values. Excess soil moisture resulting from the melt is expelled as runoff or baseflow.

    MAXIT_FE

    integer

    Maximum number of iterations to use in solving the surface energy balance

    LAI_WATER_FACTOR

    float

    Coefficient multiplied by the LAI to determine the amount of water that can be stored in the canopy.

    LWAVE_COR

    float

    Longwave correction factor, used to correct estimated incoming longwave radiation (use 1, unless measured longwave available for calibration)

    Define Data Dimensions

    The following parameters define the dimensions of some of the data structures in the model. Note: these dimensions are simply maximum sizes, rather than the actual sizes that will be used in your simulations. This is used for certain memory allocation requirements. Therefore, the optimal values of these parameters should be equal to or slightly larger than the numbers that you think you will need.

    Name

    Type

    Description

    MAX_VEG

    int

    Maximum number of vegetation tiles that can be defined within a grid cell (a good rule of thumb is to set this to the number of vegetation classes in your vegetation library file).

    MAX_LAYERS

    int

    Maximum number of soil layers that can be defined within a grid cell.

    MAX_NODES

    int

    Maximum number of soil thermal nodes that can be defined within a grid cell.

    MAX_BANDS

    int

    Maximum number of snow elevation bands that can be defined within a grid cell.

    MAX_FRONTS

    int

    Maximum number of soil freeze/thaw fronts that can be defined within a grid cell.

    MAX_LAKE_NODES

    int

    Maximum number of lake solution nodes that can be defined within a grid cell.

    Example user_def.h File

    /**********************************************************************
      This header file contains model parameters that can be modified by
      the user to control model performance.  When this file is modified 
      the model needs to be recompiled for the changes to take effect.
    **********************************************************************/
    
    /***** If TRUE include frozen soil algorithm in compiled code *****/
    #define FROZEN TRUE
    
    /***** If TRUE include all model messages to stdout, and stderr *****/
    #define VERBOSE TRUE
    
    /***** If TRUE limit output data to runoff and baseflow for optimization *****/
    #define OPTIMIZE FALSE
    
    /***** If TRUE include all debugging code - debugging options still
           have to be activated to get extra output.  When set to FALSE
           all debugging if-then statements are removed from the compiled 
           code *****/
    #define LINK_DEBUG TRUE
    
    /***** If TRUE output will be in LDAS binary format, which is a single
           file with limited variables, most of which are truncated to
           conserve disk space *****/
    #define LDAS_OUTPUT FALSE
    
    /***** If TRUE VIC uses a system of linear equations defined in global.h
           to estimate the maximum unfrozen water content equation.  This 
           significantly reduces the run time with frozen soil, but may
           introduce new errors (STILL UNDER TESTING) *****/
    #define QUICK_FS FALSE
    #define QUICK_FS_TEMPS 7
    
    /***** If TRUE VIC uses the linear interpolation of the logarithm of the
           matric potential from the two surrounding layers to estimate the
           soil moisture drainage from each layer (Boone and Wetzel, 1996).
           This should improve the soil moisture drainage predicted by the
           low resolution solution computed by VIC. *****/
    #define LOW_RES_MOIST FALSE
    
    /***** If TRUE VIC code to save the model state is included in the
           compiled code.  If STATEYEAR, STATEMONTH and STATEDAY are
           defined in the global control file the model state will
           be written to a file. *****/
    #define SAVE_STATE FALSE
    
    /***** If TRUE VIC does not rewind the vegetation, state, and snow
           band files before read data for each cell.  This saves time
           but requires that all grid cells are listed in the same
           order as the soil parameter file *****/
    #define NO_REWIND TRUE
    
    /***** If TRUE VIC reads the model forcing files, and creates the full
           internal forcing dataset (longwave, shortwave, humidity, etc.)
           which is then written to a series of gridded output files for
           later use.  Gridded forcing files are written to the RESULTS
           directory defined in the global control file, and are binary
           or ASCII based on the BINARY_OUTPUT flag. *****/
    #define OUTPUT_FORCE FALSE
    
    /***** Define maximum array sizes for model source code *****/
    #define MAX_VEG      8          /* maximum number of vegetation types per 
    				   cell */
    #define MAX_LAYERS   3          /* maximum number of soil moisture layers */
    #define MAX_NODES    18         /* maximum number of soil thermal nodes */
    #define MAX_BANDS    2          /* maximum number of snow bands */
    #define MAX_FRONTS   3          /* maximum number of freezing and thawing 
    				   front depths to store */
    
    /***** Number of iterations to use in solving the surface energy balance.
           The original VIC model uses only 1 iteration for speed.  Increasing
           the number of iterations improves precision, and is recommended
           for single point comparisons with frozen soils *****/
    #define MAXIT_FE        25
     
    /***** Coefficient multiplied by the LAI to determine the amount of
           water that can be stored in the canopy *****/
    #define LAI_WATER_FACTOR 0.2
    
    
    /***** Offset of shortwave measurement from model hour, used for 
           computation of longwave radiation from hourly shortwave
           measurements *****/
    #define SOLARTIMEOFFSET	0.0
    
    /***** Longwave correction factor, used to correct estimated incoming
           longwave radiation (use 1, unless measured longwave available for
           calibration) *****/
    #define LWAVE_COR	1.
    
    /***** Snow albedo curve parameters.  Defaults are from Bras p263.
           Should not be changed except for serious problems with snow melt *****/
    #define NEW_SNOW_ALB		0.85		
    #define SNOW_ALB_ACCUM_A	0.94	
    #define SNOW_ALB_ACCUM_B	0.58	
    #define SNOW_ALB_THAW_A		0.82		
    #define SNOW_ALB_THAW_B		0.46	
    
    

    VIC Administrator
    Last modified: Wed Aug 19 12:28:55 PDT 2009