From 235b2fe3c89ead13ecfac6f45240716d6d9d7dfd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 2 May 2018 16:44:27 +0200 Subject: [PATCH] ntwin = [0] cause problems math_expand now works for sum(how) == 0 --- src/math.f90 | 3 +++ src/plastic_phenopowerlaw.f90 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/math.f90 b/src/math.f90 index 4354354f7..82945a822 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -386,6 +386,9 @@ pure function math_expand(what,how) real(pReal), dimension(sum(how)) :: math_expand integer(pInt) :: i + if (sum(how) == 0_pInt) & + return + do i = 1_pInt, size(how) math_expand(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1_pInt,size(what))+1_pInt) enddo diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index f1d419c14..ab65490d1 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -202,7 +202,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) allocate(totalNslip(maxNinstance), source=0_pInt) allocate(totalNtwin(maxNinstance), source=0_pInt) - allocate(param(maxNinstance)) ! one container of parameters per instance + allocate(param(maxNinstance)) ! one container of parameters per instance rewind(fileUnit) phase = 0_pInt