Skip to content
Snippets Groups Projects
Commit 9eddf1dc authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Naima + Philippe 09/02/2022: OpenACC: workaround CCE compiler problem:...

Naima + Philippe 09/02/2022: OpenACC: workaround CCE compiler problem: problems with character arrays in kernels regions
parent c5204eb1
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,8 @@ REAL, DIMENSION(:), allocatable :: ZRCRAUTC, & !RC value to begin rain f
! note that ZRC/CF = ZHLC_HRCLOCAL+ ZHLC_LRCLOCAL
! = PHLC_HRC/HCF+ PHLC_LRC/LCF
ZSUMRC, ZSUMRI
!
INTEGER :: IHSUBG_PR_PDF ! temporary variable for OpenCC character limitation (Cray CCE)
!
!-------------------------------------------------------------------------------
......@@ -257,6 +259,20 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
ZCOEFFRCM=4.
END IF
!$acc update device(ZCOEFFRCM)
SELECT CASE( HSUBG_PR_PDF )
CASE ( 'HLCRECTPDF' )
IHSUBG_PR_PDF = 1
CASE ( 'HLCTRIANGPDF' )
IHSUBG_PR_PDF = 2
CASE ( 'HLCQUADRAPDF' )
IHSUBG_PR_PDF = 3
CASE ( 'HLCISOTRIPDF' )
IHSUBG_PR_PDF = 4
CASE DEFAULT
IHSUBG_PR_PDF = 0
END SELECT
!$acc kernels
GWORK(:) = PRCT(:)>0. .AND. PCF(:)>0.
WHERE(GWORK(:))
......@@ -265,18 +281,21 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
! Split available water and cloud fraction in two parts
! Calculate local mean values int he low and high parts for the 3 PDF forms:
GWORK(:) = PRCT(:)>0. .AND. PCF(:)>0. .AND. ZHLC_RCMAX(:)>ZRCRAUTC(:)
IF(HSUBG_PR_PDF=='HLCRECTPDF') THEN
!IF(HSUBG_PR_PDF=='HLCRECTPDF') THEN
IF (IHSUBG_PR_PDF==1) THEN
WHERE(GWORK(:))
ZHLC_LRCLOCAL(:)=0.5*ZRCRAUTC(:)
ZHLC_HRCLOCAL(:)=( ZHLC_RCMAX(:) + ZRCRAUTC(:))/2.0
END WHERE
ELSE IF(HSUBG_PR_PDF=='HLCTRIANGPDF') THEN
!ELSE IF(HSUBG_PR_PDF=='HLCTRIANGPDF') THEN
ELSE IF (IHSUBG_PR_PDF==2) THEN
WHERE(GWORK(:))
ZHLC_LRCLOCAL(:)=( ZRCRAUTC(:) *(3.0 * ZHLC_RCMAX(:) - 2.0 * ZRCRAUTC(:) ) ) &
/ (3.0 * (2.0 * ZHLC_RCMAX(:) - ZRCRAUTC(:) ) )
ZHLC_HRCLOCAL(:)=(ZHLC_RCMAX(:) + 2.0*ZRCRAUTC(:)) / 3.0
END WHERE
ELSE IF(HSUBG_PR_PDF=='HLCQUADRAPDF') THEN
!ELSE IF(HSUBG_PR_PDF=='HLCQUADRAPDF') THEN
ELSE IF (IHSUBG_PR_PDF==3) THEN
WHERE(GWORK(:))
#ifndef MNH_BITREP
ZHLC_LRCLOCAL(:)=(3.0 *ZRCRAUTC(:)**3 - 8.0 *ZRCRAUTC(:)**2 * ZHLC_RCMAX(:) &
......@@ -293,7 +312,8 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
#endif
ZHLC_HRCLOCAL(:)=(ZHLC_RCMAX(:) + 3.0*ZRCRAUTC(:))/4.0
END WHERE
ELSE IF(HSUBG_PR_PDF=='HLCISOTRIPDF') THEN
!ELSE IF(HSUBG_PR_PDF=='HLCISOTRIPDF') THEN
ELSE IF (IHSUBG_PR_PDF==4) THEN
GWORK2(:) = PRCT(:) <= ZRCRAUTC(:)*PCF(:)
WHERE(GWORK(:))
WHERE(GWORK2(:))
......@@ -443,3 +463,4 @@ END IF
!$acc end data
END SUBROUTINE ICE4_COMPUTE_PDF
......@@ -128,6 +128,8 @@ REAL, DIMENSION(:), allocatable :: ZUSW ! Undersaturation over water
REAL, DIMENSION(:), allocatable :: ZTHLT ! Liquid potential temperature
REAL, DIMENSION(:), allocatable :: ZMASK, ZMASK1, ZMASK2
LOGICAL :: GHSUBG_RR_EVAP ! temporary variable for OpenACC character limitation (Cray CCE)
!$acc data present(PCOMPUTE,PRHODREF,PLVFACT,PT,PPRES,PTHT, &
!$acc& PLBDAR,PLBDAR_RF,PKA,PDV,PCJ,PHLC_LCF,PHLC_HCF,PHLC_LRC,PHLC_HRC,PCF,PRF, &
!$acc& PRVT,PRCT,PRRT,PRCAUTR,PRCACCR,PRREVAV,PA_TH,PA_RV,PA_RC,PA_RR )
......@@ -340,12 +342,15 @@ IF (HSUBG_RR_EVAP=='NONE') THEN
!$acc end kernels
ELSEIF (HSUBG_RR_EVAP=='CLFR' .OR. HSUBG_RR_EVAP=='PRFR') THEN
GHSUBG_RR_EVAP=.false.
IF (HSUBG_RR_EVAP=='CLFR') GHSUBG_RR_EVAP=.true.
!$acc kernels
!Evaporation in clear sky part
!With CLFR, rain is diluted over the grid box
!With PRFR, rain is concentrated in its fraction
!Use temperature and humidity in clear sky part like Bechtold et al. (1993)
IF (HSUBG_RR_EVAP=='CLFR') THEN
!IF (HSUBG_RR_EVAP=='CLFR') THEN
IF (GHSUBG_RR_EVAP) THEN
ZZW4(:)=1. !Precipitation fraction
ZZW3(:)=PLBDAR(:)
ELSE
......@@ -435,3 +440,4 @@ END IF
!$acc end data
END SUBROUTINE ICE4_WARM
......@@ -520,6 +520,7 @@ REAL, DIMENSION(:), allocatable :: ZSSI
REAL, DIMENSION(:,:,:), allocatable :: &
&ZW_RVS, ZW_RCS, ZW_RRS, ZW_RIS, ZW_RSS, ZW_RGS, ZW_RHS, ZW_THS
!
LOGICAL :: GTEST ! temporary variable for OpenACC character limitation (Cray CCE)
!$acc data present( ODMICRO, PEXN, PDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR, &
!$acc & PHLC_HRC, PTHT, PRVT, &
......@@ -991,6 +992,8 @@ IMICRO=COUNTJV(ODMICRO(:,:,:), I1(:), I2(:), I3(:))
CALL COUNTJV_DEVICE(ODMICRO(:,:,:),I1(:),I2(:),I3(:),IMICRO)
#endif
!Packing
GTEST=.false.
IF(HSUBG_AUCV_RC=='PDF ' .AND. CSUBG_PR_PDF=='SIGM') GTEST=.true.
!$acc kernels
IF(IMICRO>0) THEN
DO JL=1, IMICRO
......@@ -1035,7 +1038,8 @@ IF(IMICRO>0) THEN
!The th tendency is not related to a mixing ratio change, there is no exn/exnref issue here
ENDDO
ENDIF
IF(HSUBG_AUCV_RC=='PDF ' .AND. CSUBG_PR_PDF=='SIGM') THEN
!IF(HSUBG_AUCV_RC=='PDF ' .AND. CSUBG_PR_PDF=='SIGM') THEN
IF (GTEST) THEN
DO JL=1, IMICRO
ZSIGMA_RC(JL) = PSIGS(I1(JL),I2(JL),I3(JL))*2.
ENDDO
......@@ -2414,3 +2418,4 @@ CONTAINS
!
END SUBROUTINE RAIN_ICE_RED
......@@ -92,6 +92,8 @@ REAL, DIMENSION(:), ALLOCATABLE :: ZZW4 ! Work array
!
INTEGER :: JLU
!
LOGICAL :: GCSUBG_RR_EVAP ! temporary variable for OpenCC character limitation (Cray CCE)
!
!-------------------------------------------------------------------------------
!
! IN variables
......@@ -312,12 +314,15 @@ ALLOCATE( ZZW4 (size(PRHODREF)) )
#ifdef MNH_OPENACC
CALL PRINT_MSG(NVERB_WARNING,'GEN','RAIN_ICE_WARM','OPENACC: CSUBG_RR_EVAP=="CLFR" or "PRFR" not yet tested')
#endif
GCSUBG_RR_EVAP=.false.
IF (CSUBG_RR_EVAP=='CLFR') GCSUBG_RR_EVAP=.true.
!$acc kernels
!Evaporation in clear sky part
!With CLFR, rain is diluted over the grid box
!With PRFR, rain is concentrated in its fraction
!Use temperature and humidity in clear sky part like Bechtold et al. (1993)
IF (CSUBG_RR_EVAP=='CLFR') THEN
!IF (CSUBG_RR_EVAP=='CLFR') THEN
IF (GCSUBG_RR_EVAP) THEN
ZZW4(:)=1. !Precipitation fraction
ZZW3(:)=PLBDAR(:)
ELSE
......@@ -409,3 +414,4 @@ END IF
END SUBROUTINE RAIN_ICE_WARM
END MODULE MODE_RAIN_ICE_WARM
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