From 826791d51a602ca7afead3f763a94e2032a5ffad Mon Sep 17 00:00:00 2001
From: ESCOBAR Juan <escj@nuwa>
Date: Thu, 10 Mar 2022 15:53:14 +0100
Subject: [PATCH] Juan 10/03/2022:ZSOLVER/zsolver.f90, add mppdb_check & acc
 kernels

---
 src/ZSOLVER/zsolver.f90 | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/ZSOLVER/zsolver.f90 b/src/ZSOLVER/zsolver.f90
index 15130e126..cf9461595 100644
--- a/src/ZSOLVER/zsolver.f90
+++ b/src/ZSOLVER/zsolver.f90
@@ -152,6 +152,7 @@ USE MODI_DOTPROD
 USE MODE_MNH_ZWORK, ONLY: MNH_MEM_GET, MNH_MEM_POSITION_PIN, MNH_MEM_RELEASE
 #endif
 !
+USE MODE_MPPDB
 !
 IMPLICIT NONE
 !
@@ -227,6 +228,23 @@ INTEGER  :: JI,JJ,JK
 !*       1.    INITIALIZATIONS
 !              ---------------
 !
+if ( mppdb_initialized ) then
+  !Check all in arrays
+   call Mppdb_check( PY,       "Zsolver beg:PY"       )
+   call Mppdb_check( PPHI,     "Zsolver beg:PPHI"     )
+   call Mppdb_check( PAF_ZS,   "Zsolver beg:PAF_ZS"     )
+   call Mppdb_check( PBF_ZS,   "Zsolver beg:PBF_ZS"     )
+   call Mppdb_check( PCF_ZS,   "Zsolver beg:PCF_ZS"     )
+   call Mppdb_check( PDXATH_ZS,"Zsolver beg:PDXATH_ZS"     )
+   call Mppdb_check( PDYATH_ZS,"Zsolver beg:PDYATH_ZS"     )
+   call Mppdb_check( PRHO_ZS,  "Zsolver beg:PRHO_ZS"     )
+   call Mppdb_check( PBFB,     "Zsolver beg:PBFB"     )
+   call Mppdb_check( A_K,      "Zsolver beg:A_K"     )
+   call Mppdb_check( B_K,      "Zsolver beg:B_K"     )
+   call Mppdb_check( C_K,      "Zsolver beg:C_K"     )
+   call Mppdb_check( D_K,      "Zsolver beg:D_K"     )
+end if
+!
 JIU =  size(PPHI, 1 )
 JJU =  size(PPHI, 2 )
 JKU =  size(PPHI, 3 )
@@ -245,11 +263,14 @@ CALL MNH_MEM_GET( ZRESIDUE , JIU, JJU, JKU )
 #endif
 !*       1.1    compute the vector: r^(0) =  Q(PHI) - Y
 !
+!
 #ifndef MNH_OPENACC
 ZRESIDUE = QLAP(HLBCX,HLBCY,PDXX,PDYY,PDZX,PDZY,PDZZ,PRHODJ,PTHETAV,PPHI) - PY
 #else
 CALL  QLAP_DEVICE(ZRESIDUE,HLBCX,HLBCY,PDXX,PDYY,PDZX,PDZY,PDZZ,PRHODJ,PTHETAV,PPHI)
+!$acc kernels present(PY,ZRESIDUE)
 ZRESIDUE = ZRESIDUE - PY
+!$acc end kernels
 #endif
 !
 !*       1.2    compute the vector: p^(0) = F^(-1)*( Q(PHI) - Y )
-- 
GitLab