From e2fede9076dc510aab0fadf9ebea146dc53338e5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 9 Aug 2024 21:07:03 -0400 Subject: [PATCH] sync write_dump with upstream to avoid issues. --- src/write_dump.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/write_dump.cpp b/src/write_dump.cpp index f78382dcc2..1932f08186 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -57,7 +57,18 @@ void WriteDump::command(int narg, char **arg) dumpargs[2] = arg[1]; // dump style dumpargs[3] = utils::strdup(std::to_string(dumpfreq)); // dump frequency - auto *dump = output->add_dump(modindex + 2, dumpargs); + // copy arguments up to modify, but skip over "noinit" if present + + int noinitwarn = 0; + for (int i = 2; i < modindex; ++i) { + if (strcmp(arg[i], "noinit") == 0) { + noinitwarn = 1; + } else { + dumpargs[i + 2 - noinitwarn] = arg[i]; + } + } + + auto *dump = output->add_dump(modindex + 2 - noinitwarn, dumpargs); try { if (modindex < narg) dump->modify_params(narg - modindex - 1, &arg[modindex + 1]); @@ -73,7 +84,7 @@ void WriteDump::command(int narg, char **arg) if (strcmp(arg[1], "image") == 0) (dynamic_cast(dump))->multifile_override = 1; if (strcmp(arg[1], "cfg") == 0) (dynamic_cast(dump))->multifile_override = 1; - if ((update->first_update == 0) && (comm->me == 0)) + if ((update->first_update == 0) && (comm->me == 0) && (noinitwarn == 0)) error->warning(FLERR, "Calling write_dump before a full system init."); dump->init();