diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 0133c68bfe..a3ceec8f8a 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -851,12 +851,13 @@ Castro::buildMetrics () dLogArea[dir].clear(); geom.GetDLogA(dLogArea[dir],grids,dmap,dir,NUM_GROW); } - for (int dir = AMREX_SPACEDIM; dir < 2; dir++) - { - dLogArea[dir].clear(); - dLogArea[dir].define(grids, dmap, 1, 0); - dLogArea[dir].setVal(0.0); - } + +#if (AMREX_SPACEDIM == 1) + dLogArea[1].clear(); + dLogArea[1].define(grids, dmap, 1, 0); + dLogArea[1].setVal(0.0); +#endif + #endif wall_time_start = 0.0;