Simon: Fortran 90 does not short circuit boolean evaluations. You had lots of
Simon: Fortran 90 does not short circuit boolean evaluations. You had lots of

if (have_ub .and. something_about(ub_state_id))

where ub_state_id isn't initialised unless have_ub is true. This code is invalid;
something_about(ub_state_id) is still executed, even if have_ub is .false. .

FluidityProject/multifluids,FluidityProject/multifluids,FluidityProject/multifluids,FluidityProject/multifluids