Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions components/omega/src/ocn/VertMix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,9 @@ void VertMix::applyVelVertMixImplicit(
OMEGA_SCOPE(MinLayerEdgeBot, VCoord->MinLayerEdgeBot);
OMEGA_SCOPE(MaxLayerEdgeTop, VCoord->MaxLayerEdgeTop);

const Array2DReal &NormalVelEdge = State->NormalVelocity[VelTimeLevel];
const Array2DReal &PseudoThickCell = State->PseudoThickness[ThickTimeLevel];
const Array2DReal &NormalVelEdge = State->getNormalVelocity(VelTimeLevel);
const Array2DReal &PseudoThickCell =
State->getPseudoThickness(ThickTimeLevel);

// Compute velocity vertical mixing
if (LocVelVertMixSetup.Enabled) {
Expand Down Expand Up @@ -546,7 +547,8 @@ void VertMix::applyTracerVertMixImplicit(
OMEGA_SCOPE(MinLayerCell, VCoord->MinLayerCell);
OMEGA_SCOPE(MaxLayerCell, VCoord->MaxLayerCell);

const Array2DReal &PseudoThickCell = State->PseudoThickness[ThickTimeLevel];
const Array2DReal &PseudoThickCell =
State->getPseudoThickness(ThickTimeLevel);

if (LocTracerVertMixSetup.Enabled) {
Pacer::start("Tend:tracerVertMix", 1);
Expand Down
9 changes: 8 additions & 1 deletion components/omega/src/timeStepping/ForwardBackwardStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ void ForwardBackwardStepper::doStep(
CurTracerArray = Tracers::getAll(VelCurLevel);
if (VMix->VelVertMixSetup.Enabled or VMix->TracerVertMixSetup.Enabled) {
VMix->VertMixImplicit(State, AuxState, CurTracerArray, NTracers,
State->CurTimeIndex);
VelCurLevel);

// Re-exchange halos after vertical mixing
Pacer::timingBarrier("ForwardBackward:vMixHaloExchBarrier", 3, Comm);
Pacer::start("ForwardBackward:vMixHaloExch", 3);
State->exchangeHalo(VelCurLevel);
Tracers::exchangeHalo(VelCurLevel);
Pacer::stop("ForwardBackward:vMixHaloExch", 3);
Comment on lines +100 to +105

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively we could move this to the end of VertMix::VertMixImplicit so that each time stepper did not have to manually call the halo exchange.

Seems like the more self contained approach and less error prone for when more time steppers are added in the future.

I'm just not that familiar with VertMix, so not sure if there are downsides I'm not considering.

}

validateOceanState(State, AuxState, VertCoord::getDefault(), 0);
Expand Down
9 changes: 8 additions & 1 deletion components/omega/src/timeStepping/RungeKutta2Stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ void RungeKutta2Stepper::doStep(OceanState *State, // model state
CurTracerArray = Tracers::getAll(CurLevel);
if (VMix->VelVertMixSetup.Enabled or VMix->TracerVertMixSetup.Enabled) {
VMix->VertMixImplicit(State, AuxState, CurTracerArray, NTracers,
State->CurTimeIndex);
CurLevel);

// Re-exchange halos after vertical mixing
Pacer::timingBarrier("RK2:vMixHaloExchBarrier", 3, Comm);
Pacer::start("RK2:vMixHaloExch", 3);
State->exchangeHalo(CurLevel);
Tracers::exchangeHalo(CurLevel);
Pacer::stop("RK2:vMixHaloExch", 3);
}

validateOceanState(State, AuxState, VertCoord::getDefault(), CurLevel);
Expand Down
9 changes: 8 additions & 1 deletion components/omega/src/timeStepping/RungeKutta4Stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ void RungeKutta4Stepper::doStep(OceanState *State, // model state
CurTracerArray = Tracers::getAll(CurLevel);
if (VMix->VelVertMixSetup.Enabled or VMix->TracerVertMixSetup.Enabled) {
VMix->VertMixImplicit(State, AuxState, CurTracerArray, NTracers,
State->CurTimeIndex);
CurLevel);

// Re-exchange halos after vertical mixing
Pacer::timingBarrier("RK4:vMixHaloExchBarrier", 3, Comm);
Pacer::start("RK4:vMixHaloExch", 3);
State->exchangeHalo(CurLevel);
Tracers::exchangeHalo(CurLevel);
Pacer::stop("RK4:vMixHaloExch", 3);
}

validateOceanState(State, AuxState, VertCoord::getDefault(), CurLevel);
Expand Down
Loading