Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OUTPUT_FORCE Updates #206

Merged
merged 3 commits into from
Jan 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/classic/include/vic_driver_classic.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int set_output_var(out_data_file_struct *, int, int, out_data_struct *, char *,
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 *,
out_data_struct *);
out_data_struct *, dmy_struct *);
void write_header(out_data_file_struct *, out_data_struct *, dmy_struct *,
global_param_struct);
void write_model_state(all_vars_struct *, int, int, filep_struct *,
Expand Down
79 changes: 40 additions & 39 deletions drivers/classic/src/get_global_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,46 +1033,47 @@ get_global_param(FILE *gp)
}

// Validate runoff time step
if (global_param.runoff_steps_per_day == 0) {
log_err("Runoff time steps per day has not been defined. Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY.");
}
else if (global_param.runoff_steps_per_day <
MIN_SUBDAILY_STEPS_PER_DAY) {
log_err("The specified number of runoff steps per day (%zu) < "
"the minimum number of subdaily steps per day (%d). Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY of at "
"least (%d).", global_param.runoff_steps_per_day,
MIN_SUBDAILY_STEPS_PER_DAY,
MIN_SUBDAILY_STEPS_PER_DAY);
}
else if (global_param.runoff_steps_per_day > HOURS_PER_DAY &&
global_param.runoff_steps_per_day % HOURS_PER_DAY != 0) {
log_err("The specified number of runoff steps per day (%zu) is > "
"24 and is not evenly divided by 24.",
global_param.runoff_steps_per_day);
}
else if (global_param.runoff_steps_per_day >
MAX_SUBDAILY_STEPS_PER_DAY) {
log_err("The specified number of runoff steps per day (%zu) > the "
"the maximum number of subdaily steps per day (%d). Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY of at "
"most (%d).", global_param.runoff_steps_per_day,
MAX_SUBDAILY_STEPS_PER_DAY,
MAX_SUBDAILY_STEPS_PER_DAY);
}
else if (global_param.runoff_steps_per_day %
global_param.model_steps_per_day != 0) {
log_err("The specified number of runoff timesteps (%zu) must be "
"evenly divisible by the number of model timesteps per day "
"(%zu)", global_param.runoff_steps_per_day,
global_param.model_steps_per_day);
}
else {
global_param.runoff_dt = SEC_PER_DAY /
(double) global_param.runoff_steps_per_day;
if (!options.OUTPUT_FORCE) {
if (global_param.runoff_steps_per_day == 0) {
log_err("Runoff time steps per day has not been defined. Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY.");
}
else if (global_param.runoff_steps_per_day <
MIN_SUBDAILY_STEPS_PER_DAY) {
log_err("The specified number of runoff steps per day (%zu) < "
"the minimum number of subdaily steps per day (%d). Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY of at "
"least (%d).", global_param.runoff_steps_per_day,
MIN_SUBDAILY_STEPS_PER_DAY,
MIN_SUBDAILY_STEPS_PER_DAY);
}
else if (global_param.runoff_steps_per_day > HOURS_PER_DAY &&
global_param.runoff_steps_per_day % HOURS_PER_DAY != 0) {
log_err("The specified number of runoff steps per day (%zu) is > "
"24 and is not evenly divided by 24.",
global_param.runoff_steps_per_day);
}
else if (global_param.runoff_steps_per_day >
MAX_SUBDAILY_STEPS_PER_DAY) {
log_err("The specified number of runoff steps per day (%zu) > the "
"the maximum number of subdaily steps per day (%d). Make "
"sure that the global file defines RUNOFF_STEPS_PER_DAY of at "
"most (%d).", global_param.runoff_steps_per_day,
MAX_SUBDAILY_STEPS_PER_DAY,
MAX_SUBDAILY_STEPS_PER_DAY);
}
else if (global_param.runoff_steps_per_day %
global_param.model_steps_per_day != 0) {
log_err("The specified number of runoff timesteps (%zu) must be "
"evenly divisible by the number of model timesteps per day "
"(%zu)", global_param.runoff_steps_per_day,
global_param.model_steps_per_day);
}
else {
global_param.runoff_dt = SEC_PER_DAY /
(double) global_param.runoff_steps_per_day;
}
}

// Validate atmos time step
if (global_param.atmos_steps_per_day == 0) {
// For classic driver default to hourly atmos timestep
Expand Down
Loading