STATISTICS: Fix bug in integrating the injected energy and rate.
The injected energy and rate were added to the global array within the loop over the blocks, essentially multiplying the energy by the number of blocks for each process. This fix moves the injected energy accounting out of the loop over the blocks. Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
403a1e2f3f
commit
9ae03a4998
@ -1199,13 +1199,6 @@ module statistics
|
|||||||
|
|
||||||
end if ! track conservation
|
end if ! track conservation
|
||||||
|
|
||||||
! sum up the injected energy and injection rate
|
|
||||||
!
|
|
||||||
if (forcing_enabled) then
|
|
||||||
lint(29) = einj
|
|
||||||
lint(30) = rinj
|
|
||||||
end if
|
|
||||||
|
|
||||||
gint = gint + lint
|
gint = gint + lint
|
||||||
gavg = gavg + lavg
|
gavg = gavg + lavg
|
||||||
gmin = min(gmin, lmin)
|
gmin = min(gmin, lmin)
|
||||||
@ -1217,6 +1210,13 @@ module statistics
|
|||||||
work_in_use(nt) = .false.
|
work_in_use(nt) = .false.
|
||||||
!$omp end parallel
|
!$omp end parallel
|
||||||
|
|
||||||
|
! sum up the injected energy and injection rate
|
||||||
|
!
|
||||||
|
if (forcing_enabled) then
|
||||||
|
gint(29) = gint(29) + einj
|
||||||
|
gint(30) = gint(30) + rinj
|
||||||
|
end if
|
||||||
|
|
||||||
#ifdef MPI
|
#ifdef MPI
|
||||||
! sum the integral array from all processes
|
! sum the integral array from all processes
|
||||||
!
|
!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user