Skip to content

Commit

Permalink
Merge pull request #64 from EXP-code/FixExceptions
Browse files Browse the repository at this point in the history
Fix for exception handler in SLGridSph and allow deprecated parameter…
  • Loading branch information
The9Cat authored Feb 13, 2024
2 parents 85f5c0f + 91d063c commit 64dc420
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions exputil/SLGridMP2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2258,10 +2258,17 @@ bool SLGridSph::ReadH5Cache(void)
if (not checkInt(cmap, "cmap")) return false;
if (not checkDbl(rmin, "rmin")) return false;
if (not checkDbl(rmax, "rmax")) return false;
if (not checkDbl(rmap, "rmapping")) return false;
if (not checkInt(diverge, "diverge")) return false;
if (not checkDbl(dfac, "dfac")) return false;

// Backward compatibility for old 'scale' key word
//
if (h5file.hasAttribute("scale")) {
if (not checkDbl(rmap, "scale")) return false;
} else {
if (not checkDbl(rmap, "rmapping")) return false;
}

// Harmonic order
//
auto harmonic = h5file.getGroup("Harmonic");
Expand Down Expand Up @@ -2291,8 +2298,9 @@ bool SLGridSph::ReadH5Cache(void)
} catch (HighFive::Exception& err) {
if (myid==0)
std::cerr << "---- SLGridSph::ReadH5Cache: "
<< "error opening <" << sph_cache_name
<< "> as HDF5 basis cache" << std::endl;
<< "error reading <" << sph_cache_name << ">" << std::endl
<< "---- SLGridSph::ReadH5Cache: HDF5 error is <" << err.what()
<< ">" << std::endl;
}

return false;
Expand Down

0 comments on commit 64dc420

Please sign in to comment.