diff options
-rw-r--r-- | src/GRHydro_PPM.F90 | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/GRHydro_PPM.F90 b/src/GRHydro_PPM.F90 index dc40274..9a8a3ce 100644 --- a/src/GRHydro_PPM.F90 +++ b/src/GRHydro_PPM.F90 @@ -441,8 +441,8 @@ do i = GRHydro_stencil, nx - GRHydro_stencil + 1 !!$ Do not optimize cond away by combining the 'if's. Fortran does not !!$ have to follow the order of sub-expressions given here and might !!$ access outside the array range - cond = i .gt. 1 - if (cond .and. GRHydro_enable_internal_excision /= 0) then + cond = .false. + if (i .gt. 1 .and. GRHydro_enable_internal_excision /= 0) then cond = hydro_excision_mask(i-1) .ne. 0 end if if (cond) then @@ -469,9 +469,9 @@ do i = GRHydro_stencil, nx - GRHydro_stencil + 1 epsplus(i-1)=eps(i) end if else - cond = (i.gt.2) .and. (i.lt.nx) - if (cond .and. GRHydro_enable_internal_excision /= 0) then - cond = (ppm_mppm .eq. 0) .and. (hydro_excision_mask(i-2) .ne. 0) + cond = .false. + if ((i.gt.2) .and. (i.lt.nx) .and. GRHydro_enable_internal_excision /= 0) then + cond = (ppm_mppm .eq. 0) .and. (hydro_excision_mask(i-2) .ne. 0) end if if (cond) then call PPM_TVD(rho(i-1), rho(i), rho(i+1), rhominus(i), rhoplus(i)) @@ -483,9 +483,9 @@ do i = GRHydro_stencil, nx - GRHydro_stencil + 1 end if end if end if - cond = i.lt.nx - if (cond .and. GRHydro_enable_internal_excision /= 0) then - cond = hydro_excision_mask(i+1) .ne. 0 + cond = .false. + if (i .lt. nx .and. GRHydro_enable_internal_excision /= 0) then + cond = hydro_excision_mask(i+1) .ne. 0 end if if (cond) then rhominus(i)=rho(i) @@ -511,9 +511,9 @@ do i = GRHydro_stencil, nx - GRHydro_stencil + 1 epsplus(i+1)=eps(i) endif else - cond = (i.lt.nx-1) .and. (i.gt.1) - if (cond .and. GRHydro_enable_internal_excision /= 0) then - cond = (ppm_mppm .eq. 0) .and. (hydro_excision_mask(i+2) .ne. 0) + cond = .false. + if ((i.lt.nx-1) .and. (i.gt.1) .and. GRHydro_enable_internal_excision /= 0) then + cond = (ppm_mppm .eq. 0) .and. (hydro_excision_mask(i+2) .ne. 0) end if if (cond) then call PPM_TVD(rho(i-1), rho(i), rho(i+1), rhominus(i), rhoplus(i)) |