Skip to content

Commit

Permalink
replace intended interp time with actual interp time
Browse files Browse the repository at this point in the history
  • Loading branch information
mbkuhn committed Oct 21, 2024
1 parent 112ca66 commit 87d545e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions amr-wind/wind_energy/ABLBoundaryPlane.H
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public:

bool is_data_newer_than(const amrex::Real time) const
{
// Will replace with m_in_data.tinterp()
return (m_intended_interp_time - time > 1e-12);
return (m_in_data.tinterp() - time > 1e-12);
}

io_mode mode() const { return m_io_mode; }
Expand Down Expand Up @@ -195,8 +194,6 @@ private:
//! Start outputting after this time
amrex::Real m_out_start_time{0.0};

amrex::Real m_intended_interp_time{0.0};

#ifdef AMR_WIND_USE_NETCDF
//! NetCDF time output counter
size_t m_out_counter{0};
Expand Down
5 changes: 1 addition & 4 deletions amr-wind/wind_energy/ABLBoundaryPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,13 @@ void ABLBoundaryPlane::read_file(const bool nph_target_time)
}

// populate planes and interpolate
const amrex::Real time = m_time.new_time();
const amrex::Real conditional_time =
const amrex::Real time =
m_time.new_time() + (nph_target_time ? 0.5 : 0.0) *
(m_time.current_time() - m_time.new_time());
AMREX_ALWAYS_ASSERT((m_in_times[0] <= time) && (time < m_in_times.back()));

// return early if current data files can still be interpolated in time
if ((m_in_data.tn() <= time) && (time < m_in_data.tnp1())) {
m_intended_interp_time = conditional_time;
m_in_data.interpolate(time);
return;
}
Expand Down Expand Up @@ -871,7 +869,6 @@ void ABLBoundaryPlane::read_file(const bool nph_target_time)
}
}

m_intended_interp_time = conditional_time;
m_in_data.interpolate(time);
}

Expand Down

0 comments on commit 87d545e

Please sign in to comment.