Skip to content
Open
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
20 changes: 20 additions & 0 deletions src/bmi/ControlFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ ueb::ControlFile::~ControlFile() {
}

void ueb::ControlFile::loadControlFile(std::string const& contrl_file) {
_conFilename = contrl_file;

std::stringstream std_ss("");

std_ss << "Control File is " << contrl_file << std::endl;
Expand Down Expand Up @@ -310,6 +312,24 @@ int ueb::ControlFile::getStepsInADay() const {
return nstepinaDay;
}

void ueb::ControlFile::overrideModelTiming(
int startYear, int startMonth, int startDay, double startHour,
int endYear, int endMonth, int endDay, double endHour,
double dt_hours
) {
if (dt_hours <= 0.0) {
throw std::invalid_argument("UEB ControlFile overrideModelTiming received non-positive dt_hours");
}

_ModelStartDate = {startYear, startMonth, startDay};
_ModelStartHour = startHour;

_ModelEndDate = {endYear, endMonth, endDay};
_ModelEndHour = endHour;

_ModelDt = dt_hours;
}

std::ostream& operator<<(std::ostream& os, ueb::ControlFile f) { // operator<<
os << "Control file: " << f._conFilename << std::endl;
os << "Parameter file: " << f._paramFilename << std::endl;
Expand Down
3 changes: 3 additions & 0 deletions src/bmi/ControlFile.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class ControlFile {

int getStepsInADay() const;

void overrideModelTiming(int startYear, int startMonth, int startDay, double startHour,
int endYear, int endMonth, int endDay, double endHour,
double dt_hours);
friend std::ostream& ::operator<<(std::ostream& os, ControlFile f);
};

Expand Down
Loading