Skip to content

Commit 57dfd8d

Browse files
committed
Fix surface coupling use of TimeInterpolation
1 parent ce57a44 commit 57dfd8d

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

components/eamxx/src/control/atmosphere_surface_coupling_exporter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void SurfaceCouplingExporter::initialize_impl (const RunType /* run_type */)
232232
bool do_export_from_file = are_fields_present and are_files_present;
233233
if (do_export_from_file) {
234234
// Construct a time interpolation object
235-
m_time_interp = util::TimeInterpolation(m_grid,export_from_file_names);
235+
auto time_interp = util::TimeInterpolation(m_grid,export_from_file_names);
236236
for (auto fname : export_from_file_fields) {
237237
// Find the index for this field in the list of export fields.
238238
auto v_loc = std::find(m_export_field_names_vector.begin(),m_export_field_names_vector.end(),fname);
@@ -244,9 +244,10 @@ void SurfaceCouplingExporter::initialize_impl (const RunType /* run_type */)
244244
--m_num_from_model_exports;
245245
auto& f_helper = m_helper_fields.at(fname);
246246
// We want to add the field as a deep copy so that the helper_fields are automatically updated.
247-
m_time_interp.add_field(f_helper, true);
247+
time_interp.add_field(f_helper, true);
248248
m_export_from_file_field_names.push_back(fname);
249249
}
250+
m_time_interp = time_interp;
250251
m_time_interp.initialize_data_from_files();
251252
}
252253
}
@@ -544,7 +545,7 @@ void SurfaceCouplingExporter::do_export_to_cpl(const bool called_during_initiali
544545
// =========================================================================================
545546
void SurfaceCouplingExporter::finalize_impl()
546547
{
547-
548+
// Nothing to do
548549
}
549550
// =========================================================================================
550551
} // namespace scream

components/eamxx/src/share/util/eamxx_time_interpolation.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ TimeInterpolation::TimeInterpolation(
2727
m_is_data_from_file = true;
2828
}
2929
/*-----------------------------------------------------------------------------------------------*/
30-
// Destructor
31-
TimeInterpolation::
32-
~TimeInterpolation ()
33-
{
34-
finalize();
35-
}
36-
/*-----------------------------------------------------------------------------------------------*/
3730
void TimeInterpolation::finalize()
3831
{
3932
if (m_is_data_from_file) {

components/eamxx/src/share/util/eamxx_time_interpolation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TimeInterpolation {
2323
TimeInterpolation() = default;
2424
TimeInterpolation(const grid_ptr_type& grid);
2525
TimeInterpolation(const grid_ptr_type& grid, const vos_type& list_of_files);
26-
~TimeInterpolation ();
26+
~TimeInterpolation () = default;
2727

2828
// Running the interpolation
2929
void initialize_timestamps(const TimeStamp& ts_in);

0 commit comments

Comments
 (0)