diff --git a/code/material.f90 b/code/material.f90 index 4b9974e11..5002a08e9 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -1261,9 +1261,8 @@ subroutine material_populateGrains textureOfGrain = 0_pInt orientationOfGrain = 0.0_pReal - grain = 0_pInt texture: do i = 1_pInt,myNconstituents ! loop over constituents - grain = grain + NgrainsOfConstituent(i-1_pInt) ! set microstructure grain index of current constituent + grain = sum(NgrainsOfConstituent(1_pInt:i-1_pInt)) ! set microstructure grain index of current constituent ! "grain" points to start of this constituent's grain population constituentGrain = 0_pInt ! constituent grain index