Skip to content

Commit be5278b

Browse files
committed
EAMxx: fix wrong check in driver restart_model fcn
1 parent b7588ce commit be5278b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

components/eamxx/src/control/atmosphere_driver.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ void AtmosphereDriver::create_fields()
605605
m_field_mgr->add_field(f);
606606
}
607607

608-
// Now go through the input fields/groups to the atm proc group, as well as
609-
// the internal fields/groups, and mark them as part of the RESTART group.
608+
// Now go through the input fields/groups to the atm proc group,
609+
// and mark them as part of the RESTART group.
610610
for (const auto& f : m_atm_process_group->get_fields_in()) {
611611
const auto& fid = f.get_header().get_identifier();
612612
m_field_mgr->add_to_group(fid, "RESTART");
@@ -620,6 +620,8 @@ void AtmosphereDriver::create_fields()
620620
}
621621
}
622622
}
623+
// Internal fields have their group names set by the processes that create them.
624+
// Hence, simply add them to all the groups they are marked as part of
623625
for (const auto& f : m_atm_process_group->get_internal_fields()) {
624626
const auto& ftrack = f.get_header().get_tracking();
625627
const auto& fid = f.get_header().get_identifier();
@@ -950,12 +952,13 @@ void AtmosphereDriver::restart_model ()
950952
std::vector<Field> fields;
951953
for (const auto& fn : restart_fnames) {
952954
// If the field has a parent, and the parent is also in the RESTART group,
953-
// then skip it (restarting the parent will restart the child too)
955+
// then skip it, since restarting the parent will restart the child too
954956
auto f = m_field_mgr->get_field(fn,gn);
955957
auto p = f.get_header().get_parent();
956-
if (p and ekat::contains(restart_fnames,p->get_identifier().name())) {
957-
fields.push_back(m_field_mgr->get_field(fn,gn));
958+
if (p and ekat::contains(p->get_tracking().get_groups_names(),"RESTART")) {
959+
continue;
958960
}
961+
fields.push_back(m_field_mgr->get_field(fn,gn));
959962
}
960963
read_fields_from_file (fields,m_grids_manager->get_grid(gn),filename);
961964
for (auto& f : fields) {

0 commit comments

Comments
 (0)