diff --git a/src/MNH/aircraft_balloon_evol.f90 b/src/MNH/aircraft_balloon_evol.f90 index dcbdd6349d012cb4ceea2734c75146d1c55a5c4b..2303011daab21515ccc45b5ad0daada2bba701fd 100644 --- a/src/MNH/aircraft_balloon_evol.f90 +++ b/src/MNH/aircraft_balloon_evol.f90 @@ -26,6 +26,7 @@ ! -do not use PMAP if cartesian domain ! P. Wautelet 06/2022: reorganize flyers ! P. Wautelet 01/06/2023: deduplicate code => moved to modd/mode_sensors.f90 +! B. Vie 21/09/2023: add T and scalar variables !----------------------------------------------------------------- ! ########################## MODULE MODE_AIRCRAFT_BALLOON_EVOL @@ -107,7 +108,7 @@ CONTAINS ! ------------ ! USE MODD_AIRCRAFT_BALLOON -USE MODD_CST, ONLY: XCPD, XLVTT +USE MODD_CST, ONLY: XCPD, XLVTT, XP00, XRD USE MODD_IO, ONLY: ISP USE MODD_TIME_n, ONLY: TDTCUR USE MODD_TURB_FLUX_AIRCRAFT_BALLOON, ONLY: XRCW_FLUX, XSVW_FLUX, XTHW_FLUX @@ -894,7 +895,6 @@ SUBROUTINE FLYER_RECORD_DATA( ) USE MODD_CST, ONLY: XP00, XPI, XRD USE MODD_DIAG_IN_RUN, ONLY: XCURRENT_TKE_DISS USE MODD_GRID, ONLY: XBETA, XLON0, XRPK -USE MODD_NSV, ONLY: NSV_LIMA_NC, NSV_LIMA_NR, NSV_LIMA_NI USE MODD_PARAMETERS, ONLY: JPVEXT USE MODD_PARAM_n, ONLY: CCLOUD, CRAD @@ -907,7 +907,7 @@ INTEGER :: JLOOP ! loop counter REAL :: ZGAM ! rotation between meso-nh base and spherical lat-lon base. REAL :: ZU_BAL ! horizontal wind speed at balloon location (along x) REAL :: ZV_BAL ! horizontal wind speed at balloon location (along y) -REAL, DIMENSION(SIZE(PZ,3)) :: ZZ ! altitude of model levels at station location +REAL, DIMENSION(SIZE(PZ,3)) :: ZZ ! altitude of model levels at flyer location REAL, DIMENSION(SIZE(PR,1),SIZE(PR,2),SIZE(PR,3)) :: ZR TPFLYER%NMODELHIST(ISTORE) = TPFLYER%NMODEL @@ -928,11 +928,12 @@ ZGAM = (XRPK * (TPFLYER%XLON_CUR - XLON0) - XBETA)*(XPI/180.) TPFLYER%XZON (1,ISTORE) = ZU_BAL * COS(ZGAM) + ZV_BAL * SIN(ZGAM) TPFLYER%XMER (1,ISTORE) = - ZU_BAL * SIN(ZGAM) + ZV_BAL * COS(ZGAM) ! +ZFLYER_EXN = TPFLYER%INTERP_FROM_MASSPOINT( ZEXN ) TPFLYER%XW (1,ISTORE) = TPFLYER%INTERP_FROM_MASSPOINT( ZWM ) +TPFLYER%XP (1,ISTORE) = XP00 * ZFLYER_EXN**(XCPD/XRD) TPFLYER%XTH (1,ISTORE) = TPFLYER%INTERP_FROM_MASSPOINT( PTH ) +TPFLYER%XT (1,ISTORE) = TPFLYER%INTERP_FROM_MASSPOINT( PTH ) * ZFLYER_EXN ! -ZFLYER_EXN = TPFLYER%INTERP_FROM_MASSPOINT( ZEXN ) -TPFLYER%XP (1,ISTORE) = XP00 * ZFLYER_EXN**(XCPD/XRD) ZR(:,:,:) = 0. DO JLOOP=1,SIZE(PR,4) @@ -951,14 +952,17 @@ TPFLYER%XFFZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( SQRT(PU**2+PV**2) TPFLYER%XRHOD (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PRHODREF ) -IF (CCLOUD=="LIMA") THEN - TPFLYER%XCIZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NI) ) - TPFLYER%XCCZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NC) ) - TPFLYER%XCRZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NR) ) -ELSE IF ( CCLOUD=="ICE3" .OR. CCLOUD=="ICE4" ) THEN - TPFLYER%XCIZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PCIT(:,:,:) ) +IF ( CCLOUD=="ICE3" .OR. CCLOUD=="ICE4" ) THEN + TPFLYER%XCIZ(:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PCIT(:,:,:) ) END IF +TPFLYER%XPZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PP(:,:,:) ) +TPFLYER%XTZ (:,ISTORE) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PTH(:,:,:) ) * ( TPFLYER%XPZ(:,ISTORE) / XP00 ) ** ( XRD / XCPD ) + +DO JLOOP=1,SIZE(PSV,4) + TPFLYER%XSVZ(:,ISTORE,JLOOP) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,JLOOP) ) +END DO + ZTH_EXN(:,:,:) = PTH(TPFLYER%NI_M:TPFLYER%NI_M+1, TPFLYER%NJ_M:TPFLYER%NJ_M+1, :) * ZEXN(:,:,:) ZZ(:) = TPFLYER%INTERP_HOR_FROM_MASSPOINT( ZZM(:,:,:) ) TPFLYER%XZZ(:,ISTORE) = ZZ(:) diff --git a/src/MNH/modd_aircraft_balloon.f90 b/src/MNH/modd_aircraft_balloon.f90 index a5bf6a96a1edb53bf932b8160d49327571e885c5..c95161d69e755c7ef3fad7484803a101b9234cf1 100644 --- a/src/MNH/modd_aircraft_balloon.f90 +++ b/src/MNH/modd_aircraft_balloon.f90 @@ -35,6 +35,7 @@ ! P. Wautelet 08/02/2019: add missing NULL association for pointers ! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management ! P. Wautelet 06/2022: reorganize flyers +! B. Vie 21/09/2023: add SVs and temperature to recorded variables !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -100,6 +101,9 @@ TYPE, EXTENDS(TSENSOR), ABSTRACT :: TFLYERDATA REAL, DIMENSION(:), ALLOCATABLE :: XTKE_DISS ! tke dissipation rate REAL, DIMENSION(:,:), ALLOCATABLE :: XRTZ ! tot hydrometeor mixing ratio REAL, DIMENSION(:,:,:), ALLOCATABLE :: XRZ ! water vapour mixing ratio + REAL, DIMENSION(:,:), ALLOCATABLE :: XPZ ! Pressure + REAL, DIMENSION(:,:), ALLOCATABLE :: XTZ ! Temperature + REAL, DIMENSION(:,:,:), ALLOCATABLE :: XSVZ ! Scalar variables REAL, DIMENSION(:,:), ALLOCATABLE :: XFFZ ! horizontal wind REAL, DIMENSION(:,:), ALLOCATABLE :: XWZ ! vertical profile of vertical velocity REAL, DIMENSION(:,:), ALLOCATABLE :: XZZ ! vertical profile of mass point altitude (above sea) @@ -257,8 +261,11 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_FLYER( TPSENSOR, KSTORE ) ALLOCATE( TPSENSOR%XRTZ (IKU, ISTORE) ) ALLOCATE( TPSENSOR%XRZ (IKU, ISTORE, NRR) ) + ALLOCATE( TPSENSOR%XPZ (IKU, ISTORE) ) + ALLOCATE( TPSENSOR%XTZ (IKU, ISTORE) ) + ALLOCATE( TPSENSOR%XSVZ (IKU, ISTORE, NSV) ) ALLOCATE( TPSENSOR%XFFZ (IKU, ISTORE) ) - IVARSIZE = IVARSIZE + IKU * ( 2 + NRR ) + IVARSIZE = IVARSIZE + IKU * ( 4 + NRR + NSV ) ALLOCATE( TPSENSOR%XWZ (IKU, ISTORE) ) ALLOCATE( TPSENSOR%XZZ (IKU, ISTORE) ) @@ -282,6 +289,9 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_FLYER( TPSENSOR, KSTORE ) TPSENSOR%XLAT = XUNDEF TPSENSOR%XRTZ = XUNDEF TPSENSOR%XRZ = XUNDEF + TPSENSOR%XPZ = XUNDEF + TPSENSOR%XTZ = XUNDEF + TPSENSOR%XSVZ = XUNDEF TPSENSOR%XFFZ = XUNDEF TPSENSOR%XWZ = XUNDEF TPSENSOR%XZZ = XUNDEF @@ -315,6 +325,9 @@ SUBROUTINE DATA_ARRAYS_DEALLOCATE_FLYER( TPSENSOR ) DEALLOCATE( TPSENSOR%XLAT ) DEALLOCATE( TPSENSOR%XRTZ ) DEALLOCATE( TPSENSOR%XRZ ) + DEALLOCATE( TPSENSOR%XPZ ) + DEALLOCATE( TPSENSOR%XTZ ) + DEALLOCATE( TPSENSOR%XSVZ ) DEALLOCATE( TPSENSOR%XFFZ ) DEALLOCATE( TPSENSOR%XWZ ) DEALLOCATE( TPSENSOR%XZZ ) @@ -500,6 +513,11 @@ SUBROUTINE BUFFER_PACK_FLYER( TPSENSOR, PBUFFER, KPOS, KSTORE_CURRENT ) PBUFFER(KPOS:KPOS+IKU*ISTORES*NRR-1) = RESHAPE( TPSENSOR%XRZ(1:IKU,1:ISTORES,1:NRR), [IKU*ISTORES*NRR] ) KPOS = KPOS + IKU * ISTORES * NRR + PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XPZ (1:IKU,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES + PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XTZ (1:IKU,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES + PBUFFER(KPOS:KPOS+IKU*ISTORES*NSV-1) = RESHAPE( TPSENSOR%XSVZ(1:IKU,1:ISTORES,:), [IKU*ISTORES*NSV] ) + KPOS = KPOS + IKU * ISTORES * NSV + PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XFFZ (1:IKU,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XWZ(1:IKU,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES @@ -714,6 +732,11 @@ SUBROUTINE BUFFER_UNPACK_FLYER( TPSENSOR, PBUFFER, KPOS, KSTORE ) TPSENSOR%XRZ(1:IKU,1:KSTORE,1:NRR) = RESHAPE( PBUFFER(KPOS:KPOS+(KSTORE*IKU*NRR)-1), [IKU,KSTORE,NRR] ) KPOS = KPOS + KSTORE * IKU * NRR + TPSENSOR%XPZ (1:IKU,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE + TPSENSOR%XTZ (1:IKU,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE + TPSENSOR%XSVZ(1:IKU,1:KSTORE,1:NSV) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE*NSV-1), [ IKU, KSTORE, NSV ] ) + KPOS = KPOS + IKU * KSTORE * NSV + TPSENSOR%XFFZ (1:IKU,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+KSTORE*IKU-1), [IKU,KSTORE] ) ; KPOS = KPOS + KSTORE * IKU TPSENSOR%XWZ(1:IKU,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+KSTORE*IKU-1), [IKU,KSTORE] ) ; KPOS = KPOS + KSTORE * IKU diff --git a/src/MNH/modd_sensor.f90 b/src/MNH/modd_sensor.f90 index b780c39137fc86ee7ed5d63c5a9af8921b9b8c04..12fa4243ebceb0640c78e97abf7a34a24ae2b716 100644 --- a/src/MNH/modd_sensor.f90 +++ b/src/MNH/modd_sensor.f90 @@ -6,6 +6,7 @@ ! Original version: ! P. Wautelet: 27/04/2023 ! Modifications: +! B. Vie 21/09/2023: remove XCCZ and XCRZ + XCIZ (if LIMA) !----------------------------------------------------------------- MODULE MODD_SENSOR USE MODD_PARAMETERS, ONLY: NSENSORNAMELGTMAX, NNEGUNDEF, XNEGUNDEF, XUNDEF @@ -101,6 +102,7 @@ MODULE MODD_SENSOR REAL, DIMENSION(:,:), ALLOCATABLE :: XP ! p(n) REAL, DIMENSION(:,:), ALLOCATABLE :: XTKE ! tke(n) REAL, DIMENSION(:,:), ALLOCATABLE :: XTH ! th(n) + REAL, DIMENSION(:,:), ALLOCATABLE :: XT ! t(n) REAL, DIMENSION(:,:,:), ALLOCATABLE :: XR ! r*(n) REAL, DIMENSION(:,:,:), ALLOCATABLE :: XSV ! Sv*(n) REAL, DIMENSION(:), ALLOCATABLE :: XTSRAD ! surface temperature Ts(n) @@ -108,8 +110,6 @@ MODULE MODD_SENSOR REAL, DIMENSION(:,:), ALLOCATABLE :: XRHOD ! density of dry air REAL, DIMENSION(:,:), ALLOCATABLE :: XCIZ ! Ice concentration - REAL, DIMENSION(:,:), ALLOCATABLE :: XCCZ ! Cloud concentration (LIMA) - REAL, DIMENSION(:,:), ALLOCATABLE :: XCRZ ! Rain concentration (LIMA) REAL, DIMENSION(:,:), ALLOCATABLE :: XIWCZ ! ice water content REAL, DIMENSION(:,:), ALLOCATABLE :: XLWCZ ! liquid water content REAL, DIMENSION(:,:), ALLOCATABLE :: XCRARE ! cloud radar reflectivity @@ -212,6 +212,7 @@ MODULE MODD_SENSOR ALLOCATE( TPSENSOR%XTKE(0, 0) ) END IF ALLOCATE( TPSENSOR%XTH (KLEVELS, KSTORE) ) ; IVARSIZE = IVARSIZE + KLEVELS + ALLOCATE( TPSENSOR%XT (KLEVELS, KSTORE) ) ; IVARSIZE = IVARSIZE + KLEVELS ALLOCATE( TPSENSOR%XR (KLEVELS, KSTORE, NRR) ) ; IVARSIZE = IVARSIZE + KLEVELS * NRR ALLOCATE( TPSENSOR%XSV (KLEVELS, KSTORE, NSV) ) ; IVARSIZE = IVARSIZE + KLEVELS * NSV IF ( CRAD /= 'NONE' ) THEN @@ -224,18 +225,10 @@ MODULE MODD_SENSOR IF ( OVERTPROF ) THEN ALLOCATE( TPSENSOR%XRHOD(IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - IF ( CCLOUD == 'LIMA') THEN - ALLOCATE( TPSENSOR%XCIZ (IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - ALLOCATE( TPSENSOR%XCCZ (IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - ALLOCATE( TPSENSOR%XCRZ (IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - ELSE IF ( CCLOUD(1:3) == 'ICE') THEN + IF ( CCLOUD(1:3) == 'ICE') THEN ALLOCATE( TPSENSOR%XCIZ (IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - ALLOCATE( TPSENSOR%XCCZ (0, 0) ) - ALLOCATE( TPSENSOR%XCRZ (0, 0) ) ELSE ALLOCATE( TPSENSOR%XCIZ (0, 0) ) - ALLOCATE( TPSENSOR%XCCZ (0, 0) ) - ALLOCATE( TPSENSOR%XCRZ (0, 0) ) END IF ALLOCATE( TPSENSOR%XIWCZ (IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU @@ -245,8 +238,6 @@ MODULE MODD_SENSOR ELSE ALLOCATE( TPSENSOR%XRHOD (0, 0) ) ALLOCATE( TPSENSOR%XCIZ (0, 0) ) - ALLOCATE( TPSENSOR%XCCZ (0, 0) ) - ALLOCATE( TPSENSOR%XCRZ (0, 0) ) ALLOCATE( TPSENSOR%XIWCZ (0, 0) ) ALLOCATE( TPSENSOR%XLWCZ (0, 0) ) ALLOCATE( TPSENSOR%XCRARE (0, 0) ) @@ -261,14 +252,13 @@ MODULE MODD_SENSOR TPSENSOR%XP (:,:) = XUNDEF TPSENSOR%XTKE (:,:) = XUNDEF TPSENSOR%XTH (:,:) = XUNDEF + TPSENSOR%XT (:,:) = XUNDEF TPSENSOR%XR (:,:,:) = XUNDEF TPSENSOR%XSV (:,:,:) = XUNDEF TPSENSOR%XTSRAD (:) = XUNDEF_SFX TPSENSOR%XRHOD_SENSOR(:) = XNEGUNDEF TPSENSOR%XRHOD (:,:) = XNEGUNDEF TPSENSOR%XCIZ (:,:) = XUNDEF - TPSENSOR%XCCZ (:,:) = XUNDEF - TPSENSOR%XCRZ (:,:) = XUNDEF TPSENSOR%XIWCZ (:,:) = XUNDEF TPSENSOR%XLWCZ (:,:) = XUNDEF TPSENSOR%XCRARE (:,:) = XUNDEF @@ -296,14 +286,13 @@ MODULE MODD_SENSOR DEALLOCATE( TPSENSOR%XP ) DEALLOCATE( TPSENSOR%XTKE ) DEALLOCATE( TPSENSOR%XTH ) + DEALLOCATE( TPSENSOR%XT ) DEALLOCATE( TPSENSOR%XR ) DEALLOCATE( TPSENSOR%XSV ) DEALLOCATE( TPSENSOR%XTSRAD ) DEALLOCATE( TPSENSOR%XRHOD_SENSOR ) DEALLOCATE( TPSENSOR%XRHOD ) DEALLOCATE( TPSENSOR%XCIZ ) - DEALLOCATE( TPSENSOR%XCCZ ) - DEALLOCATE( TPSENSOR%XCRZ ) DEALLOCATE( TPSENSOR%XIWCZ ) DEALLOCATE( TPSENSOR%XLWCZ ) DEALLOCATE( TPSENSOR%XCRARE ) @@ -1003,6 +992,7 @@ MODULE MODD_SENSOR PBUFFER(KPOS:KPOS+ILVST-1) = RESHAPE( TPSENSOR%XTKE(:,1:ISTORES), [ILVST] ) ; KPOS = KPOS + ILVST END IF PBUFFER(KPOS:KPOS+ILVST-1) = RESHAPE( TPSENSOR%XTH(:,1:ISTORES), [ILVST] ) ; KPOS = KPOS + ILVST + PBUFFER(KPOS:KPOS+ILVST-1) = RESHAPE( TPSENSOR%XT (:,1:ISTORES), [ILVST] ) ; KPOS = KPOS + ILVST PBUFFER(KPOS:KPOS+ILVST*NRR-1) = RESHAPE( TPSENSOR%XR (:,1:ISTORES,:), [ILVST*NRR] ) ; KPOS = KPOS + ILVST * NRR PBUFFER(KPOS:KPOS+ILVST*NSV-1) = RESHAPE( TPSENSOR%XSV(:,1:ISTORES,:), [ILVST*NSV] ) ; KPOS = KPOS + ILVST * NSV IF ( CRAD /= 'NONE' ) THEN @@ -1015,11 +1005,6 @@ MODULE MODD_SENSOR IF ( CCLOUD(1:3) == 'ICE') THEN PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XCIZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES END IF - IF ( CCLOUD == 'LIMA') THEN - PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XCIZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES - PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XCCZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES - PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XCRZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES - END IF PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XIWCZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XLWCZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XCRARE (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES @@ -1130,6 +1115,7 @@ MODULE MODD_SENSOR TPSENSOR%XTKE(:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+ILVST-1), [ ILEVELS, KSTORE ] ) ; KPOS = KPOS + ILVST END IF TPSENSOR%XTH(:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+ILVST-1), [ ILEVELS, KSTORE ] ) ; KPOS = KPOS + ILVST + TPSENSOR%XT (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+ILVST-1), [ ILEVELS, KSTORE ] ) ; KPOS = KPOS + ILVST TPSENSOR%XR (:,1:KSTORE,:) = RESHAPE( PBUFFER(KPOS:KPOS+ILVST*NRR-1), [ ILEVELS, KSTORE, NRR ] ) ; KPOS = KPOS + ILVST * NRR TPSENSOR%XSV(:,1:KSTORE,:) = RESHAPE( PBUFFER(KPOS:KPOS+ILVST*NSV-1), [ ILEVELS, KSTORE, NSV ] ) ; KPOS = KPOS + ILVST * NSV IF ( CRAD /= 'NONE' ) THEN @@ -1142,11 +1128,6 @@ MODULE MODD_SENSOR IF ( CCLOUD(1:3) == 'ICE' ) THEN TPSENSOR%XCIZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE END IF - IF ( CCLOUD == 'LIMA' ) THEN - TPSENSOR%XCIZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE - TPSENSOR%XCCZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE - TPSENSOR%XCRZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE - END IF TPSENSOR%XIWCZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE TPSENSOR%XLWCZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE TPSENSOR%XCRARE (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE diff --git a/src/MNH/profilern.f90 b/src/MNH/profilern.f90 index f95533090650d9f5c3252f178feb93068d322e3a..f5b467784bd65aa85277d371c0893c1aede0d034 100644 --- a/src/MNH/profilern.f90 +++ b/src/MNH/profilern.f90 @@ -93,7 +93,7 @@ USE MODD_ALLPROFILER_n, ONLY: LDIAG_SURFRAD_PROF USE MODD_CST, ONLY: XCPD, XG, XP00, XPI, XRD, XRV USE MODD_DIAG_IN_RUN, ONLY: XCURRENT_TKE_DISS USE MODD_GRID, ONLY: XBETA, XLON0, XRPK -USE MODD_NSV, ONLY: NSV_C2R2BEG, NSV_LIMA_NC, NSV_LIMA_NR, NSV_LIMA_NI +USE MODD_NSV, ONLY: NSV_C2R2BEG USE MODD_PARAMETERS, ONLY: JPVEXT, XUNDEF USE MODD_PARAM_n, ONLY: CCLOUD, CRAD USE MODD_PROFILER_n @@ -331,6 +331,7 @@ PROFILER: DO JP = 1, NUMBPROFILER_LOC TPROFILERS(JP)%XDD (:,IN) = ZDD(:) TPROFILERS(JP)%XW (:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PW ) TPROFILERS(JP)%XTH (:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PTH ) + TPROFILERS(JP)%XT (:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( ZTEMP ) TPROFILERS(JP)%XTHV (:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( ZTHV ) IF ( CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO' ) & TPROFILERS(JP)%XVISIGUL(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( ZVISIGUL ) @@ -338,11 +339,7 @@ PROFILER: DO JP = 1, NUMBPROFILER_LOC TPROFILERS(JP)%XVISIKUN(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( ZVISIKUN ) TPROFILERS(JP)%XZZ (:,IN) = ZZ(:) TPROFILERS(JP)%XRHOD(:,IN) = ZRHOD(:) - IF (CCLOUD=="LIMA") THEN - TPROFILERS(JP)%XCIZ(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NI) ) - TPROFILERS(JP)%XCCZ(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NC) ) - TPROFILERS(JP)%XCRZ(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PSV(:,:,:,NSV_LIMA_NR) ) - ELSE IF ( CCLOUD=="ICE3" .OR. CCLOUD=="ICE4" ) THEN + IF ( CCLOUD=="ICE3" .OR. CCLOUD=="ICE4" ) THEN TPROFILERS(JP)%XCIZ(:,IN) = TPROFILERS(JP)%INTERP_HOR_FROM_MASSPOINT( PCIT ) END IF diff --git a/src/MNH/stationn.f90 b/src/MNH/stationn.f90 index 6ef64ccf5162ce40563307b5f51ed8cf50e71303..7f5d3f9d9696cadb2f45cc5af170439df468a51d 100644 --- a/src/MNH/stationn.f90 +++ b/src/MNH/stationn.f90 @@ -77,7 +77,7 @@ END MODULE MODI_STATION_n ! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management ! R. Schoetter 11/2019: use LCARTESIAN instead of LSTATLAT for multiproc in cartesian ! P. Wautelet 04/2022: restructure stations for better performance, reduce memory usage and correct some problems/bugs -! +! P. Wautelet 01/12/2023: compute temperature (XT field) ! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -85,7 +85,7 @@ END MODULE MODI_STATION_n ! USE MODD_ALLSTATION_n, ONLY: LDIAG_SURFRAD_STAT USE MODD_CONF, ONLY: LCARTESIAN -USE MODD_CST, ONLY: XPI +USE MODD_CST, ONLY: XCPD, XP00, XPI, XRD USE MODD_GRID, ONLY: XBETA, XLON0, XRPK USE MODD_PARAMETERS, ONLY: JPVEXT USE MODD_PARAM_n, ONLY: CRAD @@ -158,6 +158,7 @@ STATION: DO JS = 1, NUMBSTAT_LOC TSTATIONS(JS)%XW (1,IN) = TSTATIONS(JS)%INTERP_HOR_FROM_MASSPOINT( PW(:,:,JK) ) TSTATIONS(JS)%XTH(1,IN) = TSTATIONS(JS)%INTERP_HOR_FROM_MASSPOINT( PTH(:,:,JK) ) TSTATIONS(JS)%XP (1,IN) = TSTATIONS(JS)%INTERP_HOR_FROM_MASSPOINT( PP(:,:,JK) ) + TSTATIONS(JS)%XT (1,IN) = TSTATIONS(JS)%XTH(1,IN) * ( TSTATIONS(JS)%XP (1,IN) / XP00 ) **( XRD / XCPD ) DO JSV=1,SIZE(PR,4) TSTATIONS(JS)%XR(1,IN,JSV) = TSTATIONS(JS)%INTERP_HOR_FROM_MASSPOINT( PR(:,:,JK,JSV) ) diff --git a/src/MNH/write_aircraft_balloon.f90 b/src/MNH/write_aircraft_balloon.f90 index a1b978be286734a3a65d09439ffd0d0792e0300c..5d7f04accab8c73c8173c923a329ccf364ec623d 100644 --- a/src/MNH/write_aircraft_balloon.f90 +++ b/src/MNH/write_aircraft_balloon.f90 @@ -254,7 +254,7 @@ IF ( ALL( TPFLYER%XX == XUNDEF ) ) RETURN ! IKU = SIZE(TPFLYER%XRTZ,1) !number of vertical levels ! -IPROC = 10 + IRR + SIZE(TPFLYER%XSV,3) + 2 + SIZE(TPFLYER%XSVW_FLUX,2) +IPROC = 11 + IRR + SIZE(TPFLYER%XSV,3) + 2 + SIZE(TPFLYER%XSVW_FLUX,2) IF ( IRR > 1 ) IPROC = IPROC + 1 IF ( SIZE( TPFLYER%XTKE ) > 0 ) IPROC = IPROC + 1 IPROC = IPROC + 1 ! TKE_DISS @@ -291,6 +291,7 @@ call Add_point( 'ZON_WIND', 'zonal wind', 'm s-1', tpflyer%xzon(1,:) call Add_point( 'MER_WIND', 'meridian wind', 'm s-1', tpflyer%xmer(1,:) ) call Add_point( 'W', 'air vertical speed', 'm s-1', tpflyer%xw(1,:) ) call Add_point( 'Th', 'potential temperature', 'K', tpflyer%xth(1,:) ) +call Add_point( 'T', 'temperature', 'K', tpflyer%xt(1,:) ) ! if ( irr >= 1 ) call Add_point( 'Rv', 'water vapor mixing ratio', 'kg kg-1', tpflyer%xr(1,:,1) ) if ( irr >= 2 ) call Add_point( 'Rc', 'liquid cloud water mixing ratio', 'kg kg-1', tpflyer%xr(1,:,2) ) @@ -430,8 +431,7 @@ call Sensor_write_workarrays_deallocate( ) !---------------------------------------------------------------------------- !Treat vertical profiles -IPROCZ = 9 + IRR -IF ( CCLOUD == 'LIMA' ) IPROCZ = IPROCZ + 3 +IPROCZ = 11 + IRR + NSV IF ( CCLOUD(1:3) == 'ICE' ) IPROCZ = IPROCZ + 1 call Sensor_write_workarrays_allocate( iku, istore, iprocz ) @@ -448,15 +448,26 @@ if ( irr >= 7 ) call Add_profile( 'Rh', '1D Hail mixing ratio', 'k call Add_profile( 'FF', 'Horizontal wind', 'm s-1', tpflyer%xffz(:,:) ) +call Add_profile( 'T', 'Temperature', 'K', tpflyer%xtz(:,:) ) +call Add_profile( 'P', 'Pressure', 'Pa', tpflyer%xpz(:,:) ) + call Add_profile( 'IWC', 'Ice water content', 'kg m-3', tpflyer%xiwcz(:,:) ) call Add_profile( 'LWC', 'Liquid water content', 'kg m-3', tpflyer%xlwcz(:,:) ) call Add_profile( 'Rhod', 'Density of dry air', 'kg m-3', tpflyer%xrhod(:,:) ) -IF ( CCLOUD == 'LIMA' ) THEN - call Add_profile( 'CCLOUDT', 'liquid cloud concentration', 'kg-1', tpflyer%xccz(:,:) ) - call Add_profile( 'CRAINT', 'Rain concentration', 'kg-1', tpflyer%xcrz(:,:) ) - call Add_profile( 'CICET', 'Ice concentration', 'kg-1', tpflyer%xciz(:,:) ) -ELSE IF ( CCLOUD == 'ICE3' .OR. CCLOUD == 'ICE4' ) THEN + +IF ( nsv > 0 ) THEN + ! Scalar variables + DO JSV = 1, NSV + IF ( TRIM( TSVLIST(JSV)%CUNITS ) == 'ppv' ) THEN + call Add_profile( Trim( tsvlist(jsv)%cmnhname ), '', 'ppb', tpflyer%xsvz(:,:,jsv) * 1.e9 ) !*1e9 for conversion ppv->ppb + ELSE + call Add_profile( Trim( tsvlist(jsv)%cmnhname ), '', Trim( tsvlist(jsv)%cunits ), tpflyer%xsvz(:,:,jsv) ) + END IF + END DO +ENDIF + +IF ( CCLOUD == 'ICE3' .OR. CCLOUD == 'ICE4' ) THEN call Add_profile( 'CIT', 'Ice concentration', 'm-3', tpflyer%xciz(:,:) ) END IF diff --git a/src/MNH/write_profilern.f90 b/src/MNH/write_profilern.f90 index a5f1ddd398c231fed6087c15cf4b9da3a372d016..f7ed2e14152b9e6731703ef8cf2b5044d5cf861a 100644 --- a/src/MNH/write_profilern.f90 +++ b/src/MNH/write_profilern.f90 @@ -89,11 +89,10 @@ type(tfieldmetadata_base), dimension(:), allocatable :: tzfields IKU = NKMAX + 2 * JPVEXT !Number of vertical levels -IPROC = 13 + NRR + NSV +IPROC = 14 + NRR + NSV if ( ccloud == 'C2R2' .or. ccloud == 'KHKO' ) IPROC = IPROC + 1 if ( ccloud /= 'NONE' .and. ccloud /= 'REVE' ) IPROC = IPROC + 1 if ( ccloud == 'ICE3' .or. ccloud == 'ICE4' ) IPROC = IPROC + 1 -if ( ccloud == 'LIMA' ) IPROC = IPROC + 3 IF ( LORILAM ) IPROC = IPROC + JPMODE * ( 3 + NSOA + NCARB + NSP ) IF ( LDUST ) IPROC = IPROC + NMODE_DST * 3 IF ( LSALT ) IPROC = IPROC + NMODE_SLT * 3 @@ -108,6 +107,7 @@ call Sensor_write_workarrays_allocate( iku, istore, iproc ) !Treat vertical profiles call Add_profile( 'Th', 'Potential temperature', 'K', tpprofiler%xth ) +call Add_profile( 'T', 'Temperature', 'K', tpprofiler%xt ) call Add_profile( 'Thv', 'Virtual Potential temperature', 'K', tpprofiler%xthv ) if ( ccloud == 'C2R2' .or. ccloud == 'KHKO' ) & call Add_profile( 'VISIGUL', 'Visibility Gultepe', 'km', tpprofiler%xvisigul ) @@ -129,11 +129,7 @@ jproc_w = Sensor_current_processes_number_get() call Add_profile( 'TKE_DISS', 'TKE dissipation rate', 'm2 s-2', tpprofiler%xtke_diss ) -if ( ccloud == 'LIMA' ) then - call Add_profile( 'CCLOUDT', 'liquid cloud concentration', 'kg-1', tpprofiler%xccz(:,:) ) - call Add_profile( 'CRAINT', 'Rain concentration', 'kg-1', tpprofiler%xcrz(:,:) ) - call Add_profile( 'CICET', 'Ice concentration', 'kg-1', tpprofiler%xciz(:,:) ) -else if ( ccloud == 'ICE3' .or. ccloud == 'ICE4' ) then +if ( ccloud == 'ICE3' .or. ccloud == 'ICE4' ) then call Add_profile( 'CIT', 'Ice concentration', 'm-3', tpprofiler%xciz(:,:) ) end if diff --git a/src/MNH/write_stationn.f90 b/src/MNH/write_stationn.f90 index cbdaa5748e648415c397bc3e139ba852b8468fe5..144cc302c7587d969549679147ef7218c811d7d6 100644 --- a/src/MNH/write_stationn.f90 +++ b/src/MNH/write_stationn.f90 @@ -13,6 +13,7 @@ ! P. Wautelet 03/03/2021: budgets: add tbudiachrometadata type (useful to pass more information to Write_diachro) ! P. Wautelet 04/02/2022: use TSVLIST to manage metadata of scalar variables ! P. Wautelet 04/2022: restructure stations for better performance, reduce memory usage and correct some problems/bugs +! P. Wautelet 01/12/2023: write temperature field ! -------------------------------------------------------------------------- ! ########################### MODULE MODE_WRITE_STATION_n @@ -70,7 +71,7 @@ type(tfieldmetadata_base), dimension(:), allocatable :: tzfields ! !---------------------------------------------------------------------------- ! -IPROC = 6 + SIZE(TPSTATION%XR,3) + SIZE(TPSTATION%XSV,3) +IPROC = 7 + SIZE(TPSTATION%XR,3) + SIZE(TPSTATION%XSV,3) IF ( CTURB == 'TKEL' ) IPROC = IPROC + 1 IF (LDIAG_SURFRAD_STAT) THEN @@ -99,8 +100,9 @@ else call Add_point( 'MER_WIND', 'Meridional wind', 'm s-1', tpstation%xmer(1,:) ) end if -call Add_point( 'W', 'Air vertical speed', 'm s-1', tpstation%xw(1,:) ) +call Add_point( 'W', 'Air vertical speed', 'm s-1', tpstation%xw (1,:) ) call Add_point( 'Th', 'Potential temperature', 'K', tpstation%xth(1,:) ) +call Add_point( 'T', 'Temperature', 'K', tpstation%xt (1,:) ) if ( ldiag_surfrad_stat ) call Add_diag_surfrad_data( tpstation )