From a068ce0067d0de769f5de2a6843657fecf952a80 Mon Sep 17 00:00:00 2001 From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr> Date: Tue, 30 Jun 2020 11:00:01 +0200 Subject: [PATCH] Philippe 30/06/2020: remove non-local corrections in resolved_cloud --- src/MNH/resolved_cloud.f90 | 65 +++++++++++++++++---------------- src/MNH/sources_neg_correct.f90 | 14 +++---- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/MNH/resolved_cloud.f90 b/src/MNH/resolved_cloud.f90 index 7b313bbb7..b32c0783c 100644 --- a/src/MNH/resolved_cloud.f90 +++ b/src/MNH/resolved_cloud.f90 @@ -275,6 +275,7 @@ END MODULE MODI_RESOLVED_CLOUD ! P. Wautelet + Benoit Vié 06/2020: improve removal of negative scalar variables + adapt the corresponding budgets ! P. Wautelet 23/06/2020: remove ZSVS and ZSVT to improve code readability ! P. Wautelet 30/06/2020: move removal of negative scalar variables to Sources_neg_correct +! P. Wautelet 30/06/2020: remove non-local corrections !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -576,38 +577,38 @@ ENDIF ! !* 3.1 Non local correction for precipitating species (Rood 87) ! -IF ( HCLOUD == 'KESS' & - .OR. HCLOUD == 'ICE3' .OR. HCLOUD == 'ICE4' & - .OR. HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' & - .OR. HCLOUD == 'KHKO' .OR. HCLOUD == 'LIMA' ) THEN -! - DO JRR = 3,KRR - SELECT CASE (JRR) - CASE(3,5,6,7) ! rain, snow, graupel and hail - - IF ( MIN_ll( PRS(:,:,:,JRR), IINFO_ll) < 0.0 ) THEN -! -! compute the total water mass computation -! - ZMASSTOT = MAX( 0. , SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) -! -! remove the negative values -! - PRS(:,:,:,JRR) = MAX( 0., PRS(:,:,:,JRR) ) -! -! compute the new total mass -! - ZMASSPOS = MAX(XMNH_TINY,SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) -! -! correct again in such a way to conserve the total mass -! - ZRATIO = ZMASSTOT / ZMASSPOS - PRS(:,:,:,JRR) = PRS(:,:,:,JRR) * ZRATIO -! - END IF - END SELECT - END DO -END IF +! IF ( HCLOUD == 'KESS' & +! .OR. HCLOUD == 'ICE3' .OR. HCLOUD == 'ICE4' & +! .OR. HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' & +! .OR. HCLOUD == 'KHKO' .OR. HCLOUD == 'LIMA' ) THEN +! ! +! DO JRR = 3,KRR +! SELECT CASE (JRR) +! CASE(3,5,6,7) ! rain, snow, graupel and hail +! +! IF ( MIN_ll( PRS(:,:,:,JRR), IINFO_ll) < 0.0 ) THEN +! ! +! ! compute the total water mass computation +! ! +! ZMASSTOT = MAX( 0. , SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) +! ! +! ! remove the negative values +! ! +! PRS(:,:,:,JRR) = MAX( 0., PRS(:,:,:,JRR) ) +! ! +! ! compute the new total mass +! ! +! ZMASSPOS = MAX(XMNH_TINY,SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) +! ! +! ! correct again in such a way to conserve the total mass +! ! +! ZRATIO = ZMASSTOT / ZMASSPOS +! PRS(:,:,:,JRR) = PRS(:,:,:,JRR) * ZRATIO +! ! +! END IF +! END SELECT +! END DO +! END IF ! !* 3.2 Adjustement for liquid and solid cloud ! diff --git a/src/MNH/sources_neg_correct.f90 b/src/MNH/sources_neg_correct.f90 index 234ea49fe..c0fc8062e 100644 --- a/src/MNH/sources_neg_correct.f90 +++ b/src/MNH/sources_neg_correct.f90 @@ -5,7 +5,7 @@ !----------------------------------------------------------------- ! Author: P. Wautelet 25/06/2020 (deduplication of code from advection_metsv, resolved_cloud and turb) ! Modifications: -! +! P. Wautelet 30/06/2020: remove non-local corrections in resolved_cloud for NEGA => new local corrections here !----------------------------------------------------------------- module mode_sources_neg_correct @@ -71,11 +71,7 @@ deallocate( zt ) CLOUD: select case ( hcloud ) case ( 'KESS' ) - if ( hbudname == 'NEGA' ) then - jrmax = 2 - else - jrmax = Size( prrs, 4 ) - end if + jrmax = Size( prrs, 4 ) do jr = 2, jrmax where ( prrs(:, :, :, jr) < 0. ) prrs(:, :, :, 1) = prrs(:, :, :, 1) + prrs(:, :, :, jr) @@ -94,7 +90,7 @@ CLOUD: select case ( hcloud ) case( 'ICE3', 'ICE4' ) - if ( hbudname == 'NETUR' .or. hbudname == 'NEGA' ) then + if ( hbudname == 'NETUR' ) then jrmax = 4 else jrmax = Size( prrs, 4 ) @@ -109,7 +105,7 @@ CLOUD: select case ( hcloud ) end do ! ! cloud - if ( hbudname == 'NETUR' .or. hbudname == 'NEGA' ) then + if ( hbudname == 'NETUR' ) then jrmax = 2 else jrmax = 3 @@ -203,7 +199,7 @@ CLOUD: select case ( hcloud ) prrs(:, :, :, 4) = 0. prsvs(:, :, :, nsv_lima_ni) = 0. end where - if ( hbudname /= 'NETUR' .and. hbudname /= 'NEGA' ) then + if ( hbudname /= 'NETUR' ) then do jr = 5, Size( prrs, 4 ) where ( prrs(:, :, :, jr) < 0. ) prrs(:, :, :, 1) = prrs(:, :, :, 1) + prrs(:, :, :, jr) -- GitLab