From 6613afcd40ea71c4354394e207ea49173606f0e4 Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Tue, 15 Jun 2021 14:06:27 +0200
Subject: [PATCH] check if the parallel. along p is suitable for DGGK

---
 src/grid_mod.F90 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/grid_mod.F90 b/src/grid_mod.F90
index f37b79dd..46d2ee30 100644
--- a/src/grid_mod.F90
+++ b/src/grid_mod.F90
@@ -110,6 +110,10 @@ CONTAINS
       CALL decomp1D(pmaxi+1, num_procs_p, in, istart, iend)
       counts_np_i(in+1) = iend-istart+1
       displs_np_i(in+1) = istart-1
+    !DGGK operator uses moments at index p=2 (ip=3) for the p=0 term so the
+    ! process that contains ip=1 MUST contain ip=3 as well for both e and i.
+    IF(((ips_e .EQ. 1) .OR. (ips_i .EQ. 1)) .AND. ((ipe_e .LT. 3) .OR. (ipe_i .LT. 3)))&
+     WRITE(*,*) "Warning : distribution along p may not work with DGGK"
     ENDDO
 
     ! local grid computation
-- 
GitLab