diff --git a/src/material.f90 b/src/material.f90 index 76753273c..2d3079030 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -970,7 +970,8 @@ end subroutine material_allocatePlasticState !-------------------------------------------------------------------------------------------------- !> @brief allocates the source state of a phase !-------------------------------------------------------------------------------------------------- -subroutine material_allocateSourceState(phase,of,NofMyPhase,sizeState) +subroutine material_allocateSourceState(phase,of,NofMyPhase,& + sizeState,sizeDotState,sizeDeltaState) use numerics, only: & numerics_integrator2 => numerics_integrator ! compatibility hack @@ -979,13 +980,14 @@ subroutine material_allocateSourceState(phase,of,NofMyPhase,sizeState) phase, & of, & NofMyPhase, & - sizeState + sizeState, sizeDotState,sizeDeltaState integer(pInt) :: numerics_integrator ! compatibility hack numerics_integrator = numerics_integrator2(1) ! compatibility hack sourceState(phase)%p(of)%sizeState = sizeState - sourceState(phase)%p(of)%sizeDotState = sizeState - sourceState(phase)%p(of)%sizeDeltaState = 0_pInt + sourceState(phase)%p(of)%sizeDotState = sizeDotState + sourceState(phase)%p(of)%sizeDeltaState = sizeDeltaState + plasticState(phase)%offsetDeltaState = sizeState-sizeDeltaState ! deltaState occupies latter part of state by definition allocate(sourceState(phase)%p(of)%aTolState (sizeState), source=0.0_pReal) allocate(sourceState(phase)%p(of)%state0 (sizeState,NofMyPhase), source=0.0_pReal) @@ -993,17 +995,17 @@ subroutine material_allocateSourceState(phase,of,NofMyPhase,sizeState) allocate(sourceState(phase)%p(of)%subState0 (sizeState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(of)%state (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(of)%dotState (sizeState,NofMyPhase), source=0.0_pReal) + allocate(sourceState(phase)%p(of)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) if (numerics_integrator == 1_pInt) then - allocate(sourceState(phase)%p(of)%previousDotState (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(of)%previousDotState2 (sizeState,NofMyPhase), source=0.0_pReal) + allocate(sourceState(phase)%p(of)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) + allocate(sourceState(phase)%p(of)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) endif if (numerics_integrator == 4_pInt) & - allocate(sourceState(phase)%p(of)%RK4dotState (sizeState,NofMyPhase), source=0.0_pReal) + allocate(sourceState(phase)%p(of)%RK4dotState (sizeDotState,NofMyPhase), source=0.0_pReal) if (numerics_integrator == 5_pInt) & - allocate(sourceState(phase)%p(of)%RKCK45dotState (6,sizeState,NofMyPhase), source=0.0_pReal) + allocate(sourceState(phase)%p(of)%RKCK45dotState (6,sizeDotState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%deltaState (0,NofMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) end subroutine material_allocateSourceState diff --git a/src/source_damage_anisoBrittle.f90 b/src/source_damage_anisoBrittle.f90 index e218730d5..5f915c5bc 100644 --- a/src/source_damage_anisoBrittle.f90 +++ b/src/source_damage_anisoBrittle.f90 @@ -192,7 +192,7 @@ subroutine source_damage_anisoBrittle_init sourceOffset = source_damage_anisoBrittle_offset(phase) - call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt) + call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt,1_pInt,0_pInt) sourceState(phase)%p(sourceOffset)%sizePostResults = sum(source_damage_anisoBrittle_sizePostResult(:,instance)) sourceState(phase)%p(sourceOffset)%aTolState=param(instance)%aTol diff --git a/src/source_damage_anisoDuctile.f90 b/src/source_damage_anisoDuctile.f90 index 66960ad01..c4c26b9f9 100644 --- a/src/source_damage_anisoDuctile.f90 +++ b/src/source_damage_anisoDuctile.f90 @@ -188,7 +188,7 @@ subroutine source_damage_anisoDuctile_init instance = source_damage_anisoDuctile_instance(phase) sourceOffset = source_damage_anisoDuctile_offset(phase) - call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt) + call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt,1_pInt,0_pInt) sourceState(phase)%p(sourceOffset)%sizePostResults = sum(source_damage_anisoDuctile_sizePostResult(:,instance)) sourceState(phase)%p(sourceOffset)%aTolState=param(instance)%aTol diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index f94a568c9..ae0f2a0d2 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -164,7 +164,7 @@ subroutine source_damage_isoBrittle_init instance = source_damage_isoBrittle_instance(phase) sourceOffset = source_damage_isoBrittle_offset(phase) - call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt) + call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt,1_pInt,1_pInt) sourceState(phase)%p(sourceOffset)%sizePostResults = sum(source_damage_isoBrittle_sizePostResult(:,instance)) sourceState(phase)%p(sourceOffset)%aTolState=param(instance)%aTol diff --git a/src/source_damage_isoDuctile.f90 b/src/source_damage_isoDuctile.f90 index ffc4408f8..26d97e1fb 100644 --- a/src/source_damage_isoDuctile.f90 +++ b/src/source_damage_isoDuctile.f90 @@ -83,7 +83,7 @@ subroutine source_damage_isoDuctile_init implicit none - integer(pInt) :: Ninstance,phase,instance,source,sourceOffset,o + integer(pInt) :: Ninstance,phase,instance,source,sourceOffset integer(pInt) :: NofMyPhase,p,i character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] integer(kind(undefined_ID)) :: & @@ -164,7 +164,7 @@ subroutine source_damage_isoDuctile_init instance = source_damage_isoDuctile_instance(phase) sourceOffset = source_damage_isoDuctile_offset(phase) - call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt) + call material_allocateSourceState(phase,sourceOffset,NofMyPhase,1_pInt,1_pInt,0_pInt) sourceState(phase)%p(sourceOffset)%sizePostResults = sum(source_damage_isoDuctile_sizePostResult(:,instance)) sourceState(phase)%p(sourceOffset)%aTolState=param(instance)%aTol