From fbe42cda2d2458e60ba3bc6906d4c6f62cac74d6 Mon Sep 17 00:00:00 2001 From: Lars Pastewka Date: Sun, 1 Oct 2017 14:31:33 +0200 Subject: [PATCH] MAINT: Only set append flag when not in multifile mode. --- src/USER-NETCDF/dump_netcdf.cpp | 7 ++++--- src/USER-NETCDF/dump_netcdf_mpiio.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index be274b2052..7156b773b3 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -616,13 +616,14 @@ void DumpNetCDF::closefile() if (filewriter && singlefile_opened) { NCERR( nc_close(ncid) ); singlefile_opened = 0; - // append next time DumpNetCDF::openfile is called - append_flag = 1; // write to next frame upon next open if (multifile) framei = 1; - else + else { + // append next time DumpNetCDF::openfile is called + append_flag = 1; framei++; + } } } diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 271f963a4e..29c2b6cb1f 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -592,13 +592,14 @@ void DumpNetCDFMPIIO::closefile() if (singlefile_opened) { NCERR( ncmpi_close(ncid) ); singlefile_opened = 0; - // append next time DumpNetCDFMPIIO::openfile is called - append_flag = 1; // write to next frame upon next open if (multifile) framei = 1; - else + else { + // append next time DumpNetCDFMPIIO::openfile is called + append_flag = 1; framei++; + } } }