All input files, and variables described below are
for the VIC-2L water balance model as modified by Dag Lohman.
This version of the VIC model uses snow melt and temperature
variables computed off-line, and stored in a separate file
Global Parameters:
Global parameters are read from a single line input
file in the format shown below. Values are stored in struct global_param_struct.
| model_type | Type of VIC model to run | ||
| resolution | Grid resolution | ||
| startyear | Year to start simulation | ||
| startmonth | Month to start model | ||
| startday | Day to start model | ||
| wind_h | Height of wind measurements | ||
| measure_h | Height of measurements |
Soil Parameters:
Soil parameters are read from the soil parameter data file using
the formats shown below. All values are read into struct soil_con_struct.
| flag | flag (1=run model) | ||
| gridcell | grid cell number | ||
| lat | latitude of cell | ||
| lng | longitude of cell | ||
| b_infilt | infiltration parameter | ||
| max_moist_tot | maximum moisture allowed in layer | ||
| Ds | Subsurface flow rate | ||
| Dsmax | Maximum subsurface flow rate | ||
| Ws | Soil moisture content | ||
| c | c | ||
| maxsoilmoist2factor | Maximum soil moisture of layer 2 | ||
| expt | expt | ||
| Ksat | Saturated Hydrologic Conductivity | ||
| init_top_moist | Initial moisture for top layer | ||
| init_bottom_moist | Initial moisture for bottom layer | ||
| elevation | Elevation |
Vegitation Parameters:
Vegitation parameters are read from an input file in the format
shown below. Each grid cell can contain multiple types of vegetation,
so each line of the input file contains information about all
vegetation types within a grid cell. Data is stored in struct
veg_con_struct.
| vegcel | Grid cell number of current record | ||
| vegtat_type_num | Number of vegetation types in grid cell | ||
| Individual vegetation type records |
Individual vegetation type records:
| veg_class | Class number of vegetation | ||
| Cv | Specific heat of vegetation type | ||
| rarc | Architectual Resistance | ||
| rs | Minimum Stomatal Resistance | ||
| root1 | Percent of roots in layer 1 | ||
| root2 | Percent of roots in layer 2 | ||
| LAI[] | Monthly Leaf Area Index | ||
| rough | roughness of vegetation | ||
| displacement | displacement |
Atmospheric Variables:
Atmospheric variables are read from two files, the first contains
atmospheric or weather data, the second contains information on
the snow pack. Snow pack data is determined outside of the VIC
model using SnowTherm. All variables are read in as strings and
converted to the types listed below. Atmospheric variables are
stored in struct atmos_data_struct.
Variables Read from Atmospheric Data File (n lines in file, 1
per time step):
| melt | Snow melt flux | ||
| prec | Precipitation | ||
| air_temp | Air temperature | ||
| pan_evap | Pan evaporation | ||
| rain_plus_snow | Rain plus Snow input | ||
| Unused | |||
| rainonly | Amount of rain | ||
| Unused | |||
| Unused | |||
| Unused | |||
| albedo | Surface albedo |
Wind is initialized to 8.0.
Variable Read from Snow Data File:
| Column | Variable Type | Variable Name | Description |
| 1 | Unused | ||
| 2 | double | tmax | Maximum Daily Temperature |
| 3 | double | tmin | Minimum Daily Temperature |
The following is a summary of the files and subroutines included
in Dag Lohman's cleaned version of the VIC Two Layer model.
Model Main Subroutines:
| vic2l.c | main | Parameter, Data and Output File Names | None | This program monitors file I/O and runs model. |
| cmd_proc.c | cmd_proc | Command Line Arguments | Filename Struct | Extracts filenames and other info from command line arguments. |
| aurad.c | fltrad | sehortz, swhortz, slat, jday, tranday | Short Wave Raditation | Computes net shortwave radiation using sun-earth geometry, and transmissivity. |
| shrad | asp, dslop, slat, sehorz, swhorz, jday, tranday | Short Wave Radiation | Computes net shortwave radiation as above, but including surface characteristics. | |
| rad_and_vpd.c | rad_and_vpd | Atmos Data Struct, Soil Data Struct, Number of Records | Array of DMY Structs | Calculates daily evaporation, and radiation balance. |
| calc_netshort.c | calc_netshort | Net Short Wave Radiation | Calculates the short wave radiation. | |
| calc_trans.c | calc_trans | Delta T, Elevation | trans | Computes transmissity??? |
| long_shortwave.c | in_shortwave | Latitude, Day, Transmissivity | Incoming Solar Radiation | Computes incoming solar radiation, based on time of year, latitude, and clarity of atmosphere. |
| net_out_longwave | Transmissivity, Trans of Clear Air, Air Temp, Vapor | Net Outgoing Longwave Radiation | Computes outgoing longwave radiation. | |
| twolayer_vic_roff.c | twolayer_vic_roff | Soil Data Struct, PPT | Soil Struct | Computes runoff from grid cell. |
| arno_evap.c | arno_evap | Atmos Data Struct, Soil Data Struct, Global Struct | Soil Struct | Computes evaportation of an area as a percentage based on saturation. |
| canopy_evap.c | canopy_evap | Atmos Data Struct, Soil Data Struct, Veg Data Struct, Global Struct | Soil Struct, Veg Struct | Computes evaporation from canopy using penman equations. |
| priestley.c | priestley | Air Temp, Net Radiation | Potential Evaporation | Computes potential evaporation using Priestley-Taylor. |
| penman.c | penman | Net Radiation, Vapor Pressure Deficit, Aerodynamical Resistance, Minimum Stomatal Resistance, Architectural Resistance | ||
| svp.c | svp | Temp | svp | |
| svp_slope | Temp | svp_slope |
Model Input and Output:
| get_global_param.c | get_global_param | Global Parameter File | Global Struct | Reads in global parameters from global input file. |
| read_soilparam.c | read_soilparam | Soil Parameter File | Soil Struct | Reads soil parameters from soil input file |
| read_vegparam.c | read_vegparam | Vegitation Parameter File, Grid Cell | Vegitation Struct | Reads vegetation parameters from vegetation input file. |
| read_atmosdata.c | read_atmosdata | Atmos Data File, Snow Data File | Atmos Data Struct, Number of Records | Reads atmospheric and snow data from input files. |
| write_vegparam.c | write_vegparam | Vegitation Struct | None | Writes values of vegetation parameters to stdout |
| write_atmosdata.c | write_atmosdata | Atmos Data Struct, Number of Records | None | Writes atmospheric data values to stdout. |
| write_data.c | write_data | Array of Out Data, Outfile Struct, Number of Records | None | Writes output for all time steps in simulation. |
| make_infiles.c | make_infiles | Soil Struct | Input File Pointers, Output File Pointers, Filename Struct | Creates input and output filenames using current grid cell lat and lng. |
| make_outfiles.c | make_outfiles | Input File Pointer Struct | Output File Pointer Struct | Creates and opens output files. |
| check_files.c | check_files | Filename Struct | File Pointer Struct | Opens soil, vegetation, and global parameter files. |
| open_file.c | open_file | Filename, Filetype | File Pointer | Checks and opens File. |
| close_files.c | close_files | Infile Struct, Outfile Struct | None | Closes all files. |
Data Array Controls:
| make_dmy.c | make_dmy | Global Struct | Array of DMY Struct | Creates Day, Month, Year records for each time step. |
| make_veg_var.c | make_veg_var | Number of Vegitation Types | Array of Vegitation Structs | Creates vegetation records for each vegetation type. |
| make_soil_var.c | make_soil_var | Number of Vegitation Types | Array of Soil Structs | Creates soil records for each vegetation type. |
| make_out_data.c | make_out_data | Number of Records | Array of Out Data Structs | Creates out data records for each time step. |
| put_data.c | put_data | Soil Struct, Vegitation Struct, Vegitation Data Struct | Output Struct | Sums contributions from all vegetation types, and computes final grid values for output. |
Initialization Routines:
| initialize_soil.c | initialize_soil | Soil Data Struct, Number of Vegitation Types | Soil Struct | Initializes upper and lower soil layers using initial moisture values. |
| initialize_veg.c | initialize_veg | Vegitation Data Struct, Global Struct | Vegitation Struct | Initializes vegetation with dew levels half maximum. |
All data structures are identified
in the header file vic2l_def.h. The following tables detail the
structures, and the variables they contain.
struct infiles_struct:
| Variable Type | Variable Name | Description |
| FILE * | soilparam | Soil parameters file. |
| FILE * | vegparam | Vegitation parameters file. |
| FILE * | snowout | Snow model output file. |
| FILE * | snowin | Snow model input file. |
| FILE * | globalparam | Global parameters file. |
struct outfiles_struct:
| Variable Type | Variable Name | Description |
| FILE * | moist1 | Moisture content for first layer |
| FILE * | moist2 | Moisture content for second layer |
| FILE * | evap | Evaporation output file. |
| FILE * | runoff | Runoff output file. |
| FILE * | baseflow | Baseflow output file. |
struct filenames_struct:
| Variable Type | Variable Name | Description |
| char * | snowout | Filename for snow model output file. |
| char * | snowin | Filename for snow model input file. |
| char * | global | Filename for global parameter input file. |
| char * | soil | Filename for soil input file. |
| char * | veg | Filename for vegetation input file |
| char * | result_dir | Pathname for result files. |
| char * | moist1 | Filename for first layer output file |
| char * | moist2 | Filename for second layer output file. |
| char * | evap | Filename for evaporation output file. |
| char * | runoff | Filename for runoff output file. |
| char * | baseflow | Filename for baseflow output file. |
struct global_param_struct:
| Variable Type | Variable Name | Description |
| int | model_type | Unused at this time |
| float | resolution | Grid cell resolution in degrees. |
| int | startyear | Year of start of simulation |
| int | startmonth | Month of start of simulation. |
| int | startday | Day of start of simulation |
| int | nrecs | Number of records (or time steps) in simulation. |
| double | wind_h | Height at which wind was measured |
| double | measure_h | Height of surface measurements |
struct soil_con_struct:
| Variable Type | Variable Name | Description |
| int | gridcel | Grid cell number |
| float | lat | Latitude of current grid cell. |
| float | lng | Longitude of current grid cell. |
| double | b_infilt | Infiltration parameter |
| double | max_moist_tot | Maximum total moisture content. |
| double | Ds | Subsurface flow rate |
| double | Dsmax | Maximum subsurface flow rate |
| double | Ws | Soil moisture content |
| double | c | |
| double | maxsoilmoist2factor | Maximum soil moisture content of layer 2 |
| double | expt | Exponent |
| double | Ksat | Saturated hydraulic conductivity |
| double | init_top_moist | Initial moisture content of top layer |
| double | init_bottom_moist | Initial moisture content of bottom layer |
| double | evapfactor | Evaporation factor |
| float | elevation | Elevation of grid cell |
| double | max_moist1 | Maximum moisture content of layer 1 |
| double | max_moist2 | Maximum moisture content of layer 2 |
| double | max_infil | Maximum infiltration rate |
| double | Wcr1 | Critical moisture content of first layer |
| double | Wcr2 | Critical moisture content of second layer |
| double | Wpwp1 | |
| double | Wpwp2 | |
| double | rough | Roughness |
struct veg_con_struct:
| Variable Type | Variable Name | Description |
| int | vegetat_type_num | Number of vegetation types in grid cell |
| int | veg_class | Vegitation class number |
| double | Cv | Specific heat of plant |
| double | Cv_sum | |
| double | rarc | Architectual roughness |
| double | rs | Stomatal roughness |
| double | root1 | Percentage of roots in first layer |
| double | root2 | Percentage of roots in second layer |
| double | LAI[12] | Monthly leaf area index for vegetation type |
| double | rough | Roughness |
| double | displacement | |
| double | Wdmax[12] |
struct atmos_data_struct:
| Variable Type | Variable Name | Description |
| double | melt | Amount of snow melt in grid cell |
| double | prec | Amount of precipitation in grid cell |
| double | air_temp | Current air temperature in grid cell |
| double | pan_evap | Pan evaporation rate in grid cell |
| double | rain_plus_snow | |
| double | rainonly | |
| double | wind | Current wind |
| double | sun_hr | Solar hour, for use in computing incoming solar radiation |
| double | rad | Current radiation |
| double | vpd | Vapor pressure deficit |
| double | pressure | Atmospheric pressure at surface |
| double | rel_humid | Relative humidity |
| double | tmin | Minimum daily temperature |
| double | tmax | Maximum daily temperature |
| double | priest | Evaporation calculated by preistly method |
| double | trans | Atmospheric transmissivity |
| double | shortwave | Incoming shortwave radiation calculated using aurad subroutine (Used for calculation of vpd) |
| double | shortwave2 | Incoming shortwave radiation used for energy balance (more believable than shortwave) |
| double | longwave | Net longwave radiation |
| double | net_short | Net shortwave radiation |
| double | albedo | Surface albedo |
struct dmy_struct:
| Variable Type | Variable Name | Description |
| int | day | Day of current time step |
| int | month | Month of current time step |
| int | year | Year of current time step |
| int | day_in_month | Yearly Julian date (1-365/366) |
struct soil_var_struct:
| Variable Type | Variable Name | Description |
| double | moist1[2] | Moisture layer 1 |
| double | moist2[2] | Moisture layer 2 |
| double | baseflow | Computed baseflow within grid cell |
| double | Q12 | Infiltration from first to second layer |
| double | runoff | Calculated runoff from grid cell |
| double | evap1 | Calculated evaporation from first layer |
| double | evap2 | Calculated evaporation from second layer |
struct veg_var_struct:
| Variable Type | Variable Name | Description |
| double | canopyevap | Calculated canopy evaporation |
| double | Wdew[2] | Calculated amount of dew trapped on plants |
| double | throughfall | Calculated amount of water that falls through vegetation |
struct out_data_struct:
| Variable Type | Variable Name | Description |
| double | evap | Final calculated evaporation |
| double | runoff | Final calculated runoff |
| double | baseflow | Final calculated baseflow |
| double | moist1 | Final calculated moisture content of first layer |
| double | moist2 | Final calculated moisture content of second layer |