From 4e81c4c1e7ef12a23979fb6a1abf3a6c56a42086 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Wed, 24 Apr 2024 18:56:12 +0200
Subject: [PATCH] Create intermediary variable `n_dates_slice`

Because we are also going to use it to check continuity of dates
across slices.
---
 Overlap/eddy_graph.f90 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Overlap/eddy_graph.f90 b/Overlap/eddy_graph.f90
index 540fd12e..6345df26 100644
--- a/Overlap/eddy_graph.f90
+++ b/Overlap/eddy_graph.f90
@@ -34,6 +34,9 @@ program eddy_graph
   type(snapshot), allocatable:: flow(:) ! (max_delta + 1)
   character(len = 30) file
 
+  integer, allocatable:: n_dates_slice(:) ! (n_slices)
+  ! number of dates in each slice
+
   namelist /main_nml/ n_dates, i_slice
 
   !-------------------------------------------------------------------------
@@ -95,8 +98,9 @@ program eddy_graph
   end do
 
   if (rank == 0) then
-     if (n_dates == huge(0)) &
-          n_dates = sum([(size(ssm(i)%ishape_last), i = 1, n_slices)])
+     allocate(n_dates_slice(n_slices))
+     forall (i = 1:n_slices) n_dates_slice(i) = size(ssm(i)%ishape_last)
+     if (n_dates == huge(0)) n_dates = sum(n_dates_slice)
      print *, "n_dates = ", n_dates
      call assert(n_dates >= max_delta + 1, &
           "eddy_graph: n_dates should be >= max_delta + 1")
-- 
GitLab