diff options
Diffstat (limited to 'src/GRHydro_WENOReconstruct.F90')
-rw-r--r-- | src/GRHydro_WENOReconstruct.F90 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/GRHydro_WENOReconstruct.F90 b/src/GRHydro_WENOReconstruct.F90 index 5f368c0..64b5d18 100644 --- a/src/GRHydro_WENOReconstruct.F90 +++ b/src/GRHydro_WENOReconstruct.F90 @@ -42,13 +42,12 @@ subroutine GRHydro_WENOSetup(CCTK_ARGUMENTS) CCTK_INT :: allocstat - if(.not.coeffs_allocated) then + if(.not.allocated(weno_coeffs)) then ! uses weno_coeffs as a sentinel ! Right now we hardcode to 5th order allocate(weno_coeffs(3, 5), STAT=allocstat) if (allocstat .ne. 0) call CCTK_WARN(0, "Failed to allocate WENO coefficient arrays!") allocate(beta_shu(3, 6), STAT=allocstat) if (allocstat .ne. 0) call CCTK_WARN(0, "Failed to allocate smoothness indicator stencil coefficient arrays!") - coeffs_allocated = .true. endif ! Set stencils @@ -119,12 +118,11 @@ subroutine GRHydro_WENOShutdown(CCTK_ARGUMENTS) CCTK_INT :: deallocstat - if(coeffs_allocated) then + if(allocated(weno_coeffs)) then deallocate(weno_coeffs, STAT = deallocstat) if (deallocstat .ne. 0) call CCTK_WARN(0, "Failed to deallocate WENO coefficients.") deallocate(beta_shu, STAT = deallocstat) if (deallocstat .ne. 0) call CCTK_WARN(0, "Failed to deallocate shu smoothness indicator coefficients.") - coeffs_allocated = .false. endif end subroutine GRHydro_WENOShutdown |