diff --git a/examples/main.c b/examples/main.c index 52eed321a5cd80f581eeea11f315bc766457b4ab..24218fe08ef286257b755916e44cc73f610741d3 100644 --- a/examples/main.c +++ b/examples/main.c @@ -742,12 +742,19 @@ int main(int argc, char *argv[]) { if (myrank == 0) potential_print(&potential); /* Initialise the cooling function properties */ - bzero(&cooling_func, sizeof(struct cooling_function_data)); - if (with_cooling || with_temperature) { #ifdef COOLING_NONE - if (with_cooling) - error("ERROR: Running with cooling but compiled without it."); + if (with_cooling || with_temperature) { + error("ERROR: Running with cooling / temperature calculation" + " but compiled without it."); + } +#else + if (!with_cooling && !with_temperature) { + error("ERROR: Compiled with cooling but running without it. " + "Did you forget the --cooling or --temperature flags?"); + } #endif + bzero(&cooling_func, sizeof(struct cooling_function_data)); + if (with_cooling || with_temperature) { cooling_init(params, &us, &prog_const, &cooling_func); } if (myrank == 0) cooling_print(&cooling_func);