avoid uninitialized mem access

This commit is contained in:
Philip Eisenlohr 2023-09-17 15:08:54 -04:00 committed by Martin Diehl
parent 6d2b175018
commit 6a75a1ad23
1 changed files with 16 additions and 12 deletions

View File

@ -1364,7 +1364,7 @@ function crystal_SchmidMatrix_slip(Nslip,lattice,cOverA,nonSchmidCoefficients,se
integer, dimension(:), allocatable :: NslipMax integer, dimension(:), allocatable :: NslipMax
integer, dimension(:), allocatable :: slipFamily integer, dimension(:), allocatable :: slipFamily
real(pREAL), dimension(3) :: direction, normal, np real(pREAL), dimension(3) :: direction, normal, np
real(pREAL), dimension(:), allocatable :: coeff real(pREAL), dimension(6) :: coeff !< local nonSchmid coefficient variable
type(tRotation) :: R type(tRotation) :: R
integer :: i integer :: i
@ -1409,7 +1409,10 @@ function crystal_SchmidMatrix_slip(Nslip,lattice,cOverA,nonSchmidCoefficients,se
if (present(nonSchmidCoefficients)) then if (present(nonSchmidCoefficients)) then
select case(lattice) select case(lattice)
case('cI') case('cI')
coeff = nonSchmidCoefficients(slipFamily(i),:) coeff = 0.0_pREAL
coeff(:size(nonSchmidCoefficients(i,:))) = nonSchmidCoefficients(i,:)
select case(slipFamily(i))
case(1)
call R%fromAxisAngle([direction,60.0_pREAL],degrees=.true.,P=1) call R%fromAxisAngle([direction,60.0_pREAL],degrees=.true.,P=1)
np = R%rotate(normal) np = R%rotate(normal)
SchmidMatrix(1:3,1:3,i) = SchmidMatrix(1:3,1:3,i) & SchmidMatrix(1:3,1:3,i) = SchmidMatrix(1:3,1:3,i) &
@ -1421,6 +1424,7 @@ function crystal_SchmidMatrix_slip(Nslip,lattice,cOverA,nonSchmidCoefficients,se
math_cross(normal, direction)) & math_cross(normal, direction)) &
+ coeff(6) * math_outer(direction, direction) + coeff(6) * math_outer(direction, direction)
end select end select
end select
end if end if
end do end do