From e107a5e0043508d4d94c2999eaf59f22828f9312 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 17 May 2018 19:46:38 +0200 Subject: [PATCH] exception in function math_expand in module math.f90 --- src/math.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/math.f90 b/src/math.f90 index 7e35ca390..436c60b81 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -82,6 +82,7 @@ module math math_crossproduct, & math_tensorproduct33, & math_mul3x3, & + math_expand, & math_mul6x6, & math_mul33xx33, & math_mul3333xx33, & @@ -384,7 +385,8 @@ pure function math_expand(what,how) integer(pInt), dimension(:), intent(in) :: how real(pReal), dimension(sum(how)) :: math_expand integer(pInt) :: i - + if(sum(how)==0) & + 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