remove dependence of dump modify 'at' and 'append'

This commit is contained in:
Steve Plimpton
2017-10-06 09:44:29 -06:00
parent f7cbdcf995
commit e91e505fb3
4 changed files with 36 additions and 28 deletions

View File

@ -355,7 +355,12 @@ void DumpNetCDF::openfile()
NCERR( nc_inq_dimlen(ncid, frame_dim, &nframes) );
// framei == -1 means append to file, == -2 means override last frame
// Note that in the input file this translates to 'yes', '-1', etc.
if (framei < 0 || (append_flag && framei == 0)) framei = nframes+framei+1;
if (!append_flag)
error->all(FLERR,"at keyword requires use of 'append yes'");
if (framei < 0 || (append_flag && framei == 0))
framei = nframes+framei+1;
if (framei < 1) framei = 1;
}
else {
@ -924,11 +929,11 @@ int DumpNetCDF::modify_param(int narg, char **arg)
return 2;
}
else if (strcmp(arg[iarg],"at") == 0) {
if (!append_flag)
error->all(FLERR,"expected 'append yes' before 'at' keyword");
iarg++;
if (iarg >= narg)
error->all(FLERR,"expected additional arg after 'at' keyword.");
framei = force->inumeric(FLERR,arg[iarg]);
if (framei < 0) framei--;
if (framei < 0) framei--;
iarg++;
return 2;
}