diff --git a/src/MNH/ini_budget.f90 b/src/MNH/ini_budget.f90 index d5918cc5a8b7449a18a395d1099d14d1ff01f621..b282ed84b6f7814f43cf466e150ae94f1ad01d64 100644 --- a/src/MNH/ini_budget.f90 +++ b/src/MNH/ini_budget.f90 @@ -2815,6 +2815,11 @@ SV_BUDGETS: do jsv = 1, ksv tzsource%clongname = 'total advection' call Budget_source_add( tbudgets(ibudget), tzsource, gcond, nadvsv ) + gcond = .true. + tzsource%cmnhname = 'NEGA2' + tzsource%clongname = 'negative correction' + call Budget_source_add( tbudgets(ibudget), tzsource, gcond, nnega2sv ) + ! Add specific source terms to different scalar variables igroup = 1 SV_VAR: if ( jsv <= nsv_user ) then diff --git a/src/MNH/modd_budget.f90 b/src/MNH/modd_budget.f90 index 9c5b03aba683a8280ecc884e8532e8c3f7b9db67..6b883941bf2b80a7e408fdf59d692806277fe993 100644 --- a/src/MNH/modd_budget.f90 +++ b/src/MNH/modd_budget.f90 @@ -636,6 +636,7 @@ INTEGER, SAVE :: NNEGASV = 0 ! negative correction INTEGER, SAVE :: NNETURSV = 0 ! negative correction INTEGER, SAVE :: NNEADVSV = 0 ! negative correction INTEGER, SAVE :: NNECONSV = 0 ! negative correction +INTEGER, SAVE :: NNEGA2SV = 0 ! negative correction ! ! Allowed processes for the budget of electric charge carried by water vapor INTEGER, SAVE :: NDRIFTQV = 0 diff --git a/src/MNH/modeln.f90 b/src/MNH/modeln.f90 index e80725a5970031a553f0cc6c22ea706d07e821b7..2121c0f632b351c0bbee84c381efb3b824bdbb38 100644 --- a/src/MNH/modeln.f90 +++ b/src/MNH/modeln.f90 @@ -268,6 +268,7 @@ END MODULE MODI_MODEL_n ! J. Escobar 27/09/2019: add missing report timing of RESOLVED_ELEC ! P. Wautelet 02-03/2020: use the new data structures and subroutines for budgets ! P. Wautelet 12/10/2020: Write_les_n: remove HLES_AVG dummy argument and group all 4 calls +! P. Wautelet 19/02/2021: add NEGA2 term for SV budgets !!------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -354,7 +355,7 @@ USE MODD_TURB_CLOUD, ONLY: NMODEL_CLOUD,CTURBLEN_CLOUD,XCEI USE MODD_TURB_n USE MODD_VISCOSITY ! -use mode_budget, only: Budget_store_init +use mode_budget, only: Budget_store_init, Budget_store_end USE MODE_DATETIME USE MODE_ELEC_ll USE MODE_GRIDCART @@ -1215,7 +1216,13 @@ IF ( LNUMDIFU .OR. LNUMDIFTH .OR. LNUMDIFSV ) THEN LZDIFFU,LNUMDIFU, LNUMDIFTH, LNUMDIFSV, & THALO2T_ll, TLSHALO2_ll,XZDIFFU_HALO2 ) END IF -! + +if ( lbudget_sv ) then + do jsv = 1, nsv + call Budget_store_init( tbudgets(jsv + NBUDGET_SV1 - 1), 'NEGA2', xrsvs(:, :, :, jsv) ) + end do +end if + DO JSV = NSV_CHEMBEG,NSV_CHEMEND XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.) END DO @@ -1261,6 +1268,12 @@ IF (CELEC .NE. 'NONE') THEN XRSVS(:,:,:,NSV_ELECBEG) = MAX(XRSVS(:,:,:,NSV_ELECBEG),0.) XRSVS(:,:,:,NSV_ELECEND) = MAX(XRSVS(:,:,:,NSV_ELECEND),0.) END IF + +if ( lbudget_sv ) then + do jsv = 1, nsv + call Budget_store_end( tbudgets(jsv + NBUDGET_SV1 - 1), 'NEGA2', xrsvs(:, :, :, jsv) ) + end do +end if ! CALL SECOND_MNH2(ZTIME2) ! diff --git a/src/MNH/modn_budget.f90 b/src/MNH/modn_budget.f90 index 85396d8e05241411fd24169db8d4581749b9b9f0..d433f3809d4d3fed32ff5ce6cc34ba7054eebdd3 100644 --- a/src/MNH/modn_budget.f90 +++ b/src/MNH/modn_budget.f90 @@ -305,9 +305,9 @@ NAMELIST/NAM_BU_RRH/LBU_RRH, NASSERH, NNESTRH, NADVRH, NFRCRH, & NCORRRH, NHGCVRH, NGHCVRH, NCOHGRH, NHMLTRH, & NNETURRH, NNEADVRH, NNECONRH, NVISCRH ! -NAMELIST/NAM_BU_RSV/ LBU_RSV, NASSESV, NNESTSV, NADVSV, NFRCSV, & - NDIFSV, NRELSV, NDCONVSV, NVTURBSV, NHTURBSV, NCHEMSV, NMAFLSV, & - NVISCSV, NNEGASV, NNETURSV, NNEADVSV, NNECONSV, & +NAMELIST/NAM_BU_RSV/ LBU_RSV, NASSESV, NNESTSV, NADVSV, NFRCSV, & + NDIFSV, NRELSV, NDCONVSV, NVTURBSV, NHTURBSV, NCHEMSV, NMAFLSV, & + NVISCSV, NNEGASV, NNETURSV, NNEADVSV, NNECONSV, NNEGA2SV, & NDRIFTQV, NCORAYQV, NDEPSQV, NDEPGQV, NREVAQV, NCDEPIQV, NNEUTQV, & NHONQC, NAUTOQC, NACCRQC, NRIMQC, NWETGQC, NDRYGQC, NINCGQC, NWETHQC, & NIMLTQC, NBERFIQC, NSEDIQC, NCDEPIQC, NNEUTQC, &