@@ -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