Skip to content
Snippets Groups Projects
Commit 9f653a91 authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 09/09/2021:gdiv.f90, for GPU replace auto array -> pointer contiguous + MNH_ALLOCATE

parent 2a1fc534
No related branches found
No related tags found
No related merge requests found
...@@ -135,10 +135,11 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PGDIV ! divergence at ...@@ -135,10 +135,11 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PGDIV ! divergence at
!* 0.2 declarations of local variables !* 0.2 declarations of local variables
! !
! Contravariant components along: ! Contravariant components along:
REAL, DIMENSION(SIZE(PU,1),SIZE(PU,2),SIZE(PU,3)) :: ZUC ! x REAL, DIMENSION(:,:,:) , POINTER , CONTIGUOUS :: ZUC ! x
REAL, DIMENSION(SIZE(PV,1),SIZE(PV,2),SIZE(PV,3)) :: ZVC ! y REAL, DIMENSION(:,:,:) , POINTER , CONTIGUOUS :: ZVC ! y
REAL, DIMENSION(SIZE(PW,1),SIZE(PW,2),SIZE(PW,3)) :: ZWC, & ! z REAL, DIMENSION(:,:,:) , POINTER , CONTIGUOUS :: ZWC ! z
Z1,Z2,Z3 !work arrays REAL, DIMENSION(:,:,:) , POINTER , CONTIGUOUS :: Z1,Z2,Z3 !work arrays
INTEGER :: IZUC,IZVC,IZWC,IZ1,IZ2,IZ3
! !
INTEGER :: IIB ! indice I for the first inner mass point along x INTEGER :: IIB ! indice I for the first inner mass point along x
INTEGER :: IIE ! indice I for the last inner mass point along x INTEGER :: IIE ! indice I for the last inner mass point along x
...@@ -168,11 +169,22 @@ CALL GET_INDICE_ll(IIB,IJB,IIE,IJE) ...@@ -168,11 +169,22 @@ CALL GET_INDICE_ll(IIB,IJB,IIE,IJE)
IKB=1+JPVEXT IKB=1+JPVEXT
IKE=SIZE(PU,3) - JPVEXT IKE=SIZE(PU,3) - JPVEXT
! !
#ifdef MNH_OPENACC !
IIU=SIZE(PU,1) IIU=SIZE(PU,1)
IJU=SIZE(PU,2) IJU=SIZE(PU,2)
IKU=SIZE(PU,3) IKU=SIZE(PU,3)
! !
#ifndef MNH_OPENACC
ALLOCATE(ZUC(IIU,IJU,IKU),ZVC(IIU,IJU,IKU),ZWC(IIU,IJU,IKU))
ALLOCATE(Z1(IIU,IJU,IKU),Z2(IIU,IJU,IKU),Z2(IIU,IJU,IKU))
#else
IZUC = MNH_ALLOCATE_ZT3D(ZUC,IIU,IJU,IKU )
IZVC = MNH_ALLOCATE_ZT3D(ZVC,IIU,IJU,IKU )
IZWC = MNH_ALLOCATE_ZT3D(ZWC,IIU,IJU,IKU )
IZ1 = MNH_ALLOCATE_ZT3D(Z1,IIU,IJU,IKU )
IZ2 = MNH_ALLOCATE_ZT3D(Z2,IIU,IJU,IKU )
IZ3 = MNH_ALLOCATE_ZT3D(Z3,IIU,IJU,IKU )
!
IZTMP1 = MNH_ALLOCATE_ZT3D( ZTMP1,IIU,IJU,IKU ) IZTMP1 = MNH_ALLOCATE_ZT3D( ZTMP1,IIU,IJU,IKU )
IZTMP2 = MNH_ALLOCATE_ZT3D( ZTMP2,IIU,IJU,IKU ) IZTMP2 = MNH_ALLOCATE_ZT3D( ZTMP2,IIU,IJU,IKU )
#endif #endif
...@@ -333,7 +345,7 @@ END IF ...@@ -333,7 +345,7 @@ END IF
!$acc wait !$acc wait
! !
#ifdef MNH_OPENACC #ifdef MNH_OPENACC
CALL MNH_REL_ZT3D ( IZTMP1,IZTMP2 ) CALL MNH_REL_ZT3D (IZUC,IZVC,IZWC,IZ1,IZ2,IZ3,IZTMP1,IZTMP2)
#endif #endif
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment