From b2f6acbefd3c8e116bc7f7a09a7a75ddddbec594 Mon Sep 17 00:00:00 2001
From: ESCOBAR Juan <escj@nuwa.aerologie.net>
Date: Tue, 9 Apr 2013 16:12:47 +0200
Subject: [PATCH] Juan 9/04/2013: minor change, for test of performance on ppm
 routines

---
 MNH/ppm.f90 | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/MNH/ppm.f90 b/MNH/ppm.f90
index 69de2daa0..ccd14da9d 100644
--- a/MNH/ppm.f90
+++ b/MNH/ppm.f90
@@ -82,7 +82,8 @@ REAL, DIMENSION(:,:,:), INTENT(IN)  :: PRHO  ! density
 REAL,                   INTENT(IN)  :: PTSTEP  ! Time step 
 !
 ! output source term
-REAL, DIMENSION(SIZE(PCR,1),SIZE(PCR,2),SIZE(PCR,3)) :: PR
+REAL, DIMENSION(:,:,:), INTENT(OUT) :: PR
+
 !
 END SUBROUTINE PPM_S0_X
 !
@@ -102,7 +103,8 @@ REAL, DIMENSION(:,:,:), INTENT(IN)  :: PRHO  ! density
 REAL,                   INTENT(IN)  :: PTSTEP  ! Time step 
 !
 ! output source term
-REAL, DIMENSION(SIZE(PCR,1),SIZE(PCR,2),SIZE(PCR,3)) :: PR
+REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PR 
+
 !
 END SUBROUTINE PPM_S0_Y
 !
@@ -1521,6 +1523,8 @@ USE MODE_MNH_ZWORK, ONLY : &
 & ZRHO_MXM=>ZW3D5,ZCR_MXM=>ZW3D6,ZCR_DXF=>ZW3D7, &
 & ZPSRC_HALO2_WEST
 !
+USE MODD_IO_ll,   ONLY : GSMONOPROC
+!
 IMPLICIT NONE
 !
 !*       0.1   Declarations of dummy arguments :
@@ -1536,7 +1540,8 @@ REAL, DIMENSION(:,:,:), INTENT(IN)  :: PRHO  ! density
 REAL,                   INTENT(IN)  :: PTSTEP  ! Time step 
 !
 ! output source term
-REAL, DIMENSION(SIZE(PCR,1),SIZE(PCR,2),SIZE(PCR,3)) :: PR
+REAL, DIMENSION(:,:,:), INTENT(OUT) :: PR
+! acc reflected (psrc,pcr,prho,pr) 
 !
 !*       0.2   Declarations of local variables :
 !
@@ -1596,14 +1601,18 @@ IF(NHALO /= 1) THEN
     STOP
 ENDIF
 !
+IF ( .NOT. GSMONOPROC ) THEN
 CALL GET_HALO2(PSRC,TZ_PSRC_HALO2_ll)
 ZPSRC_HALO2_WEST(:,:) = TZ_PSRC_HALO2_ll%HALO2%WEST(:,:)
 !$acc update device (ZPSRC_HALO2_WEST)
+END IF
 !
 
 #define JUAN_ACC_S0_X
 #ifdef JUAN_ACC_S0_X
-!$acc data pcopyin (psrc,pcr,prho) pcopyout(pr) 
+! acc data pcopyin (psrc,pcr,prho) pcopyout(pr)
+! acc data pcreate (psrc,pcr,prho,pr)
+!$acc data present (psrc,pcr,prho,pr)
 !$acc kernels
 #endif
 !
@@ -1852,7 +1861,7 @@ REAL, DIMENSION(:,:,:), INTENT(IN)  :: PRHO  ! density
 REAL,                   INTENT(IN)  :: PTSTEP  ! Time step 
 !
 ! output source term
-REAL, DIMENSION(SIZE(PCR,1),SIZE(PCR,2),SIZE(PCR,3)) :: PR 
+REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PR 
 !
 !*       0.2   Declarations of local variables :
 !
-- 
GitLab