diff --git a/src/engine.c b/src/engine.c index c406be307a7bd4ff649a8b034f8da65456d82c67..b66ceb4037f4de87252ce3203d0f7c2933d9ffb9 100644 --- a/src/engine.c +++ b/src/engine.c @@ -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); diff --git a/src/hydro_properties.c b/src/hydro_properties.c index e4135a762472bcf734676a3f294cd401770f9f01..bd8328946d4bfd078bd10b439e96b35dce457c49 100644 --- a/src/hydro_properties.c +++ b/src/hydro_properties.c @@ -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) diff --git a/src/parallel_io.c b/src/parallel_io.c index bcd2a50788acec3761ff6ddf6f4217f74403beee..51c88e95396eb6af1ab7f7eb2d1ed48eada59e0d 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -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) {