diff --git a/src/crystallite.f90 b/src/crystallite.f90 index dfabf51d6..821122c24 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -1535,6 +1535,13 @@ subroutine integrateStateRKCK45 plasticState(p)%dotState(:,c) = & matmul(B,plasticState(p)%RKCK45dotState(1:6,1:sizeDotState,c)) + plasticState(p)%state(1:sizeDotState,c) = plasticState(p)%subState0(1:sizeDotState,c) & + + plasticState(p)%dotState (1:sizeDotState,c) & + * crystallite_subdt(g,i,e) + crystallite_todo(g,i,e) = converged(residuum_plastic(1:sizeDotState,g,i,e), & + plasticState(p)%state(1:sizeDotState,c), & + plasticState(p)%atol(1:sizeDotState)) + do s = 1, phase_Nsources(p) sizeDotState = sourceState(p)%p(s)%sizeDotState sourceState(p)%p(s)%RKCK45dotState(6,:,c) = sourceState(p)%p(s)%dotState(:,c) @@ -1545,17 +1552,6 @@ subroutine integrateStateRKCK45 sourceState(p)%p(s)%dotState(:,c) = & matmul(B,sourceState(p)%p(s)%RKCK45dotState(1:6,1:sizeDotState,c)) - enddo - - sizeDotState = plasticState(p)%sizeDotState - plasticState(p)%state(1:sizeDotState,c) = plasticState(p)%subState0(1:sizeDotState,c) & - + plasticState(p)%dotState (1:sizeDotState,c) & - * crystallite_subdt(g,i,e) - crystallite_todo(g,i,e) = converged(residuum_plastic(1:sizeDotState,g,i,e), & - plasticState(p)%state(1:sizeDotState,c), & - plasticState(p)%atol(1:sizeDotState)) - do s = 1, phase_Nsources(p) - sizeDotState = sourceState(p)%p(s)%sizeDotState sourceState(p)%p(s)%state(1:sizeDotState,c) = sourceState(p)%p(s)%subState0(1:sizeDotState,c) & + sourceState(p)%p(s)%dotState (1:sizeDotState,c) & * crystallite_subdt(g,i,e)