diff --git a/src/advance.cpp b/src/advance.cpp index 962b25ea..4c79f548 100644 --- a/src/advance.cpp +++ b/src/advance.cpp @@ -93,14 +93,20 @@ bool advance(Planets &planet, if (didWork) didWork = neutralsMag.set_bcs(mGrid, time, indices); + // advect in the 3rd dimension (vertical), but only if we have it: if (gGrid.get_nAlts(false) > 1) { neutrals.advect_vertical(gGrid, time); + if (didWork & input.get_check_for_nans()) + didWork = neutrals.check_for_nonfinites("After Vertical Neutral Advection"); ions.advect_vertical(gGrid, time); } - //neutrals.exchange_old(gGrid); - //advect(gGrid, time, neutrals); - + // advect in the 1st and 2nd dimensions (horizontal), but only if + // we have those dimensions: + if (gGrid.get_HasXdim() || gGrid.get_HasYdim()) { + neutrals.exchange_old(gGrid); + advect(gGrid, time, neutrals); + } if (didWork & input.get_check_for_nans()) didWork = neutrals.check_for_nonfinites("After Horizontal Advection");