VIC-2L Program Schematic and Subroutine
Descriptions
Standard operation of the VIC-2L is the water balance model. This
model does not compute surface energy fluxes, and relies on an
off-line snow model to provide information about snow accumulation
and melt.
VIC-2L Optional Modes:
- Full Energy Balance
- Distributed Precipitation
- Constant Fractional Area of Precipitation Coverage
- Variable Fractional Area of Precipitation Coverage
- Frozen Soils
VIC-2L Model Flow:
Subroutine Descriptions:
aero_flux_gra:
computes
void aero_flux_gra(int,int,int,global_param_struct,dmy_struct,
atmos_data_struct);
arno_evap: computes evaporation from
bare soil.
void arno_evap(atmos_data_struct *, soil_var_struct
*, soil_con_struct, global_param_struct);
avg_precip:
uses the standard VIC method of applying the average precipitation
over the entire grid cell. Use of this subroutine produces results
comparable to the original unmodified VIC-2L water balance model.
void avg_precip(int,atmos_data_struct *,soil_con_struct,soil_var_struct
*, veg_con_struct *,veg_var_struct *,snow_data_struct *, frozen_soil_struct
*,dmy_struct,global_param_struct,double *);
calc_netshort: computes the net shortwave
radiation for each time step.
double calc_netshort(double, int, double);
calc_trans: computes the transmissivity
of the atmosphere for each time step.
double calc_trans(double, double);
canopy_evap:
computes evapotranspiration and dew collection from the canopy,
and evaporation from the soil layers.
void canopy_evap(atmos_data_struct *, soil_var_struct
*, veg_var_struct *, soil_con_struct, veg_con_struct *, int, global_param_struct);
check_files:
verifies that the files specified on the command line exist.
void check_files(infiles_struct *, filenames_struct)
close_files:
closes the gridded input and output files opened in make_in_and_outfiles.
void close_files(infiles_struct, outfiles_struct);
cmd_proc: breaks
the command line up into individual arguments.
filenames_struct cmd_proc(int argc, char *argv[]);
dist_precip:
[DIST PRCP] uses Xu Liang's statistical method for distributed
precipitation.
Fractional Area of Grid Cell that
Receives Precipitation (mu)
- for ( each vegetation type )
- redistribute soil moisture for new storm
- if ( precipitating )
- compute exponentially distributed precipitation
- canopy_evap for region that receives
less precipitation
- canopy_evap for region that receives
more precipitation
- else
- runoff for wet region
- redistribute soil moisture on bare soil for new storm
- arno_evap for bare soil which receives
precipitation
- runoff for bare soil which receives
precipitation
Fractional Area of Grid Cell that
Receives No Precipitation (1-mu)
- for ( each vegetation type )
- arno_evap for bare soil receiving
no precipitation
- runoff for bare soil receiving no precipitation
- combine evaporation and runoff for wet and dry regions
- put_data
void dist_precip(int,atmos_data_struct *,soil_con_struct,soil_var_struct
*, veg_con_struct *,veg_var_struct *,dmy_struct, global_param_struct,dist_prcp_struct
*,double *,double);
evap_coef_gra: computes
evap_coef_gra(int,dmy_struct,global_param_struct,atmos_data_struct
*, veg_con_struct *,veg_var_struct *,snow_data_struct);
evap_coef_gra_Ts: computes
evap_coef_gra_Ts(int, veg_con_struct *, atmos_data_struct
*);
fltrad: computes the flat surface radiation
(incoming and net shortwave) using sun-earth geometry, and tranmissivity.
double fltrad(double, double, double, int, double);
flux_Tsur_fun:
computes
void flux_Tsur_fun(double, double *, double *, int,
int,double, int);
flux_rtsafe: computes
double flux_rtsafe(double, double, int, int,double,
int);
full_energy: solves the VIC model by
computing the full energy balance.
- evap_coef_pilp_gra
- snow_met
- if ( snow AND ( currently snowing OR
still snow present ) )
- compute snow albedo
- compute 2 m wind
- compute lresist
- met_inline
- melt_brent
- convert snow units ( to mm/hr and W/m2)
- cover vegetation with snow
- compute energy balance with snow
- check for presence of snow
- for ( each vegetation type )
- convert runoff
- for ( each vegetation type )
- else
- [second try]?? ( looks like avg_precip)
- for ( each vegetation type )
- for ( bare soil )
- convert units
- aero_flux_pilp_gra
get_global_param:
reads global parameters from the global parameter file.
global_param_struct get_global_param(FILE *);
initialize_dist_prcp:
[DIST PRCP] gives initial values to the distributed precipitation
variable array.
void initialize_dist_prcp(dist_prcp_struct *,soil_con_struct,veg_con_struct
*, global_param_struct);
initialize_soil:
gives initial values to the soil variable array.
void initialize_soil(soil_var_struct *, soil_con_struct,
int);
initialize_veg:
gives initial values to the vegetation variable array.
void initialize_veg( veg_var_struct *, veg_con_struct
*, global_param_struct);
in_shortwave: computes the incoming
shortwave radiation.
double in_shortwave(float, int, double);
make_dmy: creates
a structure which stores the day, month and year of the current
time step.
dmy_struct *make_dmy(global_param_struct);
make_frozen_soil:
[FROZEN] creates an array of frozen soil variables for each vegetation
type. This array is modified each time step, so it is used to
record values from the previous time step.
frozen_soil_struct *make_frozen_soil(int);
make_in_and_outfiles:
creates file names for girdded input and output files which depend
on the latitude and longitude of the current grid cell.
void make_in_and_outfiles(infiles_struct *, filenames_struct,
soil_con_struct, outfiles_struct *);
make_out_data:
creates an array of output variables for each vegetation type.
This array is modified each time step, so it is used to record
values from the previous time step.
out_data_struct *make_out_data(int);
make_snow_data:
[FULL][FROZEN] creates an array of snow variables for each vegetation
type. This array is modified each time step, so it is used to
record values from the previous time step.
snow_data_struct *make_snow_data(int);
make_soil_var:
creates an array of soil variables (moisture) for each vegetation
type. This array is modified each time step, so it is used to
record values from the previous time step.
soil_var_struct *make_soil_var(int);
make_veg_var:
creates an array of vegetation variables (evaporation, dew) for
each vegetation type. This array is modified each time step, so
it is used to record values from the previous time step.
veg_var_struct *make_veg_var(int);
melt_brent: computes
snow melt, and pack characteristics.
double melt_brent(double, atmos_data_struct *, snow_data_struct
*);
met_inline: computes psychometric constant,
atmospheric vapor pressure, and atmospheric density for use with
the snow melt model.
void met_inline(atmos_data_struct *);
net_out_longwave: computes net longwave
radiation for each time step.
double net_out_longwave(double,double,double,double);
open_file: opens
input and output files.
FILE *open_file(char string[], char type[]);
penman:
computes daily evapotranspiration using the combination equation.
double penman(double, double, double, double, double,
double, double, double, float);
priestly: computes
evaporation using the priestly method.
double priestley(double, double);
put_data: converts units on output
variables, and writes them to gridded output files.
void put_data(out_data_struct *, soil_var_struct *,
veg_var_struct *, veg_con_struct *);
rad_and_vpd:
computes radiation and atmospheric vapor content.
void rad_and_vpd(atmos_data_struct *, soil_con_struct,
int, dmy_struct *);
read_atmosdata:
reads atmospheric data for all time steps within a grid cell
atmos_data_struct *read_atmosdata(FILE *, FILE *, int
*);
read_dist_prcp:
[DIST PRCP] creates an array of distributed precipitation variables
for each vegetation type. This array is modified each time step,
so it is used to record values from the previous time step.
dist_prcp_struct read_dist_prcp(int);
read_mu_prcp:
[DIST PRCP] reads radar generated precipitation and variable values
for the fractional area of precipitation coverage (mu).
double *read_mu_prec(int,atmos_data_struct*,FILE*);
read_soilparam:
reads soil parameters for a grid cell.
soil_con_struct read_soilparam(FILE *);
read_vegparam:
reads vegetation parameters for all vegetation types within a
grid cell.
veg_con_struct *read_vegparam(FILE *, int);
runoff: computes
runoff from the current grid cell.
void runoff(soil_var_struct *, soil_con_struct, double,
double, double);
shrad: computes
the surface radiation (incoming and net shortwave) using sun-earth
geometry, tranmissivity, and surface characteristics.
double shrad(double, double, double, double, double,
int, double);
snow_met: computes snow pack albedo
based on coldcontent, and days since last snow fall.
void snow_met(atmos_data_struct *,snow_data_struct
*);
snow_table_albedo:
creates a table of snow albedo values based on age of snow pack.
void snow_table_albedo();
svp:.
double svp(double);
svp_slope:.
double svp_slope(double);
write_data:
writes output data to gridded files. Output data for the water
balance model includes: evaporation, moisture for the upper and
lower layers, runoff, and baseflow.