aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--schedule.ccl2
-rw-r--r--src/GRHydro_ENOReconstruct.F907
2 files changed, 7 insertions, 2 deletions
diff --git a/schedule.ccl b/schedule.ccl
index 311dcf4..409f216 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -377,11 +377,13 @@ if (CCTK_Equals(recon_method,"eno"))
schedule GRHydro_ENOSetup AT CCTK_Basegrid
{
+ OPTIONS: global
LANG:Fortran
} "Coefficients for ENO reconstruction"
schedule GRHydro_ENOShutdown AT CCTK_Terminate BEFORE Driver_Terminate
{
+ OPTIONS: global
LANG:Fortran
} "Deallocate ENO coefficients"
diff --git a/src/GRHydro_ENOReconstruct.F90 b/src/GRHydro_ENOReconstruct.F90
index a4a9e10..904181e 100644
--- a/src/GRHydro_ENOReconstruct.F90
+++ b/src/GRHydro_ENOReconstruct.F90
@@ -128,8 +128,11 @@ subroutine GRHydro_ENOShutdown(CCTK_ARGUMENTS)
CCTK_INT :: deallocstat
- deallocate(eno_coeffs, STAT = deallocstat)
- if (deallocstat .ne. 0) call CCTK_WARN(0, "Failed to deallocate ENO coefficients.")
+ if(coeffs_allocated) then
+ deallocate(eno_coeffs, STAT = deallocstat)
+ if (deallocstat .ne. 0) call CCTK_WARN(0, "Failed to deallocate ENO coefficients.")
+ coeffs_allocated = .false.
+ endif
end subroutine GRHydro_ENOShutdown