diff --git a/src/MNH/shallow_mf_pack.f90 b/src/MNH/shallow_mf_pack.f90 index 421a54d6b3598337e2c498090c7bedbd62f2d385..a91a1d9722befa1e1af18c90a00d0707c8783ca8 100644 --- a/src/MNH/shallow_mf_pack.f90 +++ b/src/MNH/shallow_mf_pack.f90 @@ -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 diff --git a/src/MNH/turb_ver_sv_flux.f90 b/src/MNH/turb_ver_sv_flux.f90 index c3ec5d032a87c555859d442c25e112aae11d74f0..35aef367a7328d33656d5d733539d57819e2a331 100644 --- a/src/MNH/turb_ver_sv_flux.f90 +++ b/src/MNH/turb_ver_sv_flux.f90 @@ -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