Skip to content
Snippets Groups Projects
Commit e8d84f06 authored by RODIER Quentin's avatar RODIER Quentin
Browse files

Quentin 26/09/2024: add kernels ice4_compute_pdf

parent 1f4b0019
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,7 @@ IF (LHOOK) CALL DR_HOOK('ICE4_COMPUTE_PDF', 0, ZHOOK_HANDLE)!
ZRCRAUTC(:)=ICEP%XCRIAUTC/PRHODREF(:) ! Autoconversion rc threshold
IF(HSUBG_AUCV_RC=='NONE') THEN
!Cloud water is entirely in low or high part
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
WHERE(PRCT(:)>ZRCRAUTC(:))
PHLC_HCF(:)=1.
......@@ -105,9 +106,10 @@ IF(HSUBG_AUCV_RC=='NONE') THEN
PHLC_LRC(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_AUCV_RC=='CLFR') THEN
!Cloud water is only in the cloudy part and entirely in low or high part
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
WHERE(PCF(:)>0. .AND. PRCT(:)>ZRCRAUTC(:)*PCF(:))
PHLC_HCF(:)=PCF(:)
......@@ -126,7 +128,9 @@ ELSEIF(HSUBG_AUCV_RC=='CLFR') THEN
PHLC_LRC(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_AUCV_RC=='ADJU') THEN
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
ZSUMRC(:)=PHLC_LRC(:)+PHLC_HRC(:)
WHERE(ZSUMRC(:) .GT. 0.)
......@@ -137,6 +141,7 @@ ELSEIF(HSUBG_AUCV_RC=='ADJU') THEN
PHLC_HRC(:)=0.
ENDWHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
!Cloud water is split between high and low part according to a PDF
! 'HLCRECTPDF' : rectangular PDF form
......@@ -146,6 +151,7 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
! 'SIGM' : Redelsperger and Sommeria (1986)
IF(HSUBG_PR_PDF=='SIGM') THEN
! Redelsperger and Sommeria (1986) but organised according to Turner (2011, 2012)
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
WHERE (PRCT(:)>ZRCRAUTC(:)+PSIGMA_RC(:))
PHLC_HCF(:)=1.
......@@ -172,6 +178,7 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
PHLC_LRC(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_PR_PDF=='HLCRECTPDF' .OR. HSUBG_PR_PDF=='HLCISOTRIPDF' .OR. &
&HSUBG_PR_PDF=='HLCTRIANGPDF' .OR. HSUBG_PR_PDF=='HLCQUADRAPDF') THEN
! Turner (2011, 2012)
......@@ -183,6 +190,7 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
ELSE IF(HSUBG_PR_PDF=='HLCQUADRAPDF') THEN
ZCOEFFRCM=4.
END IF
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
WHERE(PRCT(:).GT.0. .AND. PCF(:).GT.0.)
ZHLC_RCMAX(:)=ZCOEFFRCM*PRCT(:)/PCF(:)
......@@ -251,6 +259,7 @@ ELSEIF(HSUBG_AUCV_RC=='PDF ') THEN
PHLC_HRC(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSE
CALL PRINT_MSG(NVERB_FATAL,'GEN','ICE4_COMPUTE_PDF','wrong HSUBG_PR_PDF case')
ENDIF
......@@ -259,10 +268,13 @@ ELSE
ENDIF
!
!Ice water split between high and low content part is done according to autoconversion option
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
ZCRIAUTI(:)=MIN(ICEP%XCRIAUTI,10**(ICEP%XACRIAUTI*(PT(:)-CST%XTT)+ICEP%XBCRIAUTI)) ! Autoconversion ri threshold
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
IF(HSUBG_AUCV_RI=='NONE') THEN
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
!Cloud water is entirely in low or high part
WHERE(PRIT(:)>ZCRIAUTI(:))
......@@ -282,8 +294,10 @@ IF(HSUBG_AUCV_RI=='NONE') THEN
PHLI_LRI(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_AUCV_RI=='CLFR') THEN
!Cloud water is only in the cloudy part and entirely in low or high part
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
WHERE(PCF(:)>0. .AND. PRIT(:)>ZCRIAUTI(:)*PCF(:))
PHLI_HCF(:)=PCF(:)
......@@ -302,7 +316,9 @@ ELSEIF(HSUBG_AUCV_RI=='CLFR') THEN
PHLI_LRI(:)=0.
END WHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSEIF(HSUBG_AUCV_RI=='ADJU') THEN
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
ZSUMRI(:)=PHLI_LRI(:)+PHLI_HRI(:)
WHERE(ZSUMRI(:) .GT. 0.)
......@@ -313,11 +329,13 @@ ELSEIF(HSUBG_AUCV_RI=='ADJU') THEN
PHLI_HRI(:)=0.
ENDWHERE
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
ELSE
!wrong HSUBG_AUCV_RI case
CALL PRINT_MSG( NVERB_FATAL, 'GEN', 'ICE4_COMPUTE_PDF', 'wrong HSUBG_AUCV_RI case' )
ENDIF
!
!$acc kernels
!$mnh_expand_where(JI=1:KSIZE)
#ifdef REPRO48
PRF(:)=PHLC_HCF(:)
......@@ -325,6 +343,7 @@ ENDIF
PRF(:)=MAX(PHLC_HCF(:),PHLI_HCF(:))
#endif
!$mnh_end_expand_where(JI=1:KSIZE)
!$acc end kernels
!
IF (LHOOK) CALL DR_HOOK('ICE4_COMPUTE_PDF', 1, ZHOOK_HANDLE)
END SUBROUTINE ICE4_COMPUTE_PDF
......
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