aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOASCII/src
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-06-06 13:05:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-06-06 13:05:00 +0000
commit5be338f130a7c65d60846931e13b80071a5159ef (patch)
tree86bf4c1a48f79f8de656dcbf342bcde8287856b6 /Carpet/CarpetIOASCII/src
parent0a958fbbca36a07421646f49dd3d51c56e1b4aea (diff)
CarpetIOASCII: Do not annotate output files when IO::out_fileinfo="none"
darcs-hash:20050606130520-891bb-ec221f9cc5d5d970c7849a7b0e645202303c8808.gz
Diffstat (limited to 'Carpet/CarpetIOASCII/src')
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc59
1 files changed, 42 insertions, 17 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index f2b8cf64b..5df1d814a 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -480,26 +480,51 @@ namespace CarpetIOASCII {
}
assert (file.good());
{
- char run_host [1000];
- Util_GetHostName (run_host, sizeof run_host);
+ 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, "creation date")) {
+ want_date = true;
+ } else if (CCTK_EQUALS (out_fileinfo, "parameter filename")) {
+ want_parfilename = true;
+ } else if (CCTK_EQUALS (out_fileinfo, "all")) {
+ want_date = true;
+ want_parfilename = true;
+ want_other = true;
+ } else {
+ CCTK_WARN (0, "internal error");
+ }
+ file << "# "<< outdim << "D ASCII output created by CarpetIOASCII" << endl;
+ if (want_date) {
+ char run_host [1000];
+ Util_GetHostName (run_host, sizeof run_host);
#if 0
- char const * const run_user = CCTK_RunUser();
+ char const * const run_user = CCTK_RunUser();
#else
- char const * const run_user = getenv ("USER");
+ char const * const run_user = getenv ("USER");
#endif
- char run_date [1000];
- Util_CurrentDate (sizeof run_date, run_date);
- char run_time [1000];
- Util_CurrentTime (sizeof run_time, run_time);
- file << "# "<< outdim << "D ASCII output created by CarpetIOASCII" << endl
- << "# created on " << run_host
- << " by " << run_user
- << " on " << run_date
- << " at " << run_time << endl;
- if (CCTK_IsFunctionAliased ("UniqueSimulationID")) {
- char const * const job_id
- = (char const *) UniqueSimulationID (cgh);
- file << "# Simulation ID: " << job_id << endl;
+ char run_date [1000];
+ Util_CurrentDate (sizeof run_date, run_date);
+ char run_time [1000];
+ Util_CurrentTime (sizeof run_time, run_time);
+ file << "# created on " << run_host
+ << " by " << run_user
+ << " on " << run_date
+ << " at " << run_time << endl;
+ }
+ if (want_parfilename) {
+ char parameter_filename [10000];
+ CCTK_ParameterFilename (sizeof parameter_filename, parameter_filename);
+ file << "# parameter filename: \"" << parameter_filename << "\"" << endl;
+ }
+ if (want_other) {
+ if (CCTK_IsFunctionAliased ("UniqueSimulationID")) {
+ char const * const job_id
+ = (char const *) UniqueSimulationID (cgh);
+ file << "# Simulation ID: " << job_id << endl;
+ }
}
file << "#" << endl;
}