Skip to content
Snippets Groups Projects
Commit d44560a7 authored by Juan Escobar's avatar Juan Escobar
Browse files

Maud:avoid negative values for SVS

parent 61f2dbd4
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,7 @@ END MODULE MODI_SHALLOW_MF_PACK
!! V.Masson 09/2010
!! Modification R. Honnert 07/2012 : introduction of vertical wind
!! for the height of the thermal
!! M. Leriche 02/2017 : avoid negative values for sv tendencies
!! --------------------------------------------------------------------------
!
!* 0. DECLARATIONS
......@@ -365,8 +366,8 @@ PRVS(:,:,:) = PRVS(:,:,:) +MYM( &
DO JSV=1,ISV
IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE
PRSVS(:,:,:,JSV) = PRSVS(:,:,:,JSV) + &
PRHODJ(:,:,:)*ZDSVDT(:,:,:,JSV)
PRSVS(:,:,:,JSV) = MAX((PRSVS(:,:,:,JSV) + &
PRHODJ(:,:,:)*ZDSVDT(:,:,:,JSV)),XSVMIN(JSV))
END DO
!!! 7. call to MesoNH budgets
......
......@@ -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