Commit f883dc43 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Various bug and typo fixes.

parent f2bee4f1
......@@ -4396,7 +4396,6 @@ void engine_step(struct engine *e) {
if (e->policy & engine_policy_cosmology) {
e->time_old = e->time;
cosmology_update(e->cosmology, e->physical_constants, e->ti_current);
gravity_update(e->gravity_properties, e->cosmology);
e->time = e->cosmology->time;
e->time_step = e->time - e->time_old;
} else {
......@@ -4405,6 +4404,10 @@ void engine_step(struct engine *e) {
e->time_step = (e->ti_current - e->ti_old) * e->time_base;
}
/* Update the softening lengths */
if (e->policy & engine_policy_self_gravity)
gravity_update(e->gravity_properties, e->cosmology);
/* Prepare the tasks to be launched, rebuild or repartition if needed. */
engine_prepare(e);
......
......@@ -87,7 +87,8 @@ void hydro_props_init(struct hydro_props *p,
p->minimal_temperature = parser_get_opt_param_float(
params, "SPH:minimal_temperature", hydro_props_default_min_temp);
if (p->initial_temperature < p->minimal_temperature)
if ((p->initial_temperature != 0.) &&
(p->initial_temperature < p->minimal_temperature))
error("Initial temperature lower than minimal allowed temperature!");
/* Hydrogen mass fraction */
......@@ -159,7 +160,7 @@ void hydro_props_print(const struct hydro_props *p) {
message("Initial gas temperature set to %f", p->initial_temperature);
if (p->minimal_temperature != hydro_props_default_min_temp)
message("Minimal gas temperature set to %f", p->initial_temperature);
message("Minimal gas temperature set to %f", p->minimal_temperature);
}
#if defined(HAVE_HDF5)
......
......@@ -141,7 +141,7 @@ void readArray_chunk(hid_t h_data, hid_t h_plist_id,
/* Clean-up h if necessary */
const float h_factor_exp = units_h_factor(internal_units, props.units);
if (cleanup_h && h_factor_exp != 0.f && exist != 0) {
if (cleanup_h && h_factor_exp != 0.f) {
const double h_factor = pow(h, h_factor_exp);
/* message("Multipltying '%s' by h^%f=%f", props.name, h_factor_exp,
......@@ -229,7 +229,7 @@ void readArray(hid_t grp, struct io_props props, size_t N, long long N_total,
/* Write the first chunk */
const size_t this_chunk = (N > max_chunk_size) ? max_chunk_size : N;
readArray_chunk(h_data, h_plist_id, props, this_chunk, offset,
internal_units, ic_units);
internal_units, ic_units, cleanup_h, h);
/* Compute how many items are left */
if (N > max_chunk_size) {
......
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