simplify and avoid redundant output

This commit is contained in:
Axel Kohlmeyer
2021-12-21 13:39:00 -05:00
parent 364d0be28c
commit 0576d525ad
2 changed files with 8 additions and 8 deletions

View File

@ -888,10 +888,10 @@ int DumpNetCDF::modify_param(int narg, char **arg)
void DumpNetCDF::ncerr(int err, const char *descr, int line) void DumpNetCDF::ncerr(int err, const char *descr, int line)
{ {
if (err != NC_NOERR) { if (err != NC_NOERR) {
if (descr) error->one(FLERR,"NetCDF failed with error '{}' (while accessing '{}') " if (descr) error->one(__FILE__, line, "NetCDF failed with error '{}' (while accessing '{}') ",
" in line {} of {}.", nc_strerror(err), descr, line, __FILE__); nc_strerror(err), descr, line);
else error->one(FLERR,"NetCDF failed with error '{}' in line {} of {}.", else error->one(__FILE__, line,"NetCDF failed with error '{}' in line {} of {}.",
nc_strerror(err), line, __FILE__); nc_strerror(err));
} }
} }

View File

@ -884,10 +884,10 @@ int DumpNetCDFMPIIO::modify_param(int narg, char **arg)
void DumpNetCDFMPIIO::ncerr(int err, const char *descr, int line) void DumpNetCDFMPIIO::ncerr(int err, const char *descr, int line)
{ {
if (err != NC_NOERR) { if (err != NC_NOERR) {
if (descr) error->one(FLERR,"NetCDF failed with error '{}' (while accessing '{}') " if (descr) error->one(__FILE__, line, "NetCDF failed with error '{}' (while accessing '{}') ",
" in line {} of {}.", ncmpi_strerror(err), descr, line, __FILE__); ncmpi_strerror(err), descr);
else error->one(FLERR,"NetCDF failed with error '{}' in line {} of {}.", else error->one(__FILE__, line,"NetCDF failed with error '{}' in line {} of {}.",
ncmpi_strerror(err), line, __FILE__); ncmpi_strerror(err));
} }
} }