diff --git a/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 b/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 index f3a4ffb2b0ff54cd422efc600dd73593912b714f..497aca4aa476ee02d6fb6adbe6e22e01320e3b0c 100644 --- a/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 +++ b/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 @@ -27,6 +27,7 @@ ! P. Wautelet 11/01/2021: add coordinates for dimension variables in diachronic files ! P. Wautelet 14/01/2021: add IO_Field_write_nc4_N4, IO_Field_partial_write_nc4_N2, ! IO_Field_partial_write_nc4_N3 and IO_Field_partial_write_nc4_N4 subroutines +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain !----------------------------------------------------------------- #ifdef MNH_IOCDF4 module mode_io_write_nc4 @@ -1777,7 +1778,7 @@ if ( tpfile%lmaster ) then if ( cles_level_type == 'K' ) then Allocate( zles_levels(nles_k) ) do ji = 1, nles_k - zles_levels(ji) = zzhatm(nles_levels(ji)) + zles_levels(ji) = zzhatm(nles_levels(ji) + JPVEXT) end do call Write_ver_coord( tpfile%tncdims%tdims(NMNHDIM_BUDGET_LES_LEVEL), & 'position z in the transformed space of the LES budgets', & @@ -1796,10 +1797,12 @@ if ( tpfile%lmaster ) then !Coordinates for the number of horizontal wavelengths for non-local LES budgets (2 points correlations) if ( nspectra_ni > 0 ) & call Write_hor_coord1d( tpfile%tncdims%tdims(NMNHDIM_SPECTRA_2PTS_NI), 'x-dimension of the LES budget cartesian box', & - trim(ystdnameprefix)//'_x_coordinate', 'X', 0., 0, 0, zxhatm_glob(nlesn_iinf(imi) : nlesn_isup(imi)) ) + trim(ystdnameprefix)//'_x_coordinate', 'X', 0., 0, 0, & + zxhatm_glob(nlesn_iinf(imi) + jphext : nlesn_isup(imi) + jphext) ) if ( nspectra_nj > 0 .and. .not. l2d ) & call Write_hor_coord1d( tpfile%tncdims%tdims(NMNHDIM_SPECTRA_2PTS_NJ), 'y-dimension of the LES budget cartesian box', & - trim(ystdnameprefix)//'_y_coordinate', 'Y', 0., 0, 0, zyhatm_glob(nlesn_jinf(imi) : nlesn_jsup(imi)) ) + trim(ystdnameprefix)//'_y_coordinate', 'Y', 0., 0, 0, & + zyhatm_glob(nlesn_jinf(imi) + jphext : nlesn_jsup(imi) + jphext) ) !NMNHDIM_SPECTRA_SPEC_NI, NMNHDIM_SPECTRA_SPEC_NJ: not true dimensions: spectra wavelengths @@ -1809,7 +1812,7 @@ if ( tpfile%lmaster ) then if ( cspectra_level_type == 'K' ) then Allocate( zspectra_levels(nspectra_k) ) do ji = 1, nspectra_k - zspectra_levels(ji) = zzhatm(nspectra_levels(ji)) + zspectra_levels(ji) = zzhatm(nspectra_levels(ji) + JPVEXT) end do call Write_ver_coord( tpfile%tncdims%tdims(NMNHDIM_SPECTRA_LEVEL), & 'position z in the transformed space of the non-local LES budgets', & diff --git a/src/MNH/ini_les_cart_maskn.f90 b/src/MNH/ini_les_cart_maskn.f90 index b162a3af54d3fca4d012e8a149ce176b40fb9d5d..a3e9c7840171d597857e56403768981a86b0ff4a 100644 --- a/src/MNH/ini_les_cart_maskn.f90 +++ b/src/MNH/ini_les_cart_maskn.f90 @@ -1,6 +1,6 @@ -!MNH_LIC Copyright 1994-2017 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2000-2021 CNRS, Meteo-France and Universite Paul Sabatier !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence -!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. !----------------------------------------------------------------- !############################# @@ -20,7 +20,7 @@ REAL, DIMENSION(:), INTENT(IN) :: PXHAT_ll ! son model X coordinate REAL, DIMENSION(:), INTENT(IN) :: PYHAT_ll ! son model X coordinate INTEGER, INTENT(OUT) :: KLES_IINF ! limits of the cartesian INTEGER, INTENT(OUT) :: KLES_JINF ! mask in son model -INTEGER, INTENT(OUT) :: KLES_ISUP ! domain +INTEGER, INTENT(OUT) :: KLES_ISUP ! physical domain INTEGER, INTENT(OUT) :: KLES_JSUP ! ! END SUBROUTINE INI_LES_CART_MASK_n @@ -58,9 +58,9 @@ END MODULE MODI_INI_LES_CART_MASKn !! Original 07/02/00 !! Modification 01/02/01 (D.Gazen) add module MODD_NSV for NSV variable !! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 -!! P.Wautelet: 19/10/2017 : IO: removed extern_userio.f90 -!! -!! -------------------------------------------------------------------------- +! P. Wautelet 19/10/2017: IO: removed extern_userio.f90 +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain +! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ @@ -86,7 +86,7 @@ REAL, DIMENSION(:), INTENT(IN) :: PXHAT_ll ! son model X coordinate REAL, DIMENSION(:), INTENT(IN) :: PYHAT_ll ! son model X coordinate INTEGER, INTENT(OUT) :: KLES_IINF ! limits of the cartesian INTEGER, INTENT(OUT) :: KLES_JINF ! mask in son model -INTEGER, INTENT(OUT) :: KLES_ISUP ! domain +INTEGER, INTENT(OUT) :: KLES_ISUP ! physical domain INTEGER, INTENT(OUT) :: KLES_JSUP ! ! ! @@ -140,32 +140,32 @@ IJE_ll=SIZE(PYHAT_ll)-JPHEXT ! !* left limit ! -ZX = ZXHAT_ll(NLESn_IINF(IMI)) +ZX = ZXHAT_ll(NLESn_IINF(IMI) + JPHEXT) IF (PXHAT_ll(IIB_ll)>ZX) THEN - KLES_IINF=IIB_ll ! father mask starts left of son domain + KLES_IINF=1 ! father mask starts left of son domain ELSE IF (PXHAT_ll(IIE_ll+1)<ZX) THEN CALL MASK_OVER_ALL_DOMAIN RETURN ELSE DO JI=IIB_ll,IIE_ll IF (ABS(PXHAT_ll(JI)-ZX) <= (PXHAT_ll(JI+1)-PXHAT_ll(JI))/2. ) THEN - KLES_IINF=JI + KLES_IINF=JI-JPHEXT END IF END DO END IF ! !* right limit ! -ZX = ZXHAT_ll(NLESn_ISUP(IMI)+1) +ZX = ZXHAT_ll(NLESn_ISUP(IMI) + JPHEXT + 1) IF (PXHAT_ll(IIB_ll)>ZX) THEN CALL MASK_OVER_ALL_DOMAIN RETURN ELSE IF (PXHAT_ll(IIE_ll+1)<ZX) THEN - KLES_ISUP=IIE_ll ! father mask ends right of son domain + KLES_ISUP=IIE_ll-JPHEXT ! father mask ends right of son domain ELSE DO JI=IIB_ll,IIE_ll IF (ABS(PXHAT_ll(JI+1)-ZX) <= (PXHAT_ll(JI+1)-PXHAT_ll(JI))/2. ) THEN - KLES_ISUP=JI + KLES_ISUP=JI-JPHEXT END IF END DO END IF @@ -177,32 +177,32 @@ END IF ! !* bottom limit ! -ZY = ZYHAT_ll(NLESn_JINF(IMI)) +ZY = ZYHAT_ll(NLESn_JINF(IMI) + JPHEXT) IF (PYHAT_ll(IJB_ll)>ZY) THEN - KLES_JINF=IJB_ll ! father mask starts under the son domain + KLES_JINF=1 ! father mask starts under the son domain ELSE IF (PYHAT_ll(IJE_ll+1)<ZY) THEN CALL MASK_OVER_ALL_DOMAIN RETURN ELSE DO JJ=IJB_ll,IJE_ll IF (ABS(PYHAT_ll(JJ)-ZY) <= (PYHAT_ll(JJ+1)-PYHAT_ll(JJ))/2. ) THEN - KLES_JINF=JJ + KLES_JINF=JJ-JPHEXT END IF END DO END IF ! !* top limit ! -ZY = ZYHAT_ll(NLESn_JSUP(IMI)+1) +ZY = ZYHAT_ll(NLESn_JSUP(IMI) + JPHEXT + 1) IF (PYHAT_ll(IJB_ll)>ZY) THEN CALL MASK_OVER_ALL_DOMAIN RETURN ELSE IF (PYHAT_ll(IJE_ll+1)<ZY) THEN - KLES_JSUP=IJE_ll ! father mask ends over the son domain + KLES_JSUP=IJE_ll-JPHEXT ! father mask ends over the son domain ELSE DO JJ=IJB_ll,IJE_ll IF (ABS(PYHAT_ll(JJ+1)-ZY) <= (PYHAT_ll(JJ+1)-PYHAT_ll(JJ))/2. ) THEN - KLES_JSUP=JJ + KLES_JSUP=JJ-JPHEXT END IF END DO END IF @@ -215,10 +215,10 @@ DEALLOCATE(ZYHAT_ll) CONTAINS ! SUBROUTINE MASK_OVER_ALL_DOMAIN - KLES_IINF=IIB_ll ! father mask not in son domain, so all domain is taken - KLES_ISUP=IIE_ll - KLES_JINF=IJB_ll - KLES_JSUP=IJE_ll + KLES_IINF=IIB_ll-JPHEXT ! father mask not in son domain, so all domain is taken + KLES_ISUP=IIE_ll-JPHEXT + KLES_JINF=IJB_ll-JPHEXT + KLES_JSUP=IJE_ll-JPHEXT DEALLOCATE(ZXHAT_ll) DEALLOCATE(ZYHAT_ll) END SUBROUTINE MASK_OVER_ALL_DOMAIN diff --git a/src/MNH/ini_lesn.f90 b/src/MNH/ini_lesn.f90 index 63f05f89df388ec0d2cc72ae07d6bf4130ebda99..93e96eede5b61aa0e9a2e1290b82daf87f96ddc2 100644 --- a/src/MNH/ini_lesn.f90 +++ b/src/MNH/ini_lesn.f90 @@ -38,7 +38,8 @@ ! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management ! P. Wautelet 12/08/2020: bugfix: use NUNDEF instead of XUNDEF for integer variables ! P. Wautelet 04/01/2021: bugfix: nles_k was used instead of nspectra_k for a loop index -!! -------------------------------------------------------------------------- +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain +! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ @@ -160,28 +161,26 @@ NLES_MASKS = 1 ! ----------------------------------------------------------------------------- ! IF (IMI==1) THEN - NLESn_IINF(1)= NUNDEF - NLESn_ISUP(1)= NUNDEF - NLESn_JINF(1)= NUNDEF - NLESn_JSUP(1)= NUNDEF - ! - IF (LLES_CART_MASK) THEN - IF (NLES_IINF==NUNDEF) NLES_IINF=JPHEXT+1 - IF (NLES_JINF==NUNDEF) NLES_JINF=JPHEXT+1 - IF (NLES_ISUP==NUNDEF) NLES_ISUP=IIU_ll-JPHEXT - IF (NLES_JSUP==NUNDEF) NLES_JSUP=IJU_ll-JPHEXT - END IF - ! - IF ( NLES_IINF==JPHEXT+1 .AND. NLES_JINF==JPHEXT+1 & - .AND. NLES_ISUP==IIU_ll-JPHEXT .AND. NLES_ISUP==IJU_ll-JPHEXT ) THEN - LLES_CART_MASK=.FALSE. - END IF - ! - IF (.NOT. LLES_CART_MASK) THEN - NLES_IINF=JPHEXT+1 - NLES_JINF=JPHEXT+1 - NLES_ISUP=IIU_ll-JPHEXT - NLES_JSUP=IJU_ll-JPHEXT + IF ( LLES_CART_MASK ) THEN + !Compute LES diagnostics inside a cartesian mask + + !Set default values to physical domain boundaries + IF ( NLES_IINF == NUNDEF ) NLES_IINF = 1 + IF ( NLES_JINF == NUNDEF ) NLES_JINF = 1 + IF ( NLES_ISUP == NUNDEF ) NLES_ISUP = NIMAX_ll + IF ( NLES_JSUP == NUNDEF ) NLES_JSUP = NJMAX_ll + + !Set LLES_CART_MASK to false if whole domain is selected + IF ( NLES_IINF == 1 .AND. NLES_JINF == 1 & + .AND. NLES_ISUP == NIMAX_ll .AND. NLES_ISUP == NJMAX_ll ) THEN + LLES_CART_MASK = .FALSE. + END IF + ELSE + !Compute LES diagnostics on whole physical domain + NLES_IINF = 1 + NLES_JINF = 1 + NLES_ISUP = NIMAX_ll + NLES_JSUP = NJMAX_ll END IF ! NLESn_IINF(1)= NLES_IINF @@ -212,17 +211,16 @@ END IF ! ---------------------------------------------------------------------------- ! IF ( (.NOT. L1D) .AND. CLBCX(1)/='CYCL') THEN - NLESn_IINF(IMI) = MAX(NLESn_IINF(IMI),JPHEXT+2) + NLESn_IINF(IMI) = MAX(NLESn_IINF(IMI),2) END IF IF ( (.NOT. L1D) .AND. (.NOT. L2D) .AND. CLBCY(1)/='CYCL') THEN - NLESn_JINF(IMI) = MAX(NLESn_JINF(IMI),JPHEXT+2) + NLESn_JINF(IMI) = MAX(NLESn_JINF(IMI),2) END IF ! !* X boundary conditions for 2points correlations computations ! ----------------------------------------------------------- ! -IF ( NLESn_IINF(IMI)==JPHEXT+1 .AND. NLESn_ISUP(IMI)==IIU_ll-JPHEXT & - .AND. CLBCX(1)=='CYCL' ) THEN +IF ( CLBCX(1) == 'CYCL' .AND. NLESn_IINF(IMI) == 1 .AND. NLESn_ISUP(IMI) == NIMAX_ll ) THEN CLES_LBCX(:,IMI) = 'CYCL' ELSE CLES_LBCX(:,IMI) = 'OPEN' @@ -231,8 +229,7 @@ END IF !* Y boundary conditions for 2points correlations computations ! ----------------------------------------------------------- ! -IF ( NLESn_JINF(IMI)==JPHEXT+1 .AND. NLESn_JSUP(IMI)==IJU_ll-JPHEXT & - .AND. CLBCY(1)=='CYCL' ) THEN +IF ( CLBCY(1) == 'CYCL' .AND. NLESn_JINF(IMI) == 1 .AND. NLESn_JSUP(IMI) == NJMAX_ll ) THEN CLES_LBCY(:,IMI) = 'CYCL' ELSE CLES_LBCY(:,IMI) = 'OPEN' @@ -372,7 +369,7 @@ ELSE NLES_K = MIN(SIZE(NLES_LEVELS),NKMAX) CLES_LEVEL_TYPE='K' DO JK=1,NLES_K - NLES_LEVELS(JK) = JK + JPVEXT + NLES_LEVELS(JK) = JK END DO END IF END IF diff --git a/src/MNH/les_ini_timestepn.f90 b/src/MNH/les_ini_timestepn.f90 index 66a9748b82c53d51f1f1683ee8888afcdc203d33..c93c4c887d19394fa34a5e9ee91e760fddb04503 100644 --- a/src/MNH/les_ini_timestepn.f90 +++ b/src/MNH/les_ini_timestepn.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 2002-2020 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2002-2021 CNRS, Meteo-France and Universite Paul Sabatier !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. @@ -49,8 +49,8 @@ END MODULE MODI_LES_INI_TIMESTEP_n !! ------------- !! Original 06/11/02 ! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management -!! -!! -------------------------------------------------------------------------- +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain +! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ @@ -177,10 +177,10 @@ IMI = GET_CURRENT_MODEL_INDEX() ! ALLOCATE(LLES_CURRENT_CART_MASK(IIU,IJU,NLES_K)) ! -IIINF_MASK = MAX(IIB, NLESn_IINF(IMI)-(IIB_ll-1-JPHEXT)) -IJINF_MASK = MAX(IJB, NLESn_JINF(IMI)-(IJB_ll-1-JPHEXT)) -IISUP_MASK = MIN(IIE, NLESn_ISUP(IMI)-(IIB_ll-1-JPHEXT)) -IJSUP_MASK = MIN(IJE, NLESn_JSUP(IMI)-(IJB_ll-1-JPHEXT)) +IIINF_MASK = MAX(IIB, NLESn_IINF(IMI)+JPHEXT-(IIB_ll-1-JPHEXT)) +IJINF_MASK = MAX(IJB, NLESn_JINF(IMI)+JPHEXT-(IJB_ll-1-JPHEXT)) +IISUP_MASK = MIN(IIE, NLESn_ISUP(IMI)+JPHEXT-(IIB_ll-1-JPHEXT)) +IJSUP_MASK = MIN(IJE, NLESn_JSUP(IMI)+JPHEXT-(IJB_ll-1-JPHEXT)) ! ! LLES_CURRENT_CART_MASK(:,:,:) = .FALSE. diff --git a/src/MNH/les_ver_int.f90 b/src/MNH/les_ver_int.f90 index b864e4747ef60897e6e1f2ceb48ee0fe32786bc6..4045cec781e8e2110b78fc27858d1e655d4eb4b0 100644 --- a/src/MNH/les_ver_int.f90 +++ b/src/MNH/les_ver_int.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 2000-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2000-2021 CNRS, Meteo-France and Universite Paul Sabatier !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. @@ -49,8 +49,8 @@ END MODULE MODI_LES_VER_INT !! ------------- !! Original 07/02/00 ! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg -!! -!! -------------------------------------------------------------------------- +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain +! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ @@ -80,7 +80,7 @@ INTEGER :: JK ! vertical loop counter ! IF (CLES_LEVEL_TYPE=='K') THEN DO JK = 1, NLES_K - PA_LES(:,:,JK) = PA_MNH(:,:,NLES_LEVELS(JK)) + PA_LES(:,:,JK) = PA_MNH(:,:,NLES_LEVELS(JK) + JPVEXT ) END DO ELSE IF (CLES_LEVEL_TYPE=='Z') THEN PA_LES = VER_INTERP_LIN(PA_MNH,NKLIN_CURRENT_LES,XCOEFLIN_CURRENT_LES) diff --git a/src/MNH/modd_budget.f90 b/src/MNH/modd_budget.f90 index 1ec1bf98c4833837dc8619a0a3ccce2fa7370988..3db13890c0f0eeffccdb98cef040fd194d96345c 100644 --- a/src/MNH/modd_budget.f90 +++ b/src/MNH/modd_budget.f90 @@ -47,6 +47,7 @@ ! P. Wautelet 14/01/2021: change xbusurf type to integer (+ rename it to nbusurf) ! P. Wautelet 03/03/2021: add tbudiachrometadata type (useful to pass more information to Write_diachro) ! P. Wautelet 17/03/2021: choose source terms for budgets with character strings instead of multiple integer variables +! P. Wautelet 30/03/2021: budgets: cartesian subdomain limits are defined in the physical domain !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -110,7 +111,7 @@ type :: tbudiachrometadata logical :: licompress = .false. logical :: ljcompress = .false. logical :: lkcompress = .false. - integer :: nil = -1 + integer :: nil = -1 !Cartesian box boundaries in physical domain coordinates integer :: nih = -1 integer :: njl = -1 integer :: njh = -1 @@ -167,16 +168,16 @@ integer, save :: nbusubwrite = 0 ! Number of budget time average perio integer, save :: nbutotwrite = 0 ! Total number of budget time average periods ! INTEGER, SAVE :: NBUKL, NBUKH ! lowest and highest K indice values - ! of the budget box + ! of the budget box in the physical domain LOGICAL, SAVE :: LBU_KCP ! switch for compression in K ! direction ! ! Variables used by the cartesian box case ('CART') only ! INTEGER, SAVE :: NBUIL, NBUIH ! lowest and highest I indice values - ! of the cartesian box + ! of the cartesian box in the physical domain INTEGER, SAVE :: NBUJL, NBUJH ! lowest and highest J indice values - ! of the cartesian box + ! of the cartesian box in the physical domain LOGICAL, SAVE :: LBU_ICP ! switch for compression in I ! direction LOGICAL, SAVE :: LBU_JCP ! switch for comppression in J diff --git a/src/MNH/modd_les.f90 b/src/MNH/modd_les.f90 index e830ed1a4331fd3716cda326390bb7b22f0085bd..db71d6f33aa854d4fa66308dece4c9cc7ad7bbcd 100644 --- a/src/MNH/modd_les.f90 +++ b/src/MNH/modd_les.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1995-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1995-2021 CNRS, Meteo-France and Universite Paul Sabatier !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. @@ -41,8 +41,9 @@ !! J.Pergaud Oct , 2007 MF LES !! P. Aumond Oct ,2009 User multimaskS + 4th order !! C.Lac Oct ,2014 Correction on user masks -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O ! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -64,9 +65,9 @@ LOGICAL :: LLES_DOWNDRAFT ! flag to activate the computations in downdrafts LOGICAL :: LLES_SPECTRA ! flag to activate the spectra computations LOGICAL :: LLES_PDF ! flag to activate the pdf computations ! -INTEGER, DIMENSION(900) :: NLES_LEVELS ! model levels for LES comp. +INTEGER, DIMENSION(900) :: NLES_LEVELS ! physical model levels for LES comp. REAL, DIMENSION(900) :: XLES_ALTITUDES ! alt. levels for LES comp. -INTEGER, DIMENSION(900) :: NSPECTRA_LEVELS ! model levels for spectra comp. +INTEGER, DIMENSION(900) :: NSPECTRA_LEVELS ! physical model levels for spectra comp. REAL, DIMENSION(900) :: XSPECTRA_ALTITUDES ! alt. levels for spectra comp. ! INTEGER, DIMENSION( 10) :: NLES_TEMP_SERIE_I ! I, J and Z point @@ -82,7 +83,7 @@ REAL :: XLES_TEMP_MEAN_END ! for start and end of the temporal averaged comp. REAL :: XLES_TEMP_MEAN_STEP ! time step for each averaging LOGICAL :: LLES_CART_MASK ! flag to use a cartesian mask -INTEGER :: NLES_IINF ! definition of the cartesians mask +INTEGER :: NLES_IINF ! definition of the cartesians mask in physical domain INTEGER :: NLES_ISUP ! for NLES_CART_MODNBR model INTEGER :: NLES_JINF ! " INTEGER :: NLES_JSUP ! " @@ -95,7 +96,7 @@ INTEGER :: NPDF ! number of pdf intervals ! !------------------------------------------------------------------------------- ! -INTEGER, DIMENSION(JPMODELMAX) :: NLESn_IINF ! definition of the cartesians mask +INTEGER, DIMENSION(JPMODELMAX) :: NLESn_IINF ! definition of the cartesians mask in physical domain INTEGER, DIMENSION(JPMODELMAX) :: NLESn_ISUP ! for all models INTEGER, DIMENSION(JPMODELMAX) :: NLESn_JINF ! " INTEGER, DIMENSION(JPMODELMAX) :: NLESn_JSUP ! " @@ -138,7 +139,7 @@ INTEGER :: NLES_CURRENT_TIMES ! current model NLES_TIMES (number of LES samplings) ! INTEGER :: NLES_CURRENT_IINF, NLES_CURRENT_ISUP, NLES_CURRENT_JINF, NLES_CURRENT_JSUP -! coordinates for write_diachro, set to NLESn_IINF(current model), etc... +! coordinates (in physical domain) for write_diachro, set to NLESn_IINF(current model), etc... ! REAL :: XLES_CURRENT_DOMEGAX, XLES_CURRENT_DOMEGAY ! minimum wavelength in spectra analysis diff --git a/src/MNH/spec_ver_int.f90 b/src/MNH/spec_ver_int.f90 index 5c7f1df0134ab9093a94c9ebb931e773bc1b6bdd..c09b57ffdfcc749dba786f4d11c2d47feb42ffe7 100644 --- a/src/MNH/spec_ver_int.f90 +++ b/src/MNH/spec_ver_int.f90 @@ -52,6 +52,7 @@ END MODULE MODI_SPEC_VER_INT !! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O ! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg ! P. Wautelet 05/01/2021: bugfix: CSPECTRA_LEVEL_TYPE='Z' computation was wrong +! P. Wautelet 30/03/2021: budgets: LES cartesian subdomain limits are defined in the physical domain ! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -96,7 +97,7 @@ IF (CSPECTRA_LEVEL_TYPE=='N') THEN RETURN ELSE IF (CSPECTRA_LEVEL_TYPE=='K') THEN DO JK = 1, NSPECTRA_K - ZA(:,:,JK) = PA_MNH(:,:,NSPECTRA_LEVELS(JK)) + ZA(:,:,JK) = PA_MNH(:,:,NSPECTRA_LEVELS(JK) + JPVEXT) END DO ELSE IF (CSPECTRA_LEVEL_TYPE=='Z') THEN ZA(:,:,:) = VER_INTERP_LIN(PA_MNH,NKLIN_CURRENT_SPEC,XCOEFLIN_CURRENT_SPEC) @@ -121,7 +122,7 @@ CALL GATHERALL_FIELD_ll('XY',ZA,ZA_ll,IRESP) ! !------------------------------------------------------------------------------- ! -PA_SPEC(:,:,:) = ZA_ll(NLESn_IINF(KMI):NLESn_ISUP(KMI),NLESn_JINF(KMI):NLESn_JSUP(KMI),:) +PA_SPEC(:,:,:) = ZA_ll(NLESn_IINF(KMI)+JPHEXT:NLESn_ISUP(KMI)+JPHEXT,NLESn_JINF(KMI)+JPHEXT:NLESn_JSUP(KMI)+JPHEXT,:) ! DO JK=1,SIZE(PA_SPEC,3) ZA_MEAN(JK) = SUM(PA_SPEC(:,:,JK)) / SIZE(PA_SPEC(:,:,JK)) diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90 index 50d7f1e446ea3b83fcec0338853eae7e9281f966..77c2c8eb61d7c7fa4e4f7c24ed161c6582b756c1 100644 --- a/src/MNH/write_diachro.f90 +++ b/src/MNH/write_diachro.f90 @@ -539,8 +539,9 @@ ELSE IF ( tpbudiachro%ctype == 'TLES' ) THEN TZFIELD%NTYPE = TYPEREAL TZFIELD%NDIMS = 3 TZFIELD%LTIMEDEP = .FALSE. + !TRAJX is given in extended domain coordinates (=> +jphext) for backward compatibility CALL IO_Field_write(tzfile,TZFIELD, Reshape( & - Spread( source = ( nles_current_iinf + nles_current_isup) / 2, dim = 1, ncopies = IN ), & + Spread( source = ( nles_current_iinf + nles_current_isup) / 2 + jphext, dim = 1, ncopies = IN ), & [1, 1, IN] ) ) ENDIF ! @@ -569,8 +570,9 @@ ELSE IF ( tpbudiachro%ctype == 'TLES' ) THEN TZFIELD%NTYPE = TYPEREAL TZFIELD%NDIMS = 3 TZFIELD%LTIMEDEP = .FALSE. + !TRAJY is given in extended domain coordinates (=> +jphext) for backward compatibility CALL IO_Field_write(tzfile,TZFIELD, Reshape( & - Spread( source = ( nles_current_jinf + nles_current_jsup) / 2, dim = 1, ncopies = IN ), & + Spread( source = ( nles_current_jinf + nles_current_jsup) / 2 + jphext, dim = 1, ncopies = IN ), & [1, 1, IN] ) ) ENDIF ! @@ -765,27 +767,27 @@ MASTER: if ( isp == tzfile%nmaster_rank) then call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'type for '//trim(ygroup)//' group' ) if ( trim ( ytype ) == 'CART' .or. trim ( ytype ) == 'MASK' .or. trim ( ytype ) == 'SPXY') then - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min x index', iil ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min x index in physical domain', iil ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min x index for '//trim(ygroup)//' group' ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max x index', iih ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max x index in physical domain', iih ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max x index for '//trim(ygroup)//' group' ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min y index', ijl ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min y index in physical domain', ijl ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min y index for '//trim(ygroup)//' group' ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max y index', ijh ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max y index in physical domain', ijh ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max y index for '//trim(ygroup)//' group' ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min z index', ikl ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min z index in physical domain', ikl ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min z index for '//trim(ygroup)//' group' ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max z index', ikh ) + istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max z index in physical domain', ikh ) if (istatus /= NF90_NOERR ) & call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max z index for '//trim(ygroup)//' group' ) end if