Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
/* This object's header. */ /* This object's header. */
#include "parallel_io.h" #include "parallel_io.h"
...@@ -968,6 +969,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], ...@@ -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, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1); io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT"); 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 */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* Number of particles of each type */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
/* This object's header. */ /* This object's header. */
#include "serial_io.h" #include "serial_io.h"
...@@ -822,6 +823,8 @@ void write_output_serial(struct engine* e, const char* baseName, ...@@ -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, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1); io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT"); 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 */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* Number of particles of each type */
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
/* This object's header. */ /* This object's header. */
#include "single_io.h" #include "single_io.h"
...@@ -672,6 +673,8 @@ void write_output_single(struct engine* e, const char* baseName, ...@@ -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, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1); io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
io_write_attribute_s(h_grp, "Code", "SWIFT"); 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 */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* Number of particles of each type */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment