diff --git a/src/global.F90 b/src/global.F90 index 2f3f3fef49..ffe693eb6e 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -238,7 +238,21 @@ contains if (allocated(source_bank)) deallocate(source_bank) ! Deallocate cmfd -! if (allocated(cmfd)) deallocate(cmfd) + if (allocated(cmfd % totalxs)) deallocate(cmfd % totalxs) + if (allocated(cmfd % p1scattxs)) deallocate(cmfd % p1scattxs) + if (allocated(cmfd % scattxs)) deallocate(cmfd % scattxs) + if (allocated(cmfd % nfissxs)) deallocate(cmfd % nfissxs) + if (allocated(cmfd % diffcof)) deallocate(cmfd % diffcof) + if (allocated(cmfd % current)) deallocate(cmfd % current) + if (allocated(cmfd % flux)) deallocate(cmfd % flux) + if (allocated(cmfd % dtilde)) deallocate(cmfd % dtilde) + if (allocated(cmfd % dhat)) deallocate(cmfd % dhat) + if (allocated(cmfd % hxyz)) deallocate(cmfd % hxyz) + if (allocated(cmfd % coremap)) deallocate(cmfd % coremap) + if (allocated(cmfd % phi)) deallocate(cmfd % phi) + if (allocated(cmfd % sourcepdf)) deallocate(cmfd % sourcepdf) + if (allocated(cmfd % sourcecounts)) deallocate(cmfd % sourcecounts) + if (allocated(cmfd % weightfactors)) deallocate(cmfd % weightfactors) end subroutine free_memory diff --git a/src/initialize.F90 b/src/initialize.F90 index acb585c192..8a5a464b56 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -26,7 +26,7 @@ module initialize #endif #ifdef HDF5 - use hdf5_interface, only: hdf5_open_output, hdf5_write_summary + use hdf5_interface, only: hdf5_create_output, hdf5_write_summary #endif implicit none @@ -61,8 +61,8 @@ contains call create_summary_file() #ifdef HDF5 - ! Open HDF5 output file for writing - call hdf5_open_output() + ! Create HDF5 output file for writing + call hdf5_create_output() call hdf5_write_summary() #endif diff --git a/src/main.F90 b/src/main.F90 index 778bd62b6b..0781027698 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -52,6 +52,9 @@ program main ! run diffusion call cmfd_solver() + ! deallocate arrays + call free_memory() + ! terminate code stop