deallocating already allocated arrays in case of regridding/restarting (i.e. when calling init more than once)

This commit is contained in:
Martin Diehl 2012-07-31 14:00:15 +00:00
parent f3567e3087
commit 5a89c783d4
1 changed files with 24 additions and 12 deletions

View File

@ -142,16 +142,28 @@ subroutine debug_init
#include "compilation_info.f90" #include "compilation_info.f90"
!$OMP END CRITICAL (write2out) !$OMP END CRITICAL (write2out)
if (allocated(debug_StressLoopDistribution)) &
deallocate(debug_StressLoopDistribution)
allocate(debug_StressLoopDistribution(nStress,2)) allocate(debug_StressLoopDistribution(nStress,2))
debug_StressLoopDistribution = 0_pInt debug_StressLoopDistribution = 0_pInt
if (allocated(debug_LeapfrogBreakDistribution)) &
deallocate(debug_LeapfrogBreakDistribution)
allocate(debug_LeapfrogBreakDistribution(nStress,2)) allocate(debug_LeapfrogBreakDistribution(nStress,2))
debug_LeapfrogBreakDistribution = 0_pInt debug_LeapfrogBreakDistribution = 0_pInt
if (allocated(debug_StateLoopDistribution)) &
deallocate(debug_StateLoopDistribution)
allocate(debug_StateLoopDistribution(nState,2)) allocate(debug_StateLoopDistribution(nState,2))
debug_StateLoopDistribution = 0_pInt debug_StateLoopDistribution = 0_pInt
if (allocated(debug_CrystalliteLoopDistribution)) &
deallocate(debug_CrystalliteLoopDistribution)
allocate(debug_CrystalliteLoopDistribution(nCryst+1)) allocate(debug_CrystalliteLoopDistribution(nCryst+1))
debug_CrystalliteLoopDistribution = 0_pInt debug_CrystalliteLoopDistribution = 0_pInt
if (allocated(debug_MaterialpointStateLoopDistribution)) &
deallocate(debug_MaterialpointStateLoopDistribution)
allocate(debug_MaterialpointStateLoopDistribution(nMPstate)) allocate(debug_MaterialpointStateLoopDistribution(nMPstate))
debug_MaterialpointStateLoopDistribution = 0_pInt debug_MaterialpointStateLoopDistribution = 0_pInt
if (allocated(debug_MaterialpointLoopDistribution)) &
deallocate(debug_MaterialpointLoopDistribution)
allocate(debug_MaterialpointLoopDistribution(nHomog+1)) allocate(debug_MaterialpointLoopDistribution(nHomog+1))
debug_MaterialpointLoopDistribution = 0_pInt debug_MaterialpointLoopDistribution = 0_pInt