diff --git a/src/MNH/end_mask_compress.f90 b/src/MNH/end_mask_compress.f90 index 448d38e47123e85ce6031f4e6d51fe85611f1b36..cd867dccb817d24f0253393f16fcc55d84a64eaf 100644 --- a/src/MNH/end_mask_compress.f90 +++ b/src/MNH/end_mask_compress.f90 @@ -1,13 +1,8 @@ -!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1999-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. !----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ -! MASDEV4_7 budget 2006/05/18 13:07:25 -!----------------------------------------------------------------- !############################# MODULE MODI_END_MASK_COMPRESS !############################# @@ -19,7 +14,7 @@ FUNCTION END_MASK_COMPRESS(PVARS) RESULT(PCOMPRESS) USE MODD_BUDGET ! REAL, DIMENSION(:,:,:), INTENT(IN) :: PVARS ! Source -REAL, DIMENSION(NBUKMAX,NBUWRNB,NBUMASK) :: PCOMPRESS ! result +REAL, DIMENSION(NBUKMAX,nbusubwrite,NBUMASK) :: PCOMPRESS ! result ! END FUNCTION END_MASK_COMPRESS ! @@ -57,7 +52,7 @@ END MODULE MODI_END_MASK_COMPRESS !! LBU_KCP : switch for compression in K direction !! NBUKMAX : first dimension of the budget array ( number of grid points along !! K direction) -!! NBUWRNB : second dimension of the budget array ( number of buffered times) +!! nbusubwrite: second dimension of the budget array ( number of buffered times) !! NBUMASK : third dimension of the budget array ( number of mask zones) !! !! @@ -90,7 +85,7 @@ IMPLICIT NONE !* 0.1 Declarations of arguments and result : ! REAL, DIMENSION(:,:,:), INTENT(IN) :: PVARS ! Source -REAL, DIMENSION(NBUKMAX,NBUWRNB,NBUMASK) :: PCOMPRESS ! result +REAL, DIMENSION(NBUKMAX,nbusubwrite,NBUMASK) :: PCOMPRESS ! result ! !* 0.2 Declarations of local variables : ! @@ -108,7 +103,7 @@ INTEGER :: IINFO_ll ! return status code of the interface routines ! IF (LBU_KCP) THEN IF (CBUTYPE=='MASK' ) THEN - ALLOCATE(ZVAR2D(NBUWRNB,NBUMASK)) + ALLOCATE(ZVAR2D(nbusubwrite,NBUMASK)) ZVAR2D(:,:)=PVARS(1,:,:) ELSE ! the processor has a empty intersection with the MASK region ZVAR2D(:,:)=0. @@ -118,7 +113,7 @@ IF (LBU_KCP) THEN DEALLOCATE(ZVAR2D) ! ELSE IF (.NOT.LBU_KCP) THEN - ALLOCATE(ZVAR3D(NBUKMAX,NBUWRNB,NBUMASK)) + ALLOCATE(ZVAR3D(NBUKMAX,nbusubwrite,NBUMASK)) IF (CBUTYPE=='MASK' ) THEN ZVAR3D(:,:,:)=PVARS(:,:,:) ELSE ! the processor has a empty intersection with the MASK region diff --git a/src/MNH/endstep_budget.f90 b/src/MNH/endstep_budget.f90 index 20a580b3f975ad293ce53961d659864a93a320c4..a48e296d2a83c3ce293f67ef8a3dcf19254364cd 100644 --- a/src/MNH/endstep_budget.f90 +++ b/src/MNH/endstep_budget.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1995-2020 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. @@ -114,7 +114,7 @@ SELECT CASE(CBUTYPE) ! !* 1.1 storage of the budget fields ! - IF( MODULO(KTCOUNT,NBUSTEP*NBUWRNB) == 0 ) THEN + IF( MODULO(KTCOUNT,NBUSTEP*nbusubwrite) == 0 ) THEN call Write_budget( tpdiafile, tpdtcur, ptstep, ksv ) ! !* 1.2 resetting the budget arrays to 0. @@ -144,7 +144,7 @@ SELECT CASE(CBUTYPE) ! ----------- ! CASE('MASK') - IF( MODULO(KTCOUNT,NBUSTEP*NBUWRNB) == 0 ) THEN + IF( MODULO(KTCOUNT,NBUSTEP*nbusubwrite) == 0 ) THEN ! !* 2.1 storage of the budget fields ! diff --git a/src/MNH/ini_budget.f90 b/src/MNH/ini_budget.f90 index 4974859c9df3f159ff7623caf486e79a9dd1d598..e2b443feff06dfcff8014dfc37d9a862b64ce67e 100644 --- a/src/MNH/ini_budget.f90 +++ b/src/MNH/ini_budget.f90 @@ -298,7 +298,7 @@ INTEGER :: IBUDIM1 ! first dimension of t ! = NBUKMAX in MASK case INTEGER :: IBUDIM2 ! second dimension of the budget arrays ! = NBUJMAX in CART case - ! = NBUWRNB in MASK case + ! = nbusubwrite in MASK case INTEGER :: IBUDIM3 ! third dimension of the budget arrays ! = NBUKMAX in CART case ! = NBUMASK in MASK case @@ -339,11 +339,10 @@ if ( cbutype == 'CART' .or. cbutype == 'MASK' ) then call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xseglen is not a multiple of xbuwri' ) !Write cartesian budgets every xbulen time period (do not take xbuwri into account) - nbuwrnb = 1 xbuwri = xbulen - nbusubwrite = nbuwrnb !Number of budget time average periods for each write - nbutotwrite = nbuwrnb * Nint( xseglen / xbuwri ) !Total number of budget time average periods + nbusubwrite = 1 !Number of budget time average periods for each write + nbutotwrite = nbusubwrite * Nint( xseglen / xbulen ) !Total number of budget time average periods else if ( cbutype == 'MASK' ) then !Check if xbuwri is a multiple of xtstep (within tolerance) if ( Abs( Nint( xbuwri / xtstep ) * xtstep - xbuwri ) > ( ITOL * xtstep ) ) & @@ -357,11 +356,8 @@ if ( cbutype == 'CART' .or. cbutype == 'MASK' ) then if ( Abs( Nint( xseglen / xbuwri ) * xbuwri - xseglen ) > ( ITOL * xseglen ) ) & call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xseglen is not a multiple of xbuwri' ) - NBUWRNB = NINT (XBUWRI / XBULEN) ! only after NBUWRNB budget periods, we write the - ! result on the FM_FILE - - nbusubwrite = nbuwrnb !Number of budget time average periods for each write - nbutotwrite = nbuwrnb * Nint( xseglen / xbuwri ) !Total number of budget time average periods + nbusubwrite = Nint ( xbuwri / xbulen ) !Number of budget time average periods for each write + nbutotwrite = nbusubwrite * Nint( xseglen / xbuwri ) !Total number of budget time average periods end if end if @@ -412,7 +408,7 @@ ELSEIF (CBUTYPE=='MASK') THEN ! mask case only CALL GET_DIM_EXT_ll ('B', IIU,IJU) ALLOCATE( LBU_MASK( IIU ,IJU, NBUMASK) ) LBU_MASK(:,:,:)=.FALSE. - ALLOCATE( XBUSURF( IIU, IJU, NBUMASK, NBUWRNB) ) + ALLOCATE( XBUSURF( IIU, IJU, NBUMASK, nbusubwrite) ) XBUSURF(:,:,:,:) = 0. ! ! three first dimensions of budget arrays in mask case @@ -422,7 +418,7 @@ ELSEIF (CBUTYPE=='MASK') THEN ! mask case only ! second dimension of the arrays : number of the budget time period ! third dimension of the arrays : number of the budget masks zones IBUDIM1=NBUKMAX - IBUDIM2=NBUWRNB + IBUDIM2=nbusubwrite IBUDIM3=NBUMASK ! these variables are not used in this case NBUIMAX=-1 @@ -3747,7 +3743,7 @@ IF (CBUTYPE=='MASK') THEN WRITE(UNIT=KLUOUT, FMT= '("BUKL = ",I4.4)' ) NBUKL WRITE(UNIT=KLUOUT, FMT= '("BUKH = ",I4.4)' ) NBUKH WRITE(UNIT=KLUOUT, FMT= '("BUKMAX = ",I4.4)' ) NBUKMAX - WRITE(UNIT=KLUOUT, FMT= '("BUWRNB = ",I4.4)' ) NBUWRNB + WRITE(UNIT=KLUOUT, FMT= '("BUSUBWRITE = ",I4.4)' ) NBUSUBWRITE WRITE(UNIT=KLUOUT, FMT= '("BUMASK = ",I4.4)' ) NBUMASK END IF diff --git a/src/MNH/modd_budget.f90 b/src/MNH/modd_budget.f90 index d4f0da66364b0d72c065bf6de731dcc96a3c968e..df5876d809663d5d03d0c46d17bc83eacaa9cc81 100644 --- a/src/MNH/modd_budget.f90 +++ b/src/MNH/modd_budget.f90 @@ -57,6 +57,7 @@ ! P. Wautelet 17/08/2020: add xtmplesstore in tbudgetdata datatype ! P. Wautelet 08/10/2020: add clessource in tbudgetdata datatype ! P. Wautelet 08/12/2020: add nbusubwrite and nbutotwrite +! P. Wautelet 11/01/2021: remove nbuwrnb (replaced by nbusubwrite) !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -150,8 +151,6 @@ INTEGER, SAVE :: NBUSTEP ! number of model timesteps required ! for the budget time average REAL, SAVE :: XBUWRI ! period in seconds between ! budget writing for budget masks -INTEGER, SAVE :: NBUWRNB ! number of budget periods when storage - ! arrays are written on FM-files INTEGER, SAVE :: NBUTSHIFT ! temporal shift for budgets writing integer, save :: nbusubwrite = 0 ! Number of budget time average periods for each write integer, save :: nbutotwrite = 0 ! Total number of budget time average periods diff --git a/src/MNH/write_budget.f90 b/src/MNH/write_budget.f90 index 77a76c5e6d09957a6712edd180a9e5d9377f6431..7cbca7eeeb75de4183d08f63b84db65706619f8c 100644 --- a/src/MNH/write_budget.f90 +++ b/src/MNH/write_budget.f90 @@ -94,7 +94,7 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv ) !! !------------------------------------------------------------------------------- - use modd_budget, only: cbutype, nbumask, nbutshift, nbustep, nbuwrnb, xbulen, xbusurf, & + use modd_budget, only: cbutype, nbumask, nbutshift, nbustep, nbusubwrite, xbulen, xbusurf, & lbu_icp, lbu_jcp, & lbu_ru, lbu_rv, lbu_rw, lbu_rth, lbu_rtke, lbu_rrv, lbu_rrc, lbu_rrr, & lbu_rri, lbu_rrs, lbu_rrg, lbu_rrh, lbu_rsv, & @@ -205,19 +205,19 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv ) ! ----------- ! CASE('MASK') - ALLOCATE(ZWORKTEMP(NBUWRNB)) - allocate( tzdates(NBUWRNB) ) + ALLOCATE(ZWORKTEMP(nbusubwrite)) + allocate( tzdates(nbusubwrite) ) ! - CALL DATETIME_DISTANCE(TDTEXP,TPDTCUR,ZWORKTEMP(NBUWRNB)) + CALL DATETIME_DISTANCE(TDTEXP,TPDTCUR,ZWORKTEMP(nbusubwrite)) ! - ZWORKTEMP(NBUWRNB)=ZWORKTEMP(NBUWRNB)+(1.-NBUSTEP*0.5)*PTSTEP + ZWORKTEMP(nbusubwrite)=ZWORKTEMP(nbusubwrite)+(1.-NBUSTEP*0.5)*PTSTEP ! - tzdates(NBUWRNB)%nyear = tdtexp%nyear - tzdates(NBUWRNB)%nmonth = tdtexp%nmonth - tzdates(NBUWRNB)%nday = tdtexp%nday - tzdates(NBUWRNB)%xtime = tdtexp%xtime + zworktemp(NBUWRNB) - DO JT=1,NBUWRNB-1 - ZWORKTEMP(JT) = ZWORKTEMP(NBUWRNB)-NBUSTEP*PTSTEP*(NBUWRNB-JT) + tzdates(nbusubwrite)%nyear = tdtexp%nyear + tzdates(nbusubwrite)%nmonth = tdtexp%nmonth + tzdates(nbusubwrite)%nday = tdtexp%nday + tzdates(nbusubwrite)%xtime = tdtexp%xtime + zworktemp(nbusubwrite) + DO JT=1,nbusubwrite-1 + ZWORKTEMP(JT) = ZWORKTEMP(nbusubwrite)-NBUSTEP*PTSTEP*(nbusubwrite-JT) tzdates(jt)%nyear = tdtexp%nyear tzdates(jt)%nmonth = tdtexp%nmonth tzdates(jt)%nday = tdtexp%nday @@ -230,10 +230,10 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv ) ! #ifdef MNH_IOLFI if ( Trim( tpdiafile%cformat ) == 'LFI' .or. Trim( tpdiafile%cformat ) == 'LFICDF4' ) then - Allocate( zworkmask(Size( xbusurf, 1 ), Size( xbusurf, 2 ), 1, nbuwrnb, nbumask,1) ) + Allocate( zworkmask(Size( xbusurf, 1 ), Size( xbusurf, 2 ), 1, nbusubwrite, nbumask,1) ) ! local array do jmask = 1, nbumask - do jt = 1, nbuwrnb + do jt = 1, nbusubwrite zworkmask(:, :, 1, jt, jmask, 1) = xbusurf(:, :, jmask, jt) end do end do @@ -290,7 +290,7 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv ) if ( nbutshift == 1 ) call IO_Field_create( tzfile, tzfield ) !Write the data (partial write of the field with the given offset) - call IO_Field_write( tzfile, tzfield, xbusurf(:,:,:,:), koffset= [ 0, 0, 0, ( nbutshift - 1 ) * nbuwrnb ] ) + call IO_Field_write( tzfile, tzfield, xbusurf(:,:,:,:), koffset= [ 0, 0, 0, ( nbutshift - 1 ) * nbusubwrite ] ) if ( nbutshift == 1 ) call Menu_diachro( tzfile, 'MASKS' ) end if @@ -401,7 +401,7 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, tprhodj, kp, knocompress, p lbu_icp, lbu_jcp, lbu_kcp, & nbuil, nbuih, nbujl, nbujh, nbukl, nbukh, & nbuimax, nbuimax_ll, nbujmax, nbujmax_ll, nbukmax, nbutshift, & - nbumask, nbuwrnb, & + nbumask, nbusubwrite, & tburhodata, & NBUDGET_RHO, NBUDGET_U, NBUDGET_V, NBUDGET_W use modd_field, only: NMNHDIM_BUDGET_CART_NI, NMNHDIM_BUDGET_CART_NJ, NMNHDIM_BUDGET_CART_NI_U, & @@ -453,7 +453,7 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, tprhodj, kp, knocompress, p end if case('MASK') ybutype = 'MASK' - allocate( prhodjn(1, 1, nbukmax, nbuwrnb, nbumask, 1) ) + allocate( prhodjn(1, 1, nbukmax, nbusubwrite, nbumask, 1) ) prhodjn(1, 1, :, :, :, 1) = End_mask_compress( tprhodj%xdata(:, :, :) ) where ( prhodjn(1, 1, :, :, :, 1) <= 0. ) prhodjn(1, 1, :, :, :, 1) = XNEGUNDEF @@ -564,7 +564,7 @@ subroutine Store_one_budget( tpdiafile, tpdates, tpbudget, prhodjn, knocompress, lbu_icp, lbu_jcp, lbu_kcp, & nbuil, nbuih, nbujl, nbujh, nbukl, nbukh, & nbuimax, nbuimax_ll, nbujmax, nbujmax_ll, nbukmax, nbustep, nbutshift, & - nbumask, nbuwrnb, & + nbumask, nbusubwrite, & NBUDGET_U, NBUDGET_V, NBUDGET_W, NBUDGET_TH, NBUDGET_TKE, NBUDGET_RV, NBUDGET_RC, NBUDGET_RR, & NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, NBUDGET_SV1, & tbudgetdata, tbugroupdata @@ -646,7 +646,7 @@ subroutine Store_one_budget( tpdiafile, tpdates, tpbudget, prhodjn, knocompress, endif case('MASK') ybutype = 'MASK' - allocate( zworkt(1, 1, nbukmax, nbuwrnb, nbumask, igroups ) ) + allocate( zworkt(1, 1, nbukmax, nbusubwrite, nbumask, igroups ) ) do jproc = 1, igroups zworkt(1, 1, :, :, :, jproc) = End_mask_compress( tpbudget%tgroups(jproc)%xdata(:, :, :) ) & * zconvert(jproc) / prhodjn(1, 1, :, :, :, 1) diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90 index 535ca0bb0f23df2dd0c6c95c31ca63571a9c7a46..b6da5f403e76e07c5ae3a68880287fe871c55750 100644 --- a/src/MNH/write_diachro.f90 +++ b/src/MNH/write_diachro.f90 @@ -163,7 +163,7 @@ end subroutine Write_diachro subroutine Write_diachro_lfi( tpdiafile, tpfields, hgroup, htype, tpdates, pvar, oicp, ojcp, okcp, kil, kih, kjl, kjh, kkl, kkh, & ptrajx, ptrajy, ptrajz ) -use modd_budget, only: nbumask, nbutshift, nbuwrnb +use modd_budget, only: nbumask, nbutshift, nbusubwrite use modd_field, only: NMNHDIM_ONE, NMNHDIM_UNKNOWN, NMNHDIM_FLYER_TIME, NMNHDIM_NOTLISTED, NMNHDIM_UNUSED, & TYPECHAR, TYPEINT, TYPEREAL, & tfield_metadata_base, tfielddata @@ -280,7 +280,7 @@ IF(HTYPE == 'MASK')THEN IIMASK=IIMAX_ll + 2 * JPHEXT IJMASK=IJMAX_ll + 2 * JPHEXT IKMASK=1 - ITMASK=NBUWRNB + ITMASK=nbusubwrite INMASK=NBUMASK IPMASK=1 ENDIF