From 30cebcc67226160374c2f0449d24faff2b56e219 Mon Sep 17 00:00:00 2001
From: Antoine Hoffmann <antoine.hoffmann@epfl.ch>
Date: Thu, 28 Sep 2023 10:14:35 +0200
Subject: [PATCH] closure fix for P=0,J=0 case

---
 src/closure_mod.F90 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/closure_mod.F90 b/src/closure_mod.F90
index c580905d..c644b8f2 100644
--- a/src/closure_mod.F90
+++ b/src/closure_mod.F90
@@ -80,7 +80,9 @@ SUBROUTINE set_closure_model
         nmaxarray(ij) = jmax - jarray(ij+ngj/2)
       ENDDO
     ELSE
-      nmaxarray(:) = nmax
+      DO ij = 1,local_nj
+        nmaxarray(ij) = MIN(nmax,jmax)
+      ENDDO
     ENDIF
   CASE('anti_laguerre_aliasing')
     DO ij = 1,local_nj
-- 
GitLab