diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 6a03660c42..28691bded4 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -591,7 +591,12 @@ Castro::read_params () if (ppr.countval("max_level") > 0) { int max_level; ppr.get("max_level", max_level); + BL_ASSERT(max_level <= MAX_LEV); info.SetMaxLevel(max_level); + } else { + // the default max_level of AMRErrorTagInfo is 1000, but make sure + // that it is reasonable for Castro + info.SetMaxLevel(MAX_LEV); } if (ppr.countval("volume_weighting") > 0) { int volume_weighting; @@ -604,10 +609,6 @@ Castro::read_params () info.SetDerefine(derefine); } - // the default max_level of AMRErrorTagInfo is 1000, but make sure - // that it is reasonable for Castro - BL_ASSERT(info.m_max_level < MAX_LEV); - if (ppr.countval("value_greater")) { Vector value; ppr.getarr("value_greater", value, 0, ppr.countval("value_greater"));