Skip to content

Commit

Permalink
Fix unit test creation of FM, add check in AtmosphereInput that FM GM…
Browse files Browse the repository at this point in the history
… is size 1
  • Loading branch information
tcclevenger committed Feb 13, 2025
1 parent 5c2c1dd commit 952e6bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/eamxx/src/dynamics/homme/tests/dyn_grid_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ TEST_CASE("dyn_grid_io")
in_params.set<std::vector<std::string>>("Field Names",fnames);

auto fm_phys = std::make_shared<FieldManager>(phys_grid);
for (auto& f_it : fm_phys->get_repo(phys_grid->name())) {
for (auto& f_it : fm->get_repo(phys_grid->name())) {
fm_phys->add_field(*f_it.second);
}
AtmosphereInput input (in_params,fm_phys);
Expand Down
2 changes: 2 additions & 0 deletions components/eamxx/src/share/io/scorpio_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void AtmosphereInput::
init (const ekat::ParameterList& params,
const std::shared_ptr<const fm_type>& field_mgr)
{
EKAT_REQUIRE_MSG (field_mgr->get_grids_manager()->size()==1,
"Error! AtmosphereInput expects FieldManager defined only on a single grid.\n");
EKAT_REQUIRE_MSG (not m_inited_with_views,
"Error! Input class was already inited (with user-provided views).\n");
EKAT_REQUIRE_MSG (not m_inited_with_fields,
Expand Down

0 comments on commit 952e6bf

Please sign in to comment.