Skip to content

Commit

Permalink
Fix bug overwriting State and Tracer device arrays in OceanInit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-oneill committed Dec 10, 2024
1 parent 86d95e7 commit e5c13e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/omega/src/ocn/OceanInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,20 +202,20 @@ int initOmegaModules(MPI_Comm Comm) {
}
}

// Update Halos and Device arrays with new state and tracer fields
// Update Halos and Host arrays with new state and tracer fields

OceanState *DefState = OceanState::getDefault();
I4 CurTimeLevel = 0;
DefState->exchangeHalo(CurTimeLevel);
DefState->copyToDevice(CurTimeLevel);
DefState->copyToHost(CurTimeLevel);

// Now update tracers - assume using same time level index
Err = Tracers::exchangeHalo(CurTimeLevel);
if (Err != 0) {
LOG_CRITICAL("Error updating tracer halo after restart");
return Err;
}
Err = Tracers::copyToDevice(CurTimeLevel);
Err = Tracers::copyToHost(CurTimeLevel);
if (Err != 0) {
LOG_CRITICAL("Error updating tracer device arrays after restart");
return Err;
Expand Down

0 comments on commit e5c13e1

Please sign in to comment.