From 0ecf071a39fe7958bd3f5a74083c261155e30dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Vi=C3=A9?= <benoit.vie@meteo.fr> Date: Tue, 22 Feb 2022 13:26:16 +0100 Subject: [PATCH] Add ICEFR and RAINFR in lima_adjust and lima_notadjust --- src/MNH/lima_adjust.f90 | 44 +++++++++++++++++++++++++------------- src/MNH/lima_notadjust.f90 | 25 ++++++++++++++++++++-- src/MNH/resolved_cloud.f90 | 4 ++-- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/MNH/lima_adjust.f90 b/src/MNH/lima_adjust.f90 index 31ea1fefa..410c9a920 100644 --- a/src/MNH/lima_adjust.f90 +++ b/src/MNH/lima_adjust.f90 @@ -9,12 +9,12 @@ ! INTERFACE ! - SUBROUTINE LIMA_ADJUST(KRR, KMI, TPFILE, & - OSUBG_COND, PTSTEP, & - PRHODREF, PRHODJ, PEXNREF, PPABSM, & - PPABST, & - PRT, PRS, PSVT, PSVS, & - PTHS, PSRCS, PCLDFR ) + SUBROUTINE LIMA_ADJUST(KRR, KMI, TPFILE, & + OSUBG_COND, PTSTEP, & + PRHODREF, PRHODJ, PEXNREF, PPABSM, & + PPABST, & + PRT, PRS, PSVT, PSVS, & + PTHS, PSRCS, PCLDFR, PICEFR, PRAINFR ) ! USE MODD_IO, ONLY: TFILEDATA USE MODD_NSV, only: NSV_LIMA_BEG @@ -47,6 +47,8 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux ! s'rc'/2Sigma_s2 at time t+1 ! multiplied by Lambda_3 REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRAINFR ! Cloud fraction ! END SUBROUTINE LIMA_ADJUST ! @@ -54,14 +56,14 @@ END INTERFACE ! END MODULE MODI_LIMA_ADJUST ! -! ########################################################### - SUBROUTINE LIMA_ADJUST(KRR, KMI, TPFILE, & - OSUBG_COND, PTSTEP, & - PRHODREF, PRHODJ, PEXNREF, PPABSM, & - PPABST, & - PRT, PRS, PSVT, PSVS, & - PTHS, PSRCS, PCLDFR ) -! ########################################################### +! ############################################################# + SUBROUTINE LIMA_ADJUST(KRR, KMI, TPFILE, & + OSUBG_COND, PTSTEP, & + PRHODREF, PRHODJ, PEXNREF, PPABSM, & + PPABST, & + PRT, PRS, PSVT, PSVS, & + PTHS, PSRCS, PCLDFR, PICEFR, PRAINFR ) +! ############################################################# ! !!**** *MIMA_ADJUST* - compute the fast microphysical sources !! @@ -202,6 +204,8 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux ! s'rc'/2Sigma_s2 at time t+1 ! multiplied by Lambda_3 REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRAINFR ! Cloud fraction ! ! !* 0.2 Declarations of local variables : @@ -1171,11 +1175,21 @@ END DO !* 5.2 compute the cloud fraction PCLDFR (binary !!!!!!!) ! IF ( .NOT. OSUBG_COND ) THEN - WHERE (PRCS(:,:,:) + PRIS(:,:,:) + PRSS(:,:,:) > 1.E-12 / ZDT) + WHERE (PRCS(:,:,:) + PRIS(:,:,:) + PRSS(:,:,:) > 1.E-12 / ZDT) PCLDFR(:,:,:) = 1. ELSEWHERE PCLDFR(:,:,:) = 0. ENDWHERE + WHERE (PRIS(:,:,:) > 1.E-12 / ZDT) + PICEFR(:,:,:) = 1. + ELSEWHERE + PICEFR(:,:,:) = 0. + ENDWHERE + WHERE (PRRS(:,:,:)+PRSS(:,:,:)+PRGS(:,:,:) > 1.E-12 / ZDT) + PRAINFR(:,:,:) = 1. + ELSEWHERE + PRAINFR(:,:,:) = 0. + ENDWHERE END IF ! IF ( SIZE(PSRCS,3) /= 0 ) THEN diff --git a/src/MNH/lima_notadjust.f90 b/src/MNH/lima_notadjust.f90 index 94ea1f4fd..38853c897 100644 --- a/src/MNH/lima_notadjust.f90 +++ b/src/MNH/lima_notadjust.f90 @@ -11,7 +11,7 @@ INTERFACE ! SUBROUTINE LIMA_NOTADJUST(KMI, TPFILE, HRAD, & PTSTEP, PRHODJ, PPABSM, PPABST, PRHODREF, PEXNREF, PZZ, & - PTHT,PRT, PSVT, PTHS, PRS,PSVS, PCLDFR, PSRCS ) + PTHT,PRT, PSVT, PTHS, PRS,PSVS, PCLDFR, PICEFR, PRAINFR, PSRCS ) ! USE MODD_IO, ONLY: TFILEDATA ! @@ -38,6 +38,8 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux ! s'rc'/2Sigma_s2 at time t+1 ! multiplied by Lambda_3 REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRAINFR ! Cloud fraction ! ! END SUBROUTINE LIMA_NOTADJUST @@ -49,7 +51,7 @@ END MODULE MODI_LIMA_NOTADJUST ! #################################################################################### SUBROUTINE LIMA_NOTADJUST(KMI, TPFILE, HRAD, & PTSTEP, PRHODJ, PPABSM, PPABST, PRHODREF, PEXNREF, PZZ, & - PTHT,PRT, PSVT, PTHS, PRS,PSVS, PCLDFR, PSRCS ) + PTHT,PRT, PSVT, PTHS, PRS,PSVS, PCLDFR, PICEFR, PRAINFR, PSRCS ) ! #################################################################################### ! !!**** * - compute pseudo-prognostic of supersaturation according to Thouron @@ -126,6 +128,8 @@ REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux ! s'rc'/2Sigma_s2 at time t+1 ! multiplied by Lambda_3 REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRAINFR ! Cloud fraction ! ! !* 0.2 Declarations of local variables : @@ -564,6 +568,23 @@ IF ( HRAD /= 'NONE' ) THEN PCLDFR(:,:,:) = ZW1(:,:,:) END IF ! +ZW1(:,:,:)=0. +IF (SIZE(PRS,4)>3) ZW1(:,:,:)=ZW1(:,:,:) + PRS(:,:,:,4) +WHERE (ZW1(:,:,:) > 1.E-15) + PICEFR(:,:,:) = 1. +ELSEWHERE + PICEFR(:,:,:) = 0. +ENDWHERE +ZW1(:,:,:)=0. +IF (SIZE(PRS,4)>2) ZW1(:,:,:)=ZW1(:,:,:) + PRS(:,:,:,3) +IF (SIZE(PRS,4)>4) ZW1(:,:,:)=ZW1(:,:,:) + PRS(:,:,:,5) +IF (SIZE(PRS,4)>5) ZW1(:,:,:)=ZW1(:,:,:) + PRS(:,:,:,6) +WHERE (ZW1(:,:,:) > 1.E-15) + PRAINFR(:,:,:) = 1. +ELSEWHERE + PRAINFR(:,:,:) = 0. +ENDWHERE +! IF ( tpfile%lopened ) THEN ZW(:,:,:)=SUM(ZNAS,4)-ZW(:,:,:) TZFIELD%CMNHNAME = 'NACT' diff --git a/src/MNH/resolved_cloud.f90 b/src/MNH/resolved_cloud.f90 index 5df6f9fa3..fb1ed3779 100644 --- a/src/MNH/resolved_cloud.f90 +++ b/src/MNH/resolved_cloud.f90 @@ -972,7 +972,7 @@ SELECT CASE ( HCLOUD ) PTSTEP, PRHODJ, PPABSM, PPABST, PRHODREF, PEXNREF, PZZ, & PTHT,PRT, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & PTHS,PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & - PCLDFR, PSRCS ) + PCLDFR, PICEFR, PRAINFR, PSRCS ) ELSE IF (LPTSPLIT) THEN CALL LIMA_ADJUST_SPLIT(KRR, KMI, TPFILE, CCONDENS, CLAMBDA3, & OSUBG_COND, OSIGMAS, PTSTEP, PSIGQSAT, & @@ -987,7 +987,7 @@ SELECT CASE ( HCLOUD ) PRHODREF, PRHODJ, PEXNREF, PPABST, PPABST, & PRT, PRS, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & - PTHS, PSRCS, PCLDFR ) + PTHS, PSRCS, PCLDFR, PICEFR, PRAINFR ) ENDIF ! END SELECT -- GitLab