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

Quentin 05/06/2024: add kernels for turb_hor_uv with pyft corrections of 05/06/2024

parent 3d6214d3
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,20 @@ REAL, DIMENSION(SIZE(PA,1),SIZE(PA,2),SIZE(PA,3)) :: PGY_U_UV ! result UV point ...@@ -36,7 +36,20 @@ REAL, DIMENSION(SIZE(PA,1),SIZE(PA,2),SIZE(PA,3)) :: PGY_U_UV ! result UV point
! !
END FUNCTION GY_U_UV END FUNCTION GY_U_UV
! !
! #ifdef MNH_OPENACC
!
!
SUBROUTINE GY_U_UV_DEVICE(PA,PDYY,PDZZ,PDZY,PGY_U_UV_DEVICE)
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at the U point
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY ! metric coefficient dyy
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! metric coefficient dzz
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZY ! metric coefficient dzy
!
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PGY_U_UV_DEVICE ! result UV point
!
END SUBROUTINE GY_U_UV_DEVICE
#endif
!
FUNCTION GZ_U_UW(PA,PDZZ, KKA, KKU, KL) RESULT(PGZ_U_UW) FUNCTION GZ_U_UW(PA,PDZZ, KKA, KKU, KL) RESULT(PGZ_U_UW)
! !
INTEGER, INTENT(IN),OPTIONAL :: KKA, KKU ! near ground and uppest atmosphere array indexes INTEGER, INTENT(IN),OPTIONAL :: KKA, KKU ! near ground and uppest atmosphere array indexes
...@@ -251,6 +264,104 @@ END IF ...@@ -251,6 +264,104 @@ END IF
END FUNCTION GY_U_UV END FUNCTION GY_U_UV
! !
! !
#ifdef MNH_OPENACC
! #########################################################
SUBROUTINE GY_U_UV_DEVICE(PA,PDYY,PDZZ,PDZY,PGY_U_UV_DEVICE)
! #########################################################
!
!* 0. DECLARATIONS
!
!
USE MODI_SHUMAN_DEVICE
USE MODD_CONF
!
USE MODE_MNH_ZWORK, ONLY: MNH_MEM_GET, MNH_MEM_POSITION_PIN, MNH_MEM_RELEASE
!
IMPLICIT NONE
!
!
!* 0.1 declarations of arguments and result
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at the U point
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY ! metric coefficient dyy
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! metric coefficient dzz
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZY ! metric coefficient dzy
!
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PGY_U_UV_DEVICE ! result UV point
!
!
!* 0.2 declaration of local variables
!
REAL, DIMENSION(:,:,:), pointer , contiguous :: ZTMP1_DEVICE, ZTMP2_DEVICE, ZTMP3_DEVICE
!
INTEGER :: JIU,JJU,JKU
INTEGER :: JI,JJ,JK
!
!----------------------------------------------------------------------------
!$acc data present( PA, PDYY, PDZZ, PDZY, PGY_U_UV_DEVICE )
JIU = size(pa, 1 )
JJU = size(pa, 2 )
JKU = size(pa, 3 )
!Pin positions in the pools of MNH memory
CALL MNH_MEM_POSITION_PIN( 'GY_U_UV' )
CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
CALL MNH_MEM_GET( ztmp3_device, JIU, JJU, JKU )
!$acc data present( ztmp1_device, ztmp2_device, ztmp3_device )
!
!* 1. DEFINITION of GY_U_UV_DEVICE
! ---------------------
!
IF (.NOT. LFLAT) THEN
CALL DZM_DEVICE( PA, ZTMP1_DEVICE )
CALL MXM_DEVICE(PDZZ,ZTMP2_DEVICE)
!$acc kernels
!$mnh_do_concurrent ( JI=1:JIU,JJ=1:JJU,JK=1:JKU)
ZTMP3_DEVICE(JI,JJ,JK) = ZTMP1_DEVICE(JI,JJ,JK)/ZTMP2_DEVICE(JI,JJ,JK)
!$mnh_end_do() !CONCURRENT
!$acc end kernels
CALL MYM_DEVICE(ZTMP3_DEVICE,ZTMP1_DEVICE)
CALL MXM_DEVICE(PDZY,ZTMP2_DEVICE)
!$acc kernels
!$mnh_do_concurrent ( JI=1:JIU,JJ=1:JJU,JK=1:JKU)
ZTMP3_DEVICE(JI,JJ,JK) = ZTMP1_DEVICE(JI,JJ,JK)*ZTMP2_DEVICE(JI,JJ,JK)
!$mnh_end_do() !CONCURRENT
!$acc end kernels
CALL MZF_DEVICE( ZTMP3_DEVICE, ZTMP2_DEVICE )
CALL DYM_DEVICE(PA,ZTMP1_DEVICE)
CALL MXM_DEVICE(PDYY,ZTMP3_DEVICE)
!$acc kernels
!$mnh_do_concurrent ( JI=1:JIU,JJ=1:JJU,JK=1:JKU)
PGY_U_UV_DEVICE(JI,JJ,JK)= ( ZTMP1_DEVICE(JI,JJ,JK) - ZTMP2_DEVICE(JI,JJ,JK) ) / ZTMP3_DEVICE(JI,JJ,JK)
!$mnh_end_do() !CONCURRENT
!$acc end kernels
ELSE
CALL DYM_DEVICE(PA,ZTMP1_DEVICE)
CALL MXM_DEVICE(PDYY,ZTMP2_DEVICE)
!$acc kernels
PGY_U_UV_DEVICE(:,:,:)= ZTMP1_DEVICE(:,:,:) / ZTMP2_DEVICE(:,:,:)
!$acc end kernels
END IF
!$acc end data
!Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
CALL MNH_MEM_RELEASE( 'GY_U_UV' )
!$acc end data
!----------------------------------------------------------------------------
!
END SUBROUTINE GY_U_UV_DEVICE
!
#endif
!
! ####################################################### ! #######################################################
FUNCTION GZ_U_UW(PA,PDZZ, KKA, KKU, KL) RESULT(PGZ_U_UW) FUNCTION GZ_U_UW(PA,PDZZ, KKA, KKU, KL) RESULT(PGZ_U_UW)
! ####################################################### ! #######################################################
......
...@@ -312,7 +312,7 @@ REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS ...@@ -312,7 +312,7 @@ REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS
! !
!* 12. < U'V'> !* 12. < U'V'>
! !
CALL TURB_HOR_UV(TURBN,TLES,KSPLT,OFLAT,O2D, & CALL TURB_HOR_UV(D,TURBN,TLES,KSPLT,OFLAT,O2D, &
TPFILE, & TPFILE, &
PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, &
PDXX,PDYY,PDZZ,PDZX,PDZY, & PDXX,PDYY,PDZZ,PDZX,PDZY, &
......
...@@ -7,7 +7,7 @@ MODULE MODE_TURB_HOR_UV ...@@ -7,7 +7,7 @@ MODULE MODE_TURB_HOR_UV
IMPLICIT NONE IMPLICIT NONE
CONTAINS CONTAINS
! ################################################################ ! ################################################################
SUBROUTINE TURB_HOR_UV(TURBN,TLES,KSPLT,OFLAT,O2D, & SUBROUTINE TURB_HOR_UV(D, TURBN,TLES,KSPLT,OFLAT,O2D, &
TPFILE, & TPFILE, &
PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, & PK,PINV_PDXX,PINV_PDYY,PINV_PDZZ,PMZM_PRHODJ, &
PDXX,PDYY,PDZZ,PDZX,PDZY, & PDXX,PDYY,PDZZ,PDZX,PDZY, &
...@@ -59,6 +59,7 @@ CONTAINS ...@@ -59,6 +59,7 @@ CONTAINS
! ------------ ! ------------
! !
USE MODD_TURB_n, ONLY: TURB_t USE MODD_TURB_n, ONLY: TURB_t
USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t
! !
USE MODD_CST USE MODD_CST
USE MODD_CTURB USE MODD_CTURB
...@@ -74,6 +75,7 @@ USE MODI_GRADIENT_U ...@@ -74,6 +75,7 @@ USE MODI_GRADIENT_U
USE MODI_GRADIENT_V USE MODI_GRADIENT_V
USE MODI_GRADIENT_W USE MODI_GRADIENT_W
USE MODI_SHUMAN USE MODI_SHUMAN
USE MODE_SHUMAN_PHY
USE MODE_COEFJ, ONLY: COEFJ USE MODE_COEFJ, ONLY: COEFJ
USE MODI_LES_MEAN_SUBGRID USE MODI_LES_MEAN_SUBGRID
! !
...@@ -86,64 +88,63 @@ IMPLICIT NONE ...@@ -86,64 +88,63 @@ IMPLICIT NONE
! !
! !
! !
TYPE(DIMPHYEX_t), INTENT(IN) :: D
TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(TURB_t), INTENT(IN) :: TURBN
TYPE(TLES_t), INTENT(INOUT) :: TLES ! modd_les structure TYPE(TLES_t), INTENT(INOUT) :: TLES ! modd_les structure
INTEGER, INTENT(IN) :: KSPLT ! split process index INTEGER, INTENT(IN) :: KSPLT ! split process index
TYPE(TFILEDATA), INTENT(INOUT) :: TPFILE ! Output file TYPE(TFILEDATA), INTENT(INOUT) :: TPFILE ! Output file
LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero ororography LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero ororography
LOGICAL, INTENT(IN) :: O2D ! Logical for 2D model version (modd_conf) LOGICAL, INTENT(IN) :: O2D ! Logical for 2D model version (modd_conf)
! !
REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef. REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PK ! Turbulent diffusion doef.
! PK = PLM * SQRT(PTKEM) ! PK = PLM * SQRT(PTKEM)
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PINV_PDXX ! 1./PDXX
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PINV_PDYY ! 1./PDYY
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ
REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ) REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ)
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY
! Metric coefficients ! Metric coefficients
REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSZW REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PDIRCOSZW
! Director Cosinus along z directions at surface w-point ! Director Cosinus along z directions at surface w-point
REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle
! between i and the slope vector ! between i and the slope vector
REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PSINSLOPE ! sinus of the angle
! between i and the slope vector ! between i and the slope vector
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PRHODJ ! density * grid volume
! !
REAL, DIMENSION(:,:), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t
REAL, DIMENSION(:,:), INTENT(IN) :: PTAU11M ! <uu> in the axes linked REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PTAU11M ! <uu> in the axes linked
! to the maximum slope direction and the surface normal and the binormal ! to the maximum slope direction and the surface normal and the binormal
! at time t - dt ! at time t - dt
REAL, DIMENSION(:,:), INTENT(IN) :: PTAU12M ! <uv> in the same axes REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PTAU12M ! <uv> in the same axes
REAL, DIMENSION(:,:), INTENT(IN) :: PTAU22M ! <vv> in the same axes REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PTAU22M ! <vv> in the same axes
REAL, DIMENSION(:,:), INTENT(IN) :: PTAU33M ! <ww> in the same axes REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PTAU33M ! <ww> in the same axes
! !
! Variables at t-1 ! Variables at t-1
REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(IN) :: PUM,PVM
REAL, DIMENSION(:,:), INTENT(IN) :: PUSLOPEM ! wind component along the REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PUSLOPEM ! wind component along the
! maximum slope direction ! maximum slope direction
REAL, DIMENSION(:,:), INTENT(IN) :: PVSLOPEM ! wind component along the REAL, DIMENSION(D%NIT,D%NJT), INTENT(IN) :: PVSLOPEM ! wind component along the
! direction normal to the maximum slope one ! direction normal to the maximum slope one
! !
! !
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS ! var. at t+1 -split- REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(INOUT) :: PRUS, PRVS ! var. at t+1 -split-
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDP ! TKE production terms REAL, DIMENSION(D%NIT,D%NJT,D%NKT), INTENT(INOUT) :: PDP ! TKE production terms
! !
! !
! !
!* 0.2 declaration of local variables !* 0.2 declaration of local variables
! !
REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) & REAL, DIMENSION(D%NIT,D%NJT,D%NKT) :: ZFLX,ZWORK ! work arrays
:: ZFLX,ZWORK
! work arrays
! !
REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2)) ::ZDIRSINZW REAL, DIMENSION(D%NIT,D%NJT) :: ZDIRSINZW
! sinus of the angle between the vertical and the normal to the orography ! sinus of the angle between the vertical and the normal to the orography
INTEGER :: IKB,IKE INTEGER :: IKB,IKE,IIT,IJT,IKT, JI,JJ,JK
! Index values for the Beginning and End ! Index values for the Beginning and End
! mass points of the domain ! mass points of the domain
! !
REAL, DIMENSION(SIZE(PUM,1),SIZE(PUM,2),SIZE(PUM,3)) :: GY_U_UV_PUM REAL, DIMENSION(D%NIT,D%NJT,D%NKT) :: GY_U_UV_PUM
REAL, DIMENSION(SIZE(PVM,1),SIZE(PVM,2),SIZE(PVM,3)) :: GX_V_UV_PVM REAL, DIMENSION(D%NIT,D%NJT,D%NKT) :: GX_V_UV_PVM
! !
REAL :: ZTIME1, ZTIME2 REAL :: ZTIME1, ZTIME2
TYPE(TFIELDMETADATA) :: TZFIELD TYPE(TFIELDMETADATA) :: TZFIELD
...@@ -153,9 +154,16 @@ TYPE(TFIELDMETADATA) :: TZFIELD ...@@ -153,9 +154,16 @@ TYPE(TFIELDMETADATA) :: TZFIELD
! ------------------------ ! ------------------------
! !
IKB = 1+JPVEXT IKB = 1+JPVEXT
IKE = SIZE(PUM,3)-JPVEXT IKE = SIZE(PUM,3)-JPVEXT
IIT=D%NIT
IJT=D%NJT
IKT=D%NKT
! !
!$acc kernels
!$mnh_expand_array(JI=1:IIT,JJ=1:IJT)
ZDIRSINZW(:,:) = SQRT( 1. - PDIRCOSZW(:,:)**2 ) ZDIRSINZW(:,:) = SQRT( 1. - PDIRCOSZW(:,:)**2 )
!$mnh_end_expand_array(JI=1:IIT,JJ=1:IJT)
!$acc end kernels
! !
GX_V_UV_PVM = GX_V_UV(PVM,PDXX,PDZZ,PDZX) GX_V_UV_PVM = GX_V_UV(PVM,PDXX,PDZZ,PDZX)
IF (.NOT. O2D) GY_U_UV_PUM = GY_U_UV(PUM,PDYY,PDZZ,PDZY) IF (.NOT. O2D) GY_U_UV_PUM = GY_U_UV(PUM,PDYY,PDZZ,PDZY)
...@@ -173,24 +181,30 @@ ELSE ...@@ -173,24 +181,30 @@ ELSE
(GX_V_UV_PVM) (GX_V_UV_PVM)
END IF END IF
! !
!$acc kernels
!$mnh_expand_array(JI=1:IIT,JJ=1:IJT)
ZFLX(:,:,IKE+1)= ZFLX(:,:,IKE) ZFLX(:,:,IKE+1)= ZFLX(:,:,IKE)
!$mnh_end_expand_array(JI=1:IIT,JJ=1:IJT)
!$acc end kernels
! !
! !
! Compute the correlation at the first physical level with the following ! Compute the correlation at the first physical level with the following
! hypothesis du/dz vary in 1/z and w=0 at the ground ! hypothesis du/dz vary in 1/z and w=0 at the ground
ZFLX(:,:,IKB:IKB) = - XCMFS * MYM(MXM(PK(:,:,IKB:IKB))) * ( & ZFLX(:,:,IKB) = - XCMFS * MYM(MXM(PK(:,:,IKB))) * ( &
( DYM( PUM(:,:,IKB:IKB) ) & ( DYM( PUM(:,:,IKB) ) &
-MYM( (PUM(:,:,IKB+1:IKB+1)-PUM(:,:,IKB:IKB)) & -MYM( (PUM(:,:,IKB+1)-PUM(:,:,IKB)) &
*(1./MXM(PDZZ(:,:,IKB+1:IKB+1))+1./MXM(PDZZ(:,:,IKB:IKB))))& *(1./MXM(PDZZ(:,:,IKB+1))+1./MXM(PDZZ(:,:,IKB))))&
*0.5*MXM((PDZY(:,:,IKB+1:IKB+1)+PDZY(:,:,IKB:IKB))) & *0.5*MXM((PDZY(:,:,IKB+1)+PDZY(:,:,IKB))) &
) / MXM(PDYY(:,:,IKB:IKB)) & ) / MXM(PDYY(:,:,IKB)) &
+( DXM( PVM(:,:,IKB:IKB) ) & +( DXM( PVM(:,:,IKB) ) &
-MXM( (PVM(:,:,IKB+1:IKB+1)-PVM(:,:,IKB:IKB)) & -MXM( (PVM(:,:,IKB+1)-PVM(:,:,IKB)) &
*(1./MYM(PDZZ(:,:,IKB+1:IKB+1))+1./MYM(PDZZ(:,:,IKB:IKB))))& *(1./MYM(PDZZ(:,:,IKB+1))+1./MYM(PDZZ(:,:,IKB))))&
*0.5*MYM((PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB))) & *0.5*MYM((PDZX(:,:,IKB+1)+PDZX(:,:,IKB))) &
) / MYM(PDXX(:,:,IKB:IKB)) ) ) / MYM(PDXX(:,:,IKB)) )
! !
! extrapolates this flux under the ground with the surface flux ! extrapolates this flux under the ground with the surface flux
!$acc kernels present_cr(ZFLX,ZDIRSINZW)
!$mnh_expand_array(JI=1:IIT,JJ=1:IJT)
ZFLX(:,:,IKB-1) = & ZFLX(:,:,IKB-1) = &
PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:)**2 & PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:)**2 &
+PTAU12M(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * & +PTAU12M(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * &
...@@ -202,9 +216,12 @@ ZFLX(:,:,IKB-1) = & ...@@ -202,9 +216,12 @@ ZFLX(:,:,IKB-1) = &
PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & PDIRCOSZW(:,:) * ZDIRSINZW(:,:) &
+PVSLOPEM(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * ZDIRSINZW(:,:) & +PVSLOPEM(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * ZDIRSINZW(:,:) &
) )
! !
ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( MYM( ZFLX(:,:,IKB-1:IKB-1) ) ) & !$mnh_end_expand_array(JI=1:IIT,JJ=1:IJT)
- ZFLX(:,:,IKB:IKB) !$acc end kernels
!
ZFLX(:,:,IKB-1) = 2. * MXM( MYM( ZFLX(:,:,IKB-1) ) ) &
- ZFLX(:,:,IKB)
! !
! stores <U V> ! stores <U V>
IF ( TPFILE%LOPENED .AND. TURBN%LTURB_FLX ) THEN IF ( TPFILE%LOPENED .AND. TURBN%LTURB_FLX ) THEN
...@@ -219,6 +236,7 @@ IF ( TPFILE%LOPENED .AND. TURBN%LTURB_FLX ) THEN ...@@ -219,6 +236,7 @@ IF ( TPFILE%LOPENED .AND. TURBN%LTURB_FLX ) THEN
NTYPE = TYPEREAL, & NTYPE = TYPEREAL, &
NDIMS = 3, & NDIMS = 3, &
LTIMEDEP = .TRUE. ) LTIMEDEP = .TRUE. )
!$acc update self(ZFLX)
CALL IO_FIELD_WRITE(TPFILE,TZFIELD,ZFLX) CALL IO_FIELD_WRITE(TPFILE,TZFIELD,ZFLX)
END IF END IF
! !
...@@ -258,24 +276,28 @@ IF (KSPLT==1) THEN ...@@ -258,24 +276,28 @@ IF (KSPLT==1) THEN
! !
! evaluate the dynamic production at w(IKB+1) in PDP(IKB) ! evaluate the dynamic production at w(IKB+1) in PDP(IKB)
! !
ZWORK(:,:,IKB:IKB) = - & ZWORK(:,:,IKB) = - &
MXF ( MYF( 0.5 * (ZFLX(:,:,IKB+1:IKB+1)+ZFLX(:,:,IKB:IKB)) ) ) & MXF ( MYF( 0.5 * (ZFLX(:,:,IKB+1)+ZFLX(:,:,IKB)) ) ) &
*(MXF ( MYF( & *(MXF ( MYF( &
DYM( 0.5 * (PUM(:,:,IKB+1:IKB+1)+PUM(:,:,IKB:IKB)) ) & DYM( 0.5 * (PUM(:,:,IKB+1)+PUM(:,:,IKB)) ) &
/ MXM( 0.5*(PDYY(:,:,IKB:IKB)+PDYY(:,:,IKB+1:IKB+1)) ) & / MXM( 0.5*(PDYY(:,:,IKB)+PDYY(:,:,IKB+1)) ) &
+DXM( 0.5 * (PVM(:,:,IKB+1:IKB+1)+PVM(:,:,IKB:IKB)) ) & +DXM( 0.5 * (PVM(:,:,IKB+1)+PVM(:,:,IKB)) ) &
/ MYM( 0.5*(PDXX(:,:,IKB:IKB)+PDXX(:,:,IKB+1:IKB+1)) ) & / MYM( 0.5*(PDXX(:,:,IKB)+PDXX(:,:,IKB+1)) ) &
) ) & ) ) &
-MXF( (PUM(:,:,IKB+1:IKB+1)-PUM(:,:,IKB:IKB)) / & -MXF( (PUM(:,:,IKB+1)-PUM(:,:,IKB)) / &
MXM(PDZZ(:,:,IKB+1:IKB+1)) * PDZY(:,:,IKB+1:IKB+1) & MXM(PDZZ(:,:,IKB+1)) * PDZY(:,:,IKB+1) &
) / MYF(MXM( 0.5*(PDYY(:,:,IKB:IKB)+PDYY(:,:,IKB+1:IKB+1)) ) )& ) / MYF(MXM( 0.5*(PDYY(:,:,IKB)+PDYY(:,:,IKB+1)) ) )&
-MYF( (PVM(:,:,IKB+1:IKB+1)-PVM(:,:,IKB:IKB)) / & -MYF( (PVM(:,:,IKB+1)-PVM(:,:,IKB)) / &
MYM(PDZZ(:,:,IKB+1:IKB+1)) * PDZX(:,:,IKB+1:IKB+1) & MYM(PDZZ(:,:,IKB+1)) * PDZX(:,:,IKB+1) &
) / MXF(MYM( 0.5*(PDXX(:,:,IKB:IKB)+PDXX(:,:,IKB+1:IKB+1)) ) )& ) / MXF(MYM( 0.5*(PDXX(:,:,IKB)+PDXX(:,:,IKB+1)) ) )&
) )
! !
! dynamic production ! dynamic production
!$acc kernels present_cr(PDP)
!$mnh_expand_array(JI=1:IIT,JJ=1:IJT,JK=1:IKT)
PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:) PDP(:,:,:) = PDP(:,:,:) + ZWORK(:,:,:)
!$mnh_end_expand_array(JI=1:IIT,JJ=1:IJT,JK=1:IKT)
!$acc end kernels
! !
END IF END IF
! !
......
...@@ -340,6 +340,6 @@ PHYEX_OPTDEFAULT = --addMPPDB_CHECKS --addStack MESONH --stopScopes toto --mathF ...@@ -340,6 +340,6 @@ PHYEX_OPTDEFAULT = --addMPPDB_CHECKS --addStack MESONH --stopScopes toto --mathF
PHYEX_LIST = $(notdir $(shell find PHYEX/micro PHYEX/turb -follow -type f -name "*.f*" -not -name "minpack.f90" | sed -e 's/\(.*\)\(\.\).*/\1.D/g' )) PHYEX_LIST = $(notdir $(shell find PHYEX/micro PHYEX/turb -follow -type f -name "*.f*" -not -name "minpack.f90" | sed -e 's/\(.*\)\(\.\).*/\1.D/g' ))
$(PHYEX_LIST) : PYFT = pyft_tool.py $(PHYEX_OPTDEFAULT) $(PHYEX_LIST) : PYFT = pyft_tool.py $(PHYEX_OPTDEFAULT)
PHYEX_SHUMAN = mode_tke_eps_sources.D mode_turb_ver_thermo_flux.D mode_turb_ver_thermo_corr.D mode_turb_ver_dyn_flux.D mode_turb_hor_splt.D mode_turb_ver_sv_corr.D mode_turb_ver_sv_flux.D mode_turb_hor_thermo_flux.D mode_turb_hor_thermo_corr.D PHYEX_SHUMAN = mode_tke_eps_sources.D mode_turb_ver_thermo_flux.D mode_turb_ver_thermo_corr.D mode_turb_ver_dyn_flux.D mode_turb_hor_splt.D mode_turb_ver_sv_corr.D mode_turb_ver_sv_flux.D mode_turb_hor_thermo_flux.D mode_turb_hor_thermo_corr.D mode_turb_hor_uv.D
$(PHYEX_SHUMAN) : PYFT = pyft_tool.py --shumanFUNCtoCALL --expandAllArraysConcurrent $(PHYEX_OPTDEFAULT) $(PHYEX_SHUMAN) : PYFT = pyft_tool.py --shumanFUNCtoCALL --expandAllArraysConcurrent $(PHYEX_OPTDEFAULT)
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