Skip to content

Commit

Permalink
Added assertions during initialization for init_type of "metgrid" and…
Browse files Browse the repository at this point in the history
… "real" that there are sufficient points in a relaxation zone for computing the laplacian.
  • Loading branch information
wiersema1 committed Nov 14, 2024
1 parent 92dad5b commit 6cca316
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Initialization/ERF_init_from_metgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ ERF::init_from_metgrid (int lev)
// At least two met_em files are necessary to calculate tendency terms.
AMREX_ALWAYS_ASSERT(ntimes >= 2);

// At least three points are necessary if there is a relaxation zone.
if (real_width > real_set_width)
AMREX_ALWAYS_ASSERT(real_width-real_set_width >= 3);

// Size the SST and LANDMASK
sst_lev[lev].resize(ntimes);
lmask_lev[lev].resize(ntimes);
Expand Down
5 changes: 5 additions & 0 deletions Source/Initialization/ERF_init_from_wrfinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ ERF::init_from_wrfinput (int lev)
if (nc_bdy_file.empty()) {
amrex::Error("NetCDF boundary file name must be provided via input");
}

// At least three points are necessary if there is a relaxation zone.
if (real_width > real_set_width)
AMREX_ALWAYS_ASSERT(real_width-real_set_width >= 3);

bdy_time_interval = read_from_wrfbdy(nc_bdy_file,geom[0].Domain(),
bdy_data_xlo,bdy_data_xhi,bdy_data_ylo,bdy_data_yhi,
real_width, start_bdy_time);
Expand Down

0 comments on commit 6cca316

Please sign in to comment.