INTEGRALS: Use 'magnetized' instead of 'ibx > 0'.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2019-03-08 07:03:39 -03:00
parent 055f67c874
commit 4b7615e72f

View File

@ -319,7 +319,7 @@ module integrals
use coordinates , only : advol, voli use coordinates , only : advol, voli
use equations , only : idn, ipr, ivx, ivy, ivz, ibx, iby, ibz, ibp use equations , only : idn, ipr, ivx, ivy, ivz, ibx, iby, ibz, ibp
use equations , only : ien, imx, imy, imz use equations , only : ien, imx, imy, imz
use equations , only : gamma, csnd use equations , only : magnetized, gamma, csnd
use evolution , only : step, time, dtn use evolution , only : step, time, dtn
use mpitools , only : master use mpitools , only : master
#ifdef MPI #ifdef MPI
@ -384,7 +384,7 @@ module integrals
mnarr(2) = 0.0d+00 mnarr(2) = 0.0d+00
mxarr(2) = 0.0d+00 mxarr(2) = 0.0d+00
end if end if
if (ibx < 1) then if (.not. magnetized) then
mnarr(4) = 0.0d+00 mnarr(4) = 0.0d+00
mxarr(4) = 0.0d+00 mxarr(4) = 0.0d+00
mnarr(5) = 0.0d+00 mnarr(5) = 0.0d+00
@ -446,7 +446,7 @@ module integrals
! sum up magnetic energy ! sum up magnetic energy
! !
if (ibx > 0) then if (magnetized) then
#if NDIMS == 3 #if NDIMS == 3
inarr(7) = inarr(7) + sum(pdata%u(ibx,nb:ne,nb:ne,nb:ne)**2 & inarr(7) = inarr(7) + sum(pdata%u(ibx,nb:ne,nb:ne,nb:ne)**2 &
+ pdata%u(iby,nb:ne,nb:ne,nb:ne)**2 & + pdata%u(iby,nb:ne,nb:ne,nb:ne)**2 &
@ -496,7 +496,7 @@ module integrals
! get average, minimum and maximum values of magnetic field amplitude, and ! get average, minimum and maximum values of magnetic field amplitude, and
! divergence potential ! divergence potential
! !
if (ibx > 0) then if (magnetized) then
#if NDIMS == 3 #if NDIMS == 3
mag(:,:,:) = sqrt(sum(pdata%q(ibx:ibz,nb:ne,nb:ne,nb:ne)**2, 1)) mag(:,:,:) = sqrt(sum(pdata%q(ibx:ibz,nb:ne,nb:ne,nb:ne)**2, 1))
#else /* NDIMS == 3 */ #else /* NDIMS == 3 */
@ -542,7 +542,7 @@ module integrals
! get average, minimum and maximum values of Alfvénic Mach number ! get average, minimum and maximum values of Alfvénic Mach number
! !
if (ibx > 0) then if (magnetized) then
tmp(:,:,:) = sqd(:,:,:) * vel(:,:,:) / max(eps, mag(:,:,:)) tmp(:,:,:) = sqd(:,:,:) * vel(:,:,:) / max(eps, mag(:,:,:))
avarr(7) = avarr(7) + sum(tmp(:,:,:)) * dvol avarr(7) = avarr(7) + sum(tmp(:,:,:)) * dvol
mnarr(7) = min(mnarr(7), minval(tmp(:,:,:))) mnarr(7) = min(mnarr(7), minval(tmp(:,:,:)))