From 95fb5806d34913634486238691a9ea34ded9d6b1 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Thu, 18 Nov 2021 13:08:09 +0100
Subject: [PATCH] Do not redefine `n_dates` if defined in namelist

If `n_dates` has been defined in the namelist then it is used by
`read_column` and, after the call to `read_column`, it is already the size
of `ishape_last`. It is clearer not to redefine it.
---
 Overlap/eddy_graph.f90 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Overlap/eddy_graph.f90 b/Overlap/eddy_graph.f90
index 2697068c..028b3751 100644
--- a/Overlap/eddy_graph.f90
+++ b/Overlap/eddy_graph.f90
@@ -93,7 +93,7 @@ program eddy_graph
      copy = merge(dist_lim, 0, periodic)
      call read_column(ishape_last, &
           file = trim(shpc_dir) // "/ishape_last.txt", last = n_dates)
-     n_dates = size(ishape_last)
+     if (n_dates == huge(0)) n_dates = size(ishape_last)
      call assert(n_dates >= max_delta + 1, &
           "eddy_graph: n_dates should be >= max_delta + 1")
      call assert(n_proc <= n_dates / (max_delta + 1), &
-- 
GitLab