diff --git a/src/Marc/materialpoint_Marc.f90 b/src/Marc/materialpoint_Marc.f90 index 4890d978e..01d28ec80 100644 --- a/src/Marc/materialpoint_Marc.f90 +++ b/src/Marc/materialpoint_Marc.f90 @@ -81,7 +81,9 @@ subroutine materialpoint_initAll() call phase_init() call homogenization_init() call materialpoint_init() - call config_deallocate() + call config_material_deallocate() + call config_numerics_deallocate() + end subroutine materialpoint_initAll diff --git a/src/config.f90 b/src/config.f90 index 0a7e522be..9840001ed 100644 --- a/src/config.f90 +++ b/src/config.f90 @@ -18,7 +18,8 @@ module config public :: & config_init, & - config_deallocate + config_material_deallocate,& + config_numerics_deallocate contains @@ -95,12 +96,24 @@ end subroutine parse_numerics !-------------------------------------------------------------------------------------------------- !> @brief Deallocate config_material. -!ToDo: deallocation of numerics (optional) !-------------------------------------------------------------------------------------------------- -subroutine config_deallocate +subroutine config_material_deallocate() + print'(/,1x,a)', 'deallocating material configuration'; flush(IO_STDOUT) deallocate(config_material) -end subroutine config_deallocate +end subroutine config_material_deallocate + +!-------------------------------------------------------------------------------------------------- +!> @brief Deallocate config_numerics if present. +!-------------------------------------------------------------------------------------------------- +subroutine config_numerics_deallocate() + + if (.not. associated(config_numerics, emptyDict)) then + print'(/,1x,a)', 'deallocating numerics configuration'; flush(IO_STDOUT) + deallocate(config_numerics) + end if + +end subroutine config_numerics_deallocate end module config diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index 399ca859c..c77832346 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -314,6 +314,7 @@ program DAMASK_grid !-------------------------------------------------------------------------------------------------- ! doing initialization depending on active solvers call spectral_Utilities_init() + do field = 2, nActiveFields select case (ID(field)) @@ -327,6 +328,7 @@ program DAMASK_grid end do call mechanical_init() + call config_numerics_deallocate() !-------------------------------------------------------------------------------------------------- ! write header of output file diff --git a/src/materialpoint.f90 b/src/materialpoint.f90 index 2490734be..e32f6b20c 100644 --- a/src/materialpoint.f90 +++ b/src/materialpoint.f90 @@ -72,7 +72,7 @@ subroutine materialpoint_initAll() call phase_init() call homogenization_init() call materialpoint_init() - call config_deallocate() + call config_material_deallocate() end subroutine materialpoint_initAll diff --git a/src/mesh/DAMASK_mesh.f90 b/src/mesh/DAMASK_mesh.f90 index c85b071e0..29014e49f 100644 --- a/src/mesh/DAMASK_mesh.f90 +++ b/src/mesh/DAMASK_mesh.f90 @@ -231,6 +231,7 @@ program DAMASK_mesh ! doing initialization depending on active solvers call FEM_Utilities_init() call FEM_mechanical_init(loadCases(1)%fieldBC(1)) + call config_numerics_deallocate() if (worldrank == 0) then open(newunit=statUnit,file=trim(getSolverJobName())//'.sta',form='FORMATTED',status='REPLACE')