Skip to content

Commit

Permalink
Rename Time::mod() to modulo() to make it easier to find all the uses
Browse files Browse the repository at this point in the history
  • Loading branch information
ckhroulev committed Aug 30, 2021
1 parent a099555 commit 13a26b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/coupler/util/ScalarForcing.cc
Expand Up @@ -93,7 +93,7 @@ double ScalarForcing::value() const {
}

double ScalarForcing::value(double t) const {
t = m_ctx->time()->mod(t - m_reference_time, m_period);
t = m_ctx->time()->modulo(t - m_reference_time, m_period);

return (*m_data)(t);
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/Time.cc
Expand Up @@ -787,7 +787,7 @@ void Time::init_from_file(MPI_Comm com,
}
}

double Time::mod(double time, unsigned int period_years) const {
double Time::modulo(double time, unsigned int period_years) const {

if (m_simple_calendar) {
if (period_years == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/Time.hh
Expand Up @@ -99,7 +99,7 @@ public:
virtual std::string units_string() const;

//! \brief Returns time since the origin modulo period.
virtual double mod(double time, unsigned int period_years) const;
virtual double modulo(double time, unsigned int period_years) const;

//! \brief Returns the fraction of a year passed since the last beginning of
//! a year. Only useful in codes with a "yearly cycle" (such as the PDD model).
Expand Down
2 changes: 1 addition & 1 deletion src/util/iceModelVec2T.cc
Expand Up @@ -603,7 +603,7 @@ void IceModelVec2T::init_interpolation(const std::vector<double> &ts) {
std::vector<double> times_requested(ts.size());
if (m_data->period != 0) {
for (unsigned int k = 0; k < ts.size(); ++k) {
times_requested[k] = time->mod(ts[k] - m_data->reference_time, m_data->period);
times_requested[k] = time->modulo(ts[k] - m_data->reference_time, m_data->period);
}
} else {
times_requested = ts;
Expand Down

0 comments on commit 13a26b6

Please sign in to comment.