From 03542e8f142033350166e4883c34031cafac0de8 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Mon, 17 Jan 2022 23:20:02 +0100 Subject: [PATCH] Go faster if there is a single date Avoid calling hunt in that case. --- Common/read_snapshot.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Common/read_snapshot.f90 b/Common/read_snapshot.f90 index 6f7f620d..06a3079e 100644 --- a/Common/read_snapshot.f90 +++ b/Common/read_snapshot.f90 @@ -39,7 +39,11 @@ contains !--------------------------------------------------------------------- - call hunt([hshp%d0, huge(0)], k, i_shpc) + if (size(hshp) == 1) then + i_shpc = 1 + else + call hunt([hshp%d0, huge(0)], k, i_shpc) + end if if (k == hshp(i_shpc)%d0) then ishape_first = 0 -- GitLab