Commit 27e822d9 authored by Volker Springel's avatar Volker Springel
Browse files

resurrected storing HubbleParam/Hubble in deprecated GADGET2_HEADER

parent cda6e3b5
......@@ -415,13 +415,13 @@ void snap_io::read_ic(const char *fname)
Sp->NumPart += add_numpart;
#endif
#ifdef GADGET2_HEADER
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
if(header.flag_entropy_instead_u) Terminate("Initial condition file contains entropy, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is not set\n");
#else
if(! header.flag_entropy_instead_u)Terminate("Initial condition file contains uthermal, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is set\n");
if(header.flag_entropy_instead_u)
Terminate("Initial condition file contains entropy, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is not set\n");
#else
if(!header.flag_entropy_instead_u)
Terminate("Initial condition file contains uthermal, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is set\n");
#endif
#endif
......@@ -736,6 +736,11 @@ void snap_io::fill_file_header(int writeTask, int lastTask, long long *n_type, l
header.Omega0 = All.Omega0;
header.OmegaLambda = All.OmegaLambda;
#if !(defined(REARRANGE_OPTION) && defined(MERGERTREE))
header.HubbleParam = All.HubbleParam;
header.Hubble = All.Hubble;
#endif
#ifdef OUTPUT_IN_DOUBLEPRECISION
header.flag_doubleprecision = 1;
#else
......
......@@ -79,10 +79,13 @@ class snap_io : public IO_Def
double BoxSize; /**< box-size of simulation in case periodic boundaries were used */
double Omega0; /**< matter density in units of critical density */
double OmegaLambda; /**< cosmological constant parameter */
long long Ntrees; // this replaces the storage space for HubbleParam
long long TotNtrees; // this replaces the storage space for Hubble
// double HubbleParam; /**< little 'h' to scale units systems */
// double Hubble; /**< Hubble constant in internal units */
#if defined(REARRANGE_OPTION) && defined(MERGERTREE)
long long Ntrees; // this replaces the storage space for HubbleParam
long long TotNtrees; // this replaces the storage space for Hubble
#else
double HubbleParam; /**< little 'h' to scale units systems */
double Hubble; /**< Hubble constant in internal units */
#endif
unsigned int npartTotalHighWord[NTYPES_HEADER]; /**< High word of the total number of particles of each type */
int flag_entropy_instead_u; /**< flags that IC-file contains entropy instead of u */
int flag_doubleprecision; /**< flags that snapshot contains double-precision instead of single precision */
......
Markdown is supported
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