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

Juan 03/03/2022:ice_adjust.f90, nvhpc22.2 optimisation -> replace WHERE+ARRAY...

Juan 03/03/2022:ice_adjust.f90, nvhpc22.2 optimisation -> replace WHERE+ARRAY SYNTAX -> DO CONCURRENT
parent 9eb0e1bf
No related branches found
No related tags found
No related merge requests found
......@@ -478,38 +478,46 @@ ENDDO ! end of the iterative loop
! -------------------------------------------------
!
!$acc kernels
#ifdef MNH_COMPILER_NVHPC
!$acc loop independent collapse(3)
#endif
DO CONCURRENT (JI=1:IIU,JJ=1:IJU,JK=1:IKU)
!
!* 5.0 compute the variation of mixing ratio
!
! Rc - Rc*
ZW1(:,:,:) = (ZRC(:,:,:) - PRC(:,:,:)) / PTSTEP ! Pcon = ----------
ZW1(JI,JJ,JK) = (ZRC(JI,JJ,JK) - PRC(JI,JJ,JK)) / PTSTEP ! Pcon = ----------
! 2 Delta t
ZW2(:,:,:) = (ZRI(:,:,:) - PRI(:,:,:)) / PTSTEP ! idem ZW1 but for Ri
ZW2(JI,JJ,JK) = (ZRI(JI,JJ,JK) - PRI(JI,JJ,JK)) / PTSTEP ! idem ZW1 but for Ri
!
!* 5.1 compute the sources
!
GTEMP(:,:,:) = ZW1(:,:,:) < 0.0
WHERE( GTEMP(:,:,:) )
ZW1(:,:,:) = MAX ( ZW1(:,:,:), -PRCS(:,:,:) )
ELSEWHERE
ZW1(:,:,:) = MIN ( ZW1(:,:,:), PRVS(:,:,:) )
END WHERE
PRVS(:,:,:) = PRVS(:,:,:) - ZW1(:,:,:)
PRCS(:,:,:) = PRCS(:,:,:) + ZW1(:,:,:)
PTHS(:,:,:) = PTHS(:,:,:) + &
ZW1(:,:,:) * ZLV(:,:,:) / (ZCPH(:,:,:) * PEXNREF(:,:,:))
!
GTEMP(:,:,:) = ZW2(:,:,:) < 0.0
WHERE( GTEMP(:,:,:) )
ZW2(:,:,:) = MAX ( ZW2(:,:,:), -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ed with caution.
Finish editing this message first!
Please register or to comment