Skip to content
Snippets Groups Projects
Commit 9007e90d authored by Christine Lac's avatar Christine Lac
Browse files

Maud:avoid negative values for SVS

parent ba8704d6
No related branches found
No related tags found
No related merge requests found
......@@ -267,6 +267,9 @@ END MODULE MODI_TURB_VER_SV_FLUX
!! change of YCOMMENT
!! Feb 2012(Y. Seity) add possibility to run with reversed
!! vertical levels
!! Feb 2017(M. Leriche) add initialisation of ZSOURCE
!! to avoid unknwon values outside physical domain
!! and avoid negative values in sv tendencies
!!--------------------------------------------------------------------------
!
!* 0. DECLARATIONS
......@@ -277,7 +280,7 @@ USE MODD_CTURB
USE MODD_PARAMETERS
USE MODD_LES
USE MODD_CONF
USE MODD_NSV, ONLY : NSV_LGBEG,NSV_LGEND
USE MODD_NSV, ONLY : XSVMIN,NSV_LGBEG,NSV_LGEND
!
USE MODI_GRADIENT_U
USE MODI_GRADIENT_V
......@@ -397,6 +400,7 @@ DO JSV=1,ISV
ZA(:,:,:) = -PTSTEP*XCHF*PPSI_SV(:,:,:,JSV) * &
ZKEFF * MZM(KKA,KKU,KKL,PRHODJ) / &
PDZZ**2
ZSOURCE(:,:,:) = 0.
!
! Compute the sources for the JSVth scalar variable
......@@ -421,8 +425,8 @@ DO JSV=1,ISV
CALL TRIDIAG(KKA,KKU,KKL,PSVM(:,:,:,JSV),ZA,PTSTEP,PEXPL,PIMPL,PRHODJ,ZSOURCE,ZRES)
!
! Compute the equivalent tendency for the JSV scalar variable
PRSVS(:,:,:,JSV)= PRSVS(:,:,:,JSV)+ &
PRHODJ(:,:,:)*(ZRES(:,:,:)-PSVM(:,:,:,JSV))/PTSTEP
PRSVS(:,:,:,JSV)= MAX((PRSVS(:,:,:,JSV)+ &
PRHODJ(:,:,:)*(ZRES(:,:,:)-PSVM(:,:,:,JSV))/PTSTEP),XSVMIN(JSV))
!
IF ( (OTURB_FLX .AND. OCLOSE_OUT) .OR. LLES_CALL ) THEN
! Diagnostic of the cartesian vertical flux
......
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