diff --git a/src/api.F90 b/src/api.F90 index f45ffb235..640ad910a 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -84,6 +84,9 @@ contains subroutine free_memory_bank() bind(C) end subroutine free_memory_bank + + subroutine free_memory_cmfd() bind(C) + end subroutine free_memory_cmfd end interface call free_memory_geometry() @@ -101,6 +104,7 @@ contains call free_memory_tally_filter() call free_memory_tally_derivative() call free_memory_bank() + call free_memory_cmfd() #ifdef DAGMC call free_memory_dagmc() #endif diff --git a/src/cmfd_solver.cpp b/src/cmfd_solver.cpp index 8f2091796..1d5d1bc44 100644 --- a/src/cmfd_solver.cpp +++ b/src/cmfd_solver.cpp @@ -348,5 +348,15 @@ int openmc_run_linsolver(const double* A_data, const double* b, double* x, } } +//============================================================================== +// Fortran compatibility +//============================================================================== + +extern "C" void free_memory_cmfd() +{ + cmfd::indptr.clear(); + cmfd::indices.clear(); +} + } // namespace openmc \ No newline at end of file