diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-06-18 20:00:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-06-18 20:00:00 +0000 |
commit | 5dc579f15d0a7c745507d217df42431ddc8d322a (patch) | |
tree | 2b01f35b0fb67ec586749d9b5b610323dc5d79bb /Carpet/CarpetIOScalar | |
parent | 70bd7ede566ac356141de2d98699c65c6cee7927 (diff) |
CarpetIOScalar: Produce fewer comments with IO::out_fileinfo="none"
When IO::out_fileinfo="none", avoid all comment lines except for two
describing which thorn produced a file.
darcs-hash:20060618200009-dae7b-2a2c124cdb17d046d9d9225c6563d836f9e0a88a.gz
Diffstat (limited to 'Carpet/CarpetIOScalar')
-rw-r--r-- | Carpet/CarpetIOScalar/src/ioscalar.cc | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Carpet/CarpetIOScalar/src/ioscalar.cc b/Carpet/CarpetIOScalar/src/ioscalar.cc index 739360a78..ad5c9a1a4 100644 --- a/Carpet/CarpetIOScalar/src/ioscalar.cc +++ b/Carpet/CarpetIOScalar/src/ioscalar.cc @@ -275,18 +275,20 @@ namespace CarpetIOScalar { if (do_truncate.at(n) and IO_TruncateOutputFiles (cctkGH)) { file.open (filename, ios::out | ios::trunc); { + bool want_labels = false; bool want_date = false; bool want_parfilename = false; bool want_other = false; if (CCTK_EQUALS (out_fileinfo, "none")) { // do nothing } else if (CCTK_EQUALS (out_fileinfo, "axis labels")) { - // do nothing + want_labels = true; } else if (CCTK_EQUALS (out_fileinfo, "creation date")) { want_date = true; } else if (CCTK_EQUALS (out_fileinfo, "parameter filename")) { want_parfilename = true; } else if (CCTK_EQUALS (out_fileinfo, "all")) { + want_labels = true; want_date = true; want_parfilename = true; want_other = true; @@ -330,19 +332,21 @@ namespace CarpetIOScalar { } } file << "#" << endl; - } - file << "# " << varname << " (" << alias << ")" << endl; - file << "# 1:iteration 2:time 3:data" << endl; - int col = 3; - if (one_file_per_group) { - file << "# data columns:"; - int const firstvar = CCTK_FirstVarIndexI(group); - int const numvars = CCTK_NumVarsInGroupI(group); - for (int n=firstvar; n<firstvar+numvars; ++n) { - file << " " << col << ":" << CCTK_VarName(n); - col += CarpetSimpleMPIDatatypeLength (vartype); + if (want_labels) { + file << "# " << varname << " (" << alias << ")" << endl; + file << "# 1:iteration 2:time 3:data" << endl; + int col = 3; + if (one_file_per_group) { + file << "# data columns:"; + int const firstvar = CCTK_FirstVarIndexI(group); + int const numvars = CCTK_NumVarsInGroupI(group); + for (int n=firstvar; n<firstvar+numvars; ++n) { + file << " " << col << ":" << CCTK_VarName(n); + col += CarpetSimpleMPIDatatypeLength (vartype); + } + file << endl; + } } - file << endl; } } else { file.open (filename, ios::out | ios::app); |