diff --git a/MNH/advec_ppm_algo.f90 b/MNH/advec_ppm_algo.f90 index 54da93967d9de8f61a285f1bdeba2154b7b81ebc..e64f8349e76c7135dcada2b9a229c3b94ad558a0 100644 --- a/MNH/advec_ppm_algo.f90 +++ b/MNH/advec_ppm_algo.f90 @@ -104,6 +104,8 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRC ! source term after advection ! !* 0.2 Declarations of local variables : ! +REAL, DIMENSION(SIZE(PFIELDT,1),SIZE(PFIELDT,2),SIZE(PFIELDT,3)) :: ZPPM ! temp PPM output +! !INTEGER:: IW,IE,IS,IN,IT,IB,IWF,IEF,ISF,INF ! Coordinate of 4th order diffusion area ! !------------------------------------------------------------------------------- @@ -116,7 +118,10 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRC ! source term after advection !* 0. INITIAL STEP ! ------------ ! +!$acc data copyin(PFIELDT,PRHODJ) copyout(PSRC) local (ZPPM) +!$acc kernels PSRC = PFIELDT +!$acc end kernels ! SELECT CASE (HMET_ADV_SCHEME) ! @@ -176,46 +181,71 @@ CASE('PPM_01') !* 1. ADVECTION IN X DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHODJ) - & - PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHODJ, PTSTEP) +!$acc data copyin(PCRU,PCRV,PCRW,PRHOX1,PRHOY1,PRHOZ1) +! + CALL PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHODJ, PTSTEP, ZPPM) +!!$ - PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHODJ, PTSTEP) + !$acc kernels + PSRC = ( PSRC * PRHODJ ) - ZPPM PSRC = PSRC / PRHOX1 + !$acc end kernels ! !* 2. ADVECTION IN Y DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHOX1) - & - PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOX1, PTSTEP) + CALL PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOX1, PTSTEP, ZPPM) +!!$ - PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOX1, PTSTEP) + !$acc kernels + PSRC = (PSRC * PRHOX1) - ZPPM PSRC = PSRC / PRHOY1 + !$acc end kernels ! !* 3. ADVECTION IN Z DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHOY1) - & - PPM_01_Z(KGRID, PSRC, PCRW, PRHOY1, PTSTEP) + CALL PPM_01_Z(KGRID, PSRC, PCRW, PRHOY1, PTSTEP, ZPPM) +!!$ - PPM_01_Z(KGRID, PSRC, PCRW, PRHOY1, PTSTEP) + !$acc kernels + PSRC = (PSRC * PRHOY1) - ZPPM PSRC = PSRC / PRHOZ1 + !$acc end kernels +!$acc end data + ! ELSE ! !* 1. ADVECTION IN Z DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHODJ) - & - PPM_01_Z(KGRID, PSRC, PCRW, PRHODJ, PTSTEP) +!$acc data copyin(PCRW,PCRV,PRHOZ2,PRHOY2,PCRU,PRHOX2) +! + CALL PPM_01_Z(KGRID, PSRC, PCRW, PRHODJ, PTSTEP, ZPPM) +!!$ - PPM_01_Z(KGRID, PSRC, PCRW, PRHODJ, PTSTEP) + !$acc kernels + PSRC = (PSRC * PRHODJ) - ZPPM PSRC = PSRC / PRHOZ2 + !$acc end kernels ! !* 2. ADVECTION IN Y DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHOZ2) - & - PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOZ2, PTSTEP) + CALL PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOZ2, PTSTEP, ZPPM) +!!$ - PPM_01_Y(HLBCY, KGRID, PSRC, PCRV, PRHOZ2, PTSTEP) + !$acc kernels + PSRC = (PSRC * PRHOZ2) - ZPPM PSRC = PSRC / PRHOY2 + !$acc end kernels ! !* 3. ADVECTION IN X DIRECTION ! ------------------------ ! - PSRC = (PSRC * PRHOY2) - & - PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHOY2, PTSTEP) + CALL PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHOY2, PTSTEP, ZPPM) +!!$ - PPM_01_X(HLBCX, KGRID, PSRC, PCRU, PRHOY2, PTSTEP) + !$acc kernels + PSRC = (PSRC * PRHOY2) - ZPPM PSRC = PSRC / PRHOX2 + !$acc end kernels +!$acc end data ! END IF ! @@ -275,6 +305,9 @@ END SELECT ! compatible to the rest of the model forcings, we need to substract the ! initial field, devide by dt and muliplty by RHODJ ! +!$acc kernels PSRC = (PSRC - PFIELDT)*PRHODJ/PTSTEP +!$acc end kernels +!$acc end data ! END SUBROUTINE ADVEC_PPM_ALGO