Commit 14f5b1f4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Print the scale-factor and redshift to the HDF5 header.

parent 30d2f611
...@@ -870,6 +870,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], ...@@ -870,6 +870,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension; int dimension = (int)hydro_dimension;
io_write_attribute(h_grp, "Dimension", INT, &dimension, 1); io_write_attribute(h_grp, "Dimension", INT, &dimension, 1);
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
/* GADGET-2 legacy values */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* Number of particles of each type */
......
...@@ -778,6 +778,8 @@ void write_output_serial(struct engine* e, const char* baseName, ...@@ -778,6 +778,8 @@ void write_output_serial(struct engine* e, const char* baseName,
io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension; int dimension = (int)hydro_dimension;
io_write_attribute(h_grp, "Dimension", INT, &dimension, 1); io_write_attribute(h_grp, "Dimension", INT, &dimension, 1);
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
/* GADGET-2 legacy values */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* Number of particles of each type */
......
...@@ -630,6 +630,8 @@ void write_output_single(struct engine* e, const char* baseName, ...@@ -630,6 +630,8 @@ void write_output_single(struct engine* e, const char* baseName,
io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension; int dimension = (int)hydro_dimension;
io_write_attribute(h_grp, "Dimension", INT, &dimension, 1); io_write_attribute(h_grp, "Dimension", INT, &dimension, 1);
io_write_attribute(h_grp, "Redshift", DOUBLE, &e->cosmology->z, 1);
io_write_attribute(h_grp, "Scale-factor", DOUBLE, &e->cosmology->a, 1);
/* GADGET-2 legacy values */ /* GADGET-2 legacy values */
/* Number of particles of each type */ /* 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