Back Goto VIC Operations Page Goto VIC Model Home Page Next

Preprocessor Options

With the release of VIC version 4.0, a number of preprocessor options have been added to the user_def.h header file. These options allow the compiled source code to be optimized for specific uses. Before running the model for the first time, and before changing the model options, the user should verify that the desired options have not been turned off in user_def.h and have therefore not been compiled into the executable file.

Preprocessor Options:

VERBOSEIf TRUE VIC model outputs all information to stdout. When set to false only errors and warning messages sent to stderr are output. Use this to reduce the time and disk space (if recorded in the background) used by the model for descriptive I/O.
OPTIMIZEIf TRUE then output is reduced to daily runoff and baseflow in a single file. This mode is used in conjunction with the optimization programs to find optimal parameter value for the VIC model.
LINK_DEBUGIf TRUE then all debugging code is included in the compiled source code. Use this option only if you are making changes to the model source code.
LDAS_OUTPUTIf TRUE then model output is in Binary LDAS format, which packs data into a single file using short int values to save space.
QUICK_FS
QUICK_FS_TEMPS <NUM>
If TRUE then the frozen soil algorithm uses a set of NUM linear equations to simplify the equation for maximum unfrozen water content in the soil.
LOW_RES_MOISTIf 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.
SAVE_STATEIf TRUE VIC is compiled to include code which monitors the simulation date and creates a model state file at hour 0 of the date defined in the global control file.
NO_REWINDIf 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
OUTPUT_FORCEIf TRUE VIC reads the model forcing files, and creates the full internal forcing dataset 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. Output fields are: Precipitation (mm), Air Temperature (C), Incoming Shortwave (W/m2), Incoming Longwave (W/m2), Atmospheric Density (kg/m3), Atmospheric Pressure (kPa), Vapor Pressure (kPa), Wind Speed (m/s)
MAX_VEG <NUM>NUM is the maximum number of vegetation types the compiled model can handle.
MAX_LAYERS <NUM>NUM is the maximum number of soil moisture layers the compiled model can handle. This must be at least two for water balance simulations, and 3 for energy balance simulations.
MAX_NODES <NUM>NUM is the maximum number of soil thermal nodes (for the finite difference heat flux solution) the compiled model can handle. This value must be at least 3 to solve the energy balance.
MAX_BANDS <NUM>NUM is the maximum number of snow elevation bands the compiled model can handle.
MAX_FRONT <NUM>NUM is the maximum number of freezing and thawing fronts the compiled model can record.

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		

Back Goto VIC Operations Page Goto VIC Model Home Page Next

Goto Hydrologic Models Page Goto CE Home Page Goto CE Home Page Goto UW Home Page

VIC Administrator
Last modified: Mon Oct 15 09:47:04 PDT 2001