diff --git a/src/MNH/budget.f90 b/src/MNH/budget.f90 index ef8c992246eac4d00582f608d63869e3c477d212..e98d8652d6eac251456ef6dace4631db9615b4c4 100644 --- a/src/MNH/budget.f90 +++ b/src/MNH/budget.f90 @@ -48,6 +48,8 @@ subroutine Budget_store_init( tpbudget, hsource, pvars ) allocate( tpbudget%xtmplesstore( Size( pvars, 1 ), Size( pvars, 2 ), Size ( pvars, 3 ) ) ) end if tpbudget%xtmplesstore(:, :, :) = pvars(:, :, :) + + tpbudget%clessource = hsource end if ! Nothing else to do if budgets are not enabled @@ -106,6 +108,12 @@ subroutine Budget_store_end( tpbudget, hsource, pvars ) call Print_msg( NVERB_DEBUG, 'BUD', 'Budget_store_end', trim( tpbudget%cname )//':'//trim( hsource ) ) if ( lles_call ) then + if ( hsource /= tpbudget%clessource ) & + call Print_msg( NVERB_FATAL, 'BUD', 'Budget_store_end', 'hsource not the same as in Budget_store_init (' & + // Trim( hsource ) // ' / ' // Trim( tpbudget%clessource ) // ')' ) + + tpbudget%clessource = 'reset' + if ( allocated( tpbudget%xtmplesstore ) ) then ! Do the call to Les_budget with oadd=.true. ! This is necessary when the call to Budget_store_init was done with pvars not strictly diff --git a/src/MNH/modd_budget.f90 b/src/MNH/modd_budget.f90 index abb8a950c679c498375b45b7352f82b177e15c2e..99154b8e001c7f21e0072428c399d448be7a35f6 100644 --- a/src/MNH/modd_budget.f90 +++ b/src/MNH/modd_budget.f90 @@ -55,6 +55,7 @@ ! P. Wautelet 23/04/2020: add nid in tbudgetdata datatype ! P. Wautelet 30/06/2020: add NNETURSV, NNEADVSV and NNECONSV variables ! P. Wautelet 17/08/2020: add xtmplesstore in tbudgetdata datatype +! P. Wautelet 08/10/2020: add clessource in tbudgetdata datatype !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -88,6 +89,7 @@ integer :: nbudgets ! Number of budget categories type tbudgetdata character(len=NBUNAMELGTMAX) :: cname = '' character(len=NCOMMENTLGTMAX) :: ccomment = '' + character(len=100) :: clessource = '' ! Last source stored integer :: nid = -1 !Identifier number (based on parameters NBUDGET_*) integer :: ngroups = 0 !Number of groups of source terms to store integer :: nsources = 0 !Number of source terms