Skip to content

Commit

Permalink
Merge pull request #7 from tbohn/feature/remove_mtclim
Browse files Browse the repository at this point in the history
Feature/remove mtclim
  • Loading branch information
Joe Hamman committed Sep 26, 2015
2 parents 70e4efd + dda590e commit 47784df
Show file tree
Hide file tree
Showing 38 changed files with 691 additions and 491 deletions.
24 changes: 0 additions & 24 deletions samples/global.param.sample
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,6 @@ FROZEN_SOIL FALSE # TRUE = calculate frozen soils. Default = FALSE.
# # AR_410 = apply stability correction but do NOT multiply by 10 (as in VIC 4.1.0); additionally, always use overstory aero_resist for ET (as in 4.1.0).
# # Default = AR_406_FULL

#######################################################################
# Meteorological Forcing Disaggregation Parameters
# Generally these default values do not need to be overridden
#######################################################################
#OUTPUT_FORCE FALSE # TRUE = perform disaggregation of forcings, skip the simulation, and output the disaggregated forcings.
#PLAPSE TRUE # This controls how VIC computes air pressure when air pressure is not supplied as an input forcing: TRUE = set air pressure to sea level pressure, lapsed to grid cell average elevation; FALSE = set air pressure to constant 95.5 kPa (as in all versions of VIC pre-4.1.1)
#MTCLIM_SWE_CORR TRUE # This controls VIC's estimates of incoming shortwave in the presence of snow; TRUE = adjust incoming shortwave for snow albedo effect; FALSE = do not adjust shortwave; default = TRUE
#VP_ITER VP_ITER_ANNUAL # This controls VIC's iteration between estimates of shortwave and vapor pressure:
# # VP_ITER_NEVER = never iterate; make estimates separately
# # VP_ITER_ALWAYS = always iterate once
# # VP_ITER_ANNUAL = iterate once for arid climates based on annual Precip/PET ratio
# # VP_ITER_CONVERGE = iterate until shortwave and vp stabilize
# # default = VP_ITER_ALWAYS
#VP_INTERP TRUE # This controls sub-daily humidity estimates; TRUE = interpolate daily VP estimates linearly between sunrise of one day to the next; FALSE = hold VP constant for entire day
#LW_TYPE LW_PRATA # This controls the algorithm used to estimate clear-sky longwave radiation:
# # LW_TVA = Tennessee Valley Authority algorithm (1972) (this was traditional VIC algorithm)
# # other options listed in vicNl_def.h
# # default = LW_PRATA
#LW_CLOUD LW_CLOUD_DEARDORFF # This controls the algorithm used to estimate the influence of clouds on total longwave:
# # LW_CLOUD_BRAS = method from Bras textbook (this was the traditional VIC algorithm)
# # LW_CLOUD_DEARDORFF = method of Deardorff (1978)
# # default = LW_CLOUD_DEARDORFF

#######################################################################
# Carbon Cycle Parameters
#######################################################################
Expand Down Expand Up @@ -158,7 +135,6 @@ FORCEHOUR 00 # Hour of first forcing record
GRID_DECIMAL 4 # Number of digits after decimal point in forcing file names
WIND_H 10.0 # height of wind speed measurement (m)
MEASURE_H 2.0 # height of humidity measurement (m)
ALMA_INPUT FALSE # TRUE = ALMA-compliant input variable units; FALSE = standard VIC units

#######################################################################
# Land Surface Files and Parameters
Expand Down
26 changes: 0 additions & 26 deletions samples/vic_parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,6 @@ CANOPY_RSMAX 5000.0 # Maximum allowable resistance (s/m)
CANOPY_VPDMINFACTOR 0.1 # Minimum allowable vapor pressure deficit factor
###############################################################################

###############################################################################
# MTCLIM Parameters
MTCLIM_SOLAR_CONSTANT 1368.0

# parameters for the Tair algorithm
MTCLIM_TDAYCOEF 0.45 # (dim) daylight air temperature coefficient (dim)

# parameters for the snowpack algorithm
MTCLIM_SNOW_TCRIT -6.0 # (deg C) critical temperature for snowmelt
MTCLIM_SNOW_TRATE 0.042 # (cm/degC/day) snowmelt rate

# parameters for the radiation algorithm
MTCLIM_TBASE 0.870 # (dim) max inst. trans., 0m, nadir, dry atm
MTCLIM_ABASE -6.1e-5 # (1/Pa) vapor pressure effect on transmittance
MTCLIM_C 1.5 # (dim) radiation parameter
MTCLIM_B0 0.031 # (dim) radiation parameter
MTCLIM_B1 0.201 # (dim) radiation parameter
MTCLIM_B2 0.185 # (dim) radiation parameter
MTCLIM_RAIN_SCALAR 0.75 # (dim) correction to trans. for rain day
MTCLIM_DIF_ALB 0.6 # (dim) diffuse albedo for horizon correction
MTCLIM_SC_INT 1.32 # (MJ/m2/day) snow correction intercept
MTCLIM_SC_SLOPE 0.096 # (MJ/m2/day/cm) snow correction slope
MTCLIM_SRADDT 30.0 # timestep for radiation routine (seconds)
# Note: Make sure that 3600 % SRADDT == 0
###############################################################################

###############################################################################
# Lake Model Parameters

Expand Down
1 change: 0 additions & 1 deletion tests/examples/global_param.STEHE.3hewb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
SOIL $test_data_dir/Stehekin/parameters/soil_param.STEHE
BASEFLOW ARNO
JULY_TAVG_SUPPLIED FALSE
Expand Down
1 change: 0 additions & 1 deletion tests/examples/global_param.STEHE.init_state.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
FORCE_FORMAT BINARY
FORCE_ENDIAN LITTLE
SOIL $test_data_dir/Stehekin/parameters/soil_param.STEHE
Expand Down
1 change: 0 additions & 1 deletion tests/examples/global_param.STEHE.save_state.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
FORCE_FORMAT BINARY
FORCE_ENDIAN LITTLE
SOIL $test_data_dir/Stehekin/parameters/soil_param.STEHE
Expand Down
1 change: 0 additions & 1 deletion tests/examples/global_param.STEHE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
FORCE_FORMAT BINARY
FORCE_ENDIAN LITTLE
SOIL $test_data_dir/Stehekin/parameters/soil_param.STEHE
Expand Down
1 change: 0 additions & 1 deletion tests/examples/global_param.STEHE.wb_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
FORCE_FORMAT BINARY
FORCE_ENDIAN LITTLE
SOIL $test_data_dir/Stehekin/parameters/soil_param.STEHE
Expand Down
1 change: 0 additions & 1 deletion tests/release/global_0.5deg-eb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
SOIL {test_data_dir}/global_0.5deg/parameters/soil_param.txt
ARC_SOIL FALSE
BASEFLOW ARNO
Expand Down
1 change: 0 additions & 1 deletion tests/release/global_0.5deg-wb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE
SOIL {test_data_dir}/global_0.5deg/parameters/soil_param.txt
ARC_SOIL FALSE
BASEFLOW ARNO
Expand Down
3 changes: 1 addition & 2 deletions vic/drivers/classic/include/vic_driver_classic.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ out_data_file_struct *set_output_defaults(out_data_struct *);
int set_output_var(out_data_file_struct *, int, int, out_data_struct *, char *,
int, char *, int, double);
void vic_force(atmos_data_struct *, dmy_struct *, FILE **, veg_lib_struct *,
veg_con_struct *, veg_hist_struct **, soil_con_struct *,
out_data_file_struct *, out_data_struct *);
veg_con_struct *, veg_hist_struct **, soil_con_struct *);
void write_data(out_data_file_struct *, out_data_struct *, dmy_struct *,
double);
void write_forcing_file(atmos_data_struct *, int, out_data_file_struct *,
Expand Down
60 changes: 30 additions & 30 deletions vic/drivers/classic/src/alloc_atmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void
alloc_atmos(int nrecs,
atmos_data_struct **atmos)
{
extern option_struct options;
int i;

*atmos = (atmos_data_struct *) calloc(nrecs, sizeof(atmos_data_struct));
Expand All @@ -47,34 +48,14 @@ alloc_atmos(int nrecs,
if ((*atmos)[i].air_temp == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].Catm = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].Catm == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].channel_in = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].channel_in == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].coszen = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].coszen == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].density = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].density == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].fdir = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].fdir == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].longwave = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].longwave == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].par = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].par == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].prec = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].prec == NULL) {
log_err("Memory allocation error in alloc_atmos().");
Expand All @@ -91,10 +72,6 @@ alloc_atmos(int nrecs,
if ((*atmos)[i].snowflag == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].tskc = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].tskc == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].vp = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].vp == NULL) {
log_err("Memory allocation error in alloc_atmos().");
Expand All @@ -107,6 +84,26 @@ alloc_atmos(int nrecs,
if ((*atmos)[i].wind == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
if (options.LAKES) {
(*atmos)[i].channel_in = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].channel_in == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
}
if (options.CARBON) {
(*atmos)[i].Catm = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].Catm == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].fdir = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].fdir == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
(*atmos)[i].par = (double *) calloc(NR + 1, sizeof(double));
if ((*atmos)[i].par == NULL) {
log_err("Memory allocation error in alloc_atmos().");
}
}
}
}

Expand All @@ -117,6 +114,7 @@ void
free_atmos(int nrecs,
atmos_data_struct **atmos)
{
extern option_struct options;
int i;

if (*atmos == NULL) {
Expand All @@ -125,21 +123,23 @@ free_atmos(int nrecs,

for (i = 0; i < nrecs; i++) {
free((*atmos)[i].air_temp);
free((*atmos)[i].Catm);
free((*atmos)[i].channel_in);
free((*atmos)[i].coszen);
free((*atmos)[i].density);
free((*atmos)[i].fdir);
free((*atmos)[i].longwave);
free((*atmos)[i].par);
free((*atmos)[i].prec);
free((*atmos)[i].pressure);
free((*atmos)[i].shortwave);
free((*atmos)[i].snowflag);
free((*atmos)[i].tskc);
free((*atmos)[i].vp);
free((*atmos)[i].vpd);
free((*atmos)[i].wind);
if (options.LAKES) {
free((*atmos)[i].channel_in);
}
if (options.CARBON) {
free((*atmos)[i].Catm);
free((*atmos)[i].fdir);
free((*atmos)[i].par);
}
}

free(*atmos);
Expand Down
6 changes: 0 additions & 6 deletions vic/drivers/classic/src/display_current_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,6 @@ display_current_settings(int mode)
}
}
fprintf(LOG_DEST, "GRID_DECIMAL\t\t%d\n", options.GRID_DECIMAL);
if (options.ALMA_INPUT) {
fprintf(LOG_DEST, "ALMA_INPUT\t\tTRUE\n");
}
else {
fprintf(LOG_DEST, "ALMA_INPUT\t\tFALSE\n");
}

fprintf(LOG_DEST, "\n");
fprintf(LOG_DEST, "Constants File\t\t%s\n", filenames.constants);
Expand Down
74 changes: 13 additions & 61 deletions vic/drivers/classic/src/get_force_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ get_force_type(char *cmdstr,
Get meteorological data forcing info
***************************************/

/* type 0: air temperature [C] (ALMA_INPUT: [K]) */
/* type 0: air temperature [C] */
if (strcasecmp("AIR_TEMP", optstr) == 0) {
type = AIR_TEMP;
}
Expand All @@ -71,101 +71,53 @@ get_force_type(char *cmdstr,
else if (strcasecmp("CATM", optstr) == 0) {
type = CATM;
}
/* type 3: incoming channel flow [m3] (ALMA_INPUT: [m3/s]) */
/* type 3: incoming channel flow [m3] */
else if (strcasecmp("CHANNEL_IN", optstr) == 0) {
type = CHANNEL_IN;
}
/* type 4: convective rainfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("CRAINF", optstr) == 0) {
type = CRAINF;
}
/* type 5: convective snowfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("CSNOWF", optstr) == 0) {
type = CSNOWF;
}
/* type 6: air density [kg/m3] */
else if (strcasecmp("DENSITY", optstr) == 0) {
type = DENSITY;
}
/* type 7: direct fraction of shortwave [fraction] */
/* type 4: direct fraction of shortwave [fraction] */
else if (strcasecmp("FDIR", optstr) == 0) {
type = FDIR;
}
/* type 8: LAI [m2/m2] */
/* type 5: LAI [m2/m2] */
else if (strcasecmp("LAI_IN", optstr) == 0) {
type = LAI_IN;
}
/* type 9: incoming longwave radiation [W/m2] */
/* type 6: incoming longwave radiation [W/m2] */
else if (strcasecmp("LONGWAVE",
optstr) == 0 || strcasecmp("LWDOWN", optstr) == 0) {
type = LONGWAVE;
}
/* type 10: large-scale rainfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("LSRAINF", optstr) == 0) {
type = LSRAINF;
}
/* type 11: large-scale snowfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("LSSNOWF", optstr) == 0) {
type = LSSNOWF;
}
/* type 12: photosynthetically active radiation [uE/m2s] */
/* type 7: photosynthetically active radiation [uE/m2s] */
else if (strcasecmp("PAR", optstr) == 0) {
type = PAR;
}
/* type 13: precipitation [mm] (ALMA_INPUT: [mm/s]) */
/* type 8: precipitation [mm] */
else if (strcasecmp("PREC", optstr) == 0) {
type = PREC;
}
/* type 14: air pressure [kPa] (ALMA_INPUT: [Pa]) */
/* type 9: air pressure [kPa] */
else if (strcasecmp("PRESSURE", optstr) == 0) {
type = PRESSURE;
}
/* type 15: specific humidity [kg/kg] */
/* type 10: specific humidity [kg/kg] */
else if (strcasecmp("QAIR", optstr) == 0) {
type = QAIR;
}
/* type 16: rainfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("RAINF", optstr) == 0) {
type = RAINF;
}
/* type 17: relative humidity [fraction] */
else if (strcasecmp("REL_HUMID", optstr) == 0) {
type = REL_HUMID;
}
/* type 18: shortwave radiation [W/m2] */
/* type 11: rainfall [mm] */
else if (strcasecmp("SHORTWAVE",
optstr) == 0 || strcasecmp("SWDOWN", optstr) == 0) {
type = SHORTWAVE;
}
/* type 19: snowfall [mm] (ALMA_INPUT: [mm/s]) */
else if (strcasecmp("SNOWF", optstr) == 0) {
type = SNOWF;
}
/* type 22: cloud cover fraction */
else if (strcasecmp("TSKC", optstr) == 0) {
type = TSKC;
}
/* type 23: vegetation cover fraction */
/* type 12: vegetation cover fraction */
else if (strcasecmp("VEGCOVER", optstr) == 0) {
type = VEGCOVER;
}
/* type 24: vapor pressure [kPa] (ALMA_INPUT: [Pa]) */
else if (strcasecmp("VP", optstr) == 0) {
type = VP;
}
/* type 25: wind speed [m/s] */
/* type 13: wind speed [m/s] */
else if (strcasecmp("WIND", optstr) == 0) {
type = WIND;
}
/* type 26: zonal component of wind speed [m/s] */
else if (strcasecmp("WIND_E", optstr) == 0) {
type = WIND_E;
}
/* type 27: meridional component of wind speed [m/s] */
else if (strcasecmp("WIND_N", optstr) == 0) {
type = WIND_N;
}
/* type 28: unused (blank) data */
/* type 14: unused (blank) data */
else if (strcasecmp("SKIP", optstr) == 0) {
type = SKIP;
}
Expand Down
Loading

0 comments on commit 47784df

Please sign in to comment.