diff --git a/src/MNH/ini_lima_warm.f90 b/src/MNH/ini_lima_warm.f90 index 2f92fad58936446b355d6d780f79fc2647953d37..aea2517cab9d168a998aa6785bd35693674050d9 100644 --- a/src/MNH/ini_lima_warm.f90 +++ b/src/MNH/ini_lima_warm.f90 @@ -164,9 +164,9 @@ XLBC = XAR*ZGAMC(2) XLBEXC = 1.0/XBC ! XNR = 1.0/(XAR*MOMG(XALPHAR,XNUR,XBR)) +XCCR = 8.E6 +XCXR = -1. IF (NMOM_R.EQ.1) THEN - XCCR = 8.E6 - XCXR = -1. XLBEXR = 1.0/(XCXR-XBR) XLBR = ( XAR*XCCR*MOMG(XALPHAR,XNUR,XBR) )**(-XLBEXR) ELSE diff --git a/src/MNH/lima_cold.f90 b/src/MNH/lima_cold.f90 index 1dc71a103a347f167fc92949c56f3b2e175a0ef8..431f44e88aded8270bf7318da1cecb75568a525e 100644 --- a/src/MNH/lima_cold.f90 +++ b/src/MNH/lima_cold.f90 @@ -341,20 +341,12 @@ if ( lbu_enable ) then if (NMOM_H.GE.2) call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nh), 'SEDI', pchs(:, :, :) * prhodj(:, :, :) ) end if -if (NMOM_S.GE.2 .AND. NMOM_G.GE.2 .AND. NMOM_H.GE.2) then - CALL LIMA_COLD_SEDIMENTATION (OSEDI, KSPLITG, PTSTEP, KMI, & - PZZ, PRHODJ, PRHODREF, & - PRIT, PCIT, & - PRIS, PRSS, PRGS, PRHS, PCIS, & - PINPRS, PINPRG, PINPRH, & - PCSS=PCSS, PCGS=PCGS, PCHS=PCHS ) -else - CALL LIMA_COLD_SEDIMENTATION (OSEDI, KSPLITG, PTSTEP, KMI, & - PZZ, PRHODJ, PRHODREF, & - PRIT, PCIT, & - PRIS, PRSS, PRGS, PRHS, PCIS, & - PINPRS, PINPRG, PINPRH) -end if +CALL LIMA_COLD_SEDIMENTATION (OSEDI, KSPLITG, PTSTEP, KMI, & + PZZ, PRHODJ, PRHODREF, & + PRIT, PCIT, & + PRIS, PRSS, PRGS, PRHS, PCIS, & + PINPRS, PINPRG, PINPRH, & + PCSS=PCSS, PCGS=PCGS, PCHS=PCHS ) if ( lbu_enable ) then if ( lbudget_ri .and. osedi ) call Budget_store_end( tbudgets(NBUDGET_RI), 'SEDI', pris(:, :, :) * prhodj(:, :, :) ) if ( lbudget_rs .and. lsnow ) call Budget_store_end( tbudgets(NBUDGET_RS), 'SEDI', prss(:, :, :) * prhodj(:, :, :) ) diff --git a/src/MNH/lima_cold_sedimentation.f90 b/src/MNH/lima_cold_sedimentation.f90 index 18132ec16944fe1b1111ce3c9cd02c2d354cedc6..13e80b57c456b0e61d9a3146a8f3c9fe1b75609e 100644 --- a/src/MNH/lima_cold_sedimentation.f90 +++ b/src/MNH/lima_cold_sedimentation.f90 @@ -306,47 +306,47 @@ END IF IF( MAXVAL(PRSS(:,:,:))>XRTMIN(5) ) THEN ALLOCATE(ZRSS(ISEDIM)) IF(NMOM_S.GE.2) THEN - ALLOCATE(ZCSS(ISEDIM)) - ALLOCATE(ZLBDAS(ISEDIM)) + ALLOCATE(ZCSS(ISEDIM)) + ALLOCATE(ZLBDAS(ISEDIM)) DO JL = 1,ISEDIM - ZRSS(JL) = PRSS(I1(JL),I2(JL),I3(JL)) - ZCSS(JL) = PCSS(I1(JL),I2(JL),I3(JL)) - END DO - ZLBDAS(:) = 1.E10 - WHERE( ZRSS(:)>XRTMIN(5) .AND. ZCSS(:)>XCTMIN(5) ) - ZLBDAS(:) = ( XLBS*ZCSS(:) / ZRSS(:) )**XLBEXS - ZZY(:) = ZRHODREF(:)**(-XCEXVT) * (ZLBDAS(:)**(-XDS)) - ZZW(:) = XFSEDRS * ZRSS(:) * ZZY(:) * ZRHODREF(:) - ZZX(:) = XFSEDCS * ZCSS(:) * ZZY(:) * ZRHODREF(:) - END WHERE - ZWSEDR(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) - ZWSEDR(:,:,IKB:IKE) = MIN( ZWSEDR(:,:,IKB:IKE), PRSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) - ZWSEDC(:,:,:) = UNPACK( ZZX(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) - ZWSEDC(:,:,IKB:IKE) = MIN( ZWSEDC(:,:,IKB:IKE), PCSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) - DO JK = IKB , IKE - PRSS(:,:,JK) = PRSS(:,:,JK) + ZW(:,:,JK)* & - (ZWSEDR(:,:,JK+1)-ZWSEDR(:,:,JK))/PRHODREF(:,:,JK) - PCSS(:,:,JK) = PCSS(:,:,JK) + ZW(:,:,JK)* & - (ZWSEDC(:,:,JK+1)-ZWSEDC(:,:,JK))/PRHODREF(:,:,JK) - END DO - DEALLOCATE(ZRSS) - DEALLOCATE(ZCSS) - DEALLOCATE(ZLBDAS) + ZRSS(JL) = PRSS(I1(JL),I2(JL),I3(JL)) + ZCSS(JL) = PCSS(I1(JL),I2(JL),I3(JL)) + END DO + ZLBDAS(:) = 1.E10 + WHERE( ZRSS(:)>XRTMIN(5) .AND. ZCSS(:)>XCTMIN(5) ) + ZLBDAS(:) = ( XLBS*ZCSS(:) / ZRSS(:) )**XLBEXS + ZZY(:) = ZRHODREF(:)**(-XCEXVT) * (ZLBDAS(:)**(-XDS)) + ZZW(:) = XFSEDRS * ZRSS(:) * ZZY(:) * ZRHODREF(:) + ZZX(:) = XFSEDCS * ZCSS(:) * ZZY(:) * ZRHODREF(:) + END WHERE + ZWSEDR(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) + ZWSEDR(:,:,IKB:IKE) = MIN( ZWSEDR(:,:,IKB:IKE), PRSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) + ZWSEDC(:,:,:) = UNPACK( ZZX(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) + ZWSEDC(:,:,IKB:IKE) = MIN( ZWSEDC(:,:,IKB:IKE), PCSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) + DO JK = IKB , IKE + PRSS(:,:,JK) = PRSS(:,:,JK) + ZW(:,:,JK)* & + (ZWSEDR(:,:,JK+1)-ZWSEDR(:,:,JK))/PRHODREF(:,:,JK) + PCSS(:,:,JK) = PCSS(:,:,JK) + ZW(:,:,JK)* & + (ZWSEDC(:,:,JK+1)-ZWSEDC(:,:,JK))/PRHODREF(:,:,JK) + END DO + DEALLOCATE(ZRSS) + DEALLOCATE(ZCSS) + DEALLOCATE(ZLBDAS) ELSE - DO JL = 1,ISEDIM - ZRSS(JL) = PRSS(I1(JL),I2(JL),I3(JL)) - END DO - WHERE( ZRSS(:)>XRTMIN(5) ) - ZZW(:) = XFSEDS * (ZRSS(:)*ZRHODREF(:))**XEXSEDS * ZRHODREF(:)**(-XCEXVT) - END WHERE - ZWSEDR(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) - ZWSEDR(:,:,IKB:IKE) = MIN( ZWSEDR(:,:,IKB:IKE), PRSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) - DO JK = IKB , IKE - PRSS(:,:,JK) = PRSS(:,:,JK) + ZW(:,:,JK)* & - (ZWSEDR(:,:,JK+1)-ZWSEDR(:,:,JK))/PRHODREF(:,:,JK) - END DO - DEALLOCATE(ZRSS) - END IF + DO JL = 1,ISEDIM + ZRSS(JL) = PRSS(I1(JL),I2(JL),I3(JL)) + END DO + WHERE( ZRSS(:)>XRTMIN(5) ) + ZZW(:) = XFSEDS * (ZRSS(:)*ZRHODREF(:))**XEXSEDS * ZRHODREF(:)**(-XCEXVT) + END WHERE + ZWSEDR(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIM(:,:,:),FIELD=0.0 ) + ZWSEDR(:,:,IKB:IKE) = MIN( ZWSEDR(:,:,IKB:IKE), PRSS(:,:,IKB:IKE) * PRHODREF(:,:,IKB:IKE) / ZW(:,:,IKB:IKE) ) + DO JK = IKB , IKE + PRSS(:,:,JK) = PRSS(:,:,JK) + ZW(:,:,JK)* & + (ZWSEDR(:,:,JK+1)-ZWSEDR(:,:,JK))/PRHODREF(:,:,JK) + END DO + DEALLOCATE(ZRSS) + END IF ELSE ZWSEDR(:,:,IKB) = 0.0 END IF diff --git a/src/MNH/lima_mixed_fast_processes.f90 b/src/MNH/lima_mixed_fast_processes.f90 index 5cd422e83770094e346d5492ca73eb2bb6984e53..bdc2150fe425b69f8415c38b577895d3d2965425 100644 --- a/src/MNH/lima_mixed_fast_processes.f90 +++ b/src/MNH/lima_mixed_fast_processes.f90 @@ -308,7 +308,8 @@ LOGICAL :: M2_ICE ! !------------------------------------------------------------------------------- ! -M2_ICE = NMOM_S.GE.2 .AND. NMOM_G.GE.2 .AND. NMOM_H.GE.2 +M2_ICE = NMOM_S.GE.2 .AND. NMOM_G.GE.2 +IF (LHAIL) M2_ICE = M2_ICE .AND. NMOM_H.GE.2 ! ! ################# ! FAST RS PROCESSES @@ -1263,13 +1264,13 @@ if ( nbumod == kmi .and. lbu_enable ) then Unpack( pcrs1d(:), mask = gmicro(:, :, :), field = pcrs(:, :, :) ) * prhodj(:, :, :) ) call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'WETG', & Unpack( pcis1d(:), mask = gmicro(:, :, :), field = pcis(:, :, :) ) * prhodj(:, :, :) ) - if(NMOM_S.GE.2 .AND. NMOM_G.GE.2 .AND. NMOM_H.GE.2) then + if(M2_ICE) then call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ns), 'WETG', & Unpack( pcss1d(:), mask = gmicro(:, :, :), field = pcss(:, :, :) ) * prhodj(:, :, :) ) call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ng), 'WETG', & Unpack( pcgs1d(:), mask = gmicro(:, :, :), field = pcgs(:, :, :) ) * prhodj(:, :, :) ) - call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nh), 'WETG', & - Unpack( pchs1d(:), mask = gmicro(:, :, :), field = pchs(:, :, :) ) * prhodj(:, :, :) ) + if (LHAIL) call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nh), 'WETG', & + Unpack( pchs1d(:), mask = gmicro(:, :, :), field = pchs(:, :, :) ) * prhodj(:, :, :) ) end if end if end if @@ -1575,7 +1576,7 @@ if ( nbumod == kmi .and. lbu_enable ) then Unpack( pcss1d(:), mask = gmicro(:, :, :), field = pcss(:, :, :) ) * prhodj(:, :, :) ) call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ng), 'WETG', & Unpack( pcgs1d(:), mask = gmicro(:, :, :), field = pcgs(:, :, :) ) * prhodj(:, :, :) ) - call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nh), 'WETG', & + if (LHAIL) call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nh), 'WETG', & Unpack( pchs1d(:), mask = gmicro(:, :, :), field = pchs(:, :, :) ) * prhodj(:, :, :) ) end if end if diff --git a/src/MNH/read_lima_data_netcdf_case.f90 b/src/MNH/read_lima_data_netcdf_case.f90 index 21e8e90f3a736035c0c68b0124dc774ff075442c..35fd628b8ac87bd4b057ed2fcd1d674b7def7466 100644 --- a/src/MNH/read_lima_data_netcdf_case.f90 +++ b/src/MNH/read_lima_data_netcdf_case.f90 @@ -260,7 +260,7 @@ ALLOCATE (XA_SV_LS(ilevlen)) ALLOCATE (XB_SV_LS(ilevlen)) ! meteo var ALLOCATE (XT_SV_LS(IIU,IJU,ilevlen)) -ALLOCATE (XQ_SV_LS(IIU,IJU,ilevlen,1)) +ALLOCATE (XQ_SV_LS(IIU,IJU,ilevlen,NRR)) ALLOCATE (XPS_SV_LS(IIU,IJU)) ALLOCATE (XZS_SV_LS(IIU,IJU)) ! take the orography from ECMWF @@ -436,13 +436,6 @@ NINDICE_CCN_IMM(1)=3 ! ! Define work arrays ! -ALLOCATE (XPS_SV_LS(IIU,IJU)) -ALLOCATE (XZS_SV_LS(IIU,IJU)) -ALLOCATE (XT_SV_LS(IIU,IJU,ilevlen)) -ALLOCATE (XQ_SV_LS(IIU,IJU,ilevlen,NRR)) -XQ_SV_LS(:,:,:,2:)=0.000000000001 -! -XZS_SV_LS(:,:) = XZS_LS(:,:) ! orography from the PGD file where (ZLONOUT(:) < 0.) ZLONOUT(:) = ZLONOUT(:) + 360. ! correct longitudes ! ! @@ -510,13 +503,13 @@ DO JJ=1,ilevlen ZTMP1(JJ) = XA_SV_LS(ilevlen+1-JJ) ZTMP2(JJ) = XB_SV_LS(ilevlen+1-JJ) ZTMP3(:,:,JJ) = XT_SV_LS(:,:,ilevlen+1-JJ) - ZTMP4(:,:,JJ,:) = XQ_SV_LS(:,:,ilevlen+1-JJ,:) + ZTMP4(:,:,JJ,1) = XQ_SV_LS(:,:,ilevlen+1-JJ,1) ZTMP5(:,:,JJ,:) = XSV_LS_LIMA(:,:,ilevlen+1-JJ,:) ENDDO XA_SV_LS(:) = ZTMP1(:) XB_SV_LS(:) = ZTMP2(:) XT_SV_LS(:,:,:) = ZTMP3(:,:,:) -XQ_SV_LS(:,:,:,:) = ZTMP4(:,:,:,:) +XQ_SV_LS(:,:,:,1) = ZTMP4(:,:,:,1) XSV_LS_LIMA(:,:,:,:) = ZTMP5(:,:,:,:) DEALLOCATE(ZTMP1) DEALLOCATE(ZTMP2)