Commit 2b9c96d6 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Write the time and date of the snapshot output in the header.

parent 117013d5
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/* This object's header. */
#include "parallel_io.h"
......@@ -968,6 +969,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/* This object's header. */
#include "serial_io.h"
......@@ -822,6 +823,8 @@ void write_output_serial(struct engine* e, const char* baseName,
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/* This object's header. */
#include "single_io.h"
......@@ -672,6 +673,8 @@ void write_output_single(struct engine* e, const char* baseName,
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment