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,17 +1409,21 @@ 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
call R%fromAxisAngle([direction,60.0_pREAL],degrees=.true.,P=1) coeff(:size(nonSchmidCoefficients(i,:))) = nonSchmidCoefficients(i,:)
np = R%rotate(normal) select case(slipFamily(i))
SchmidMatrix(1:3,1:3,i) = SchmidMatrix(1:3,1:3,i) & case(1)
+ coeff(1) * math_outer(direction, np) & call R%fromAxisAngle([direction,60.0_pREAL],degrees=.true.,P=1)
+ coeff(2) * math_outer(math_cross(normal, direction), normal) & np = R%rotate(normal)
+ coeff(3) * math_outer(math_cross(np, direction), np) & SchmidMatrix(1:3,1:3,i) = SchmidMatrix(1:3,1:3,i) &
+ coeff(4) * math_outer(normal, normal) & + coeff(1) * math_outer(direction, np) &
+ coeff(5) * math_outer(math_cross(normal, direction), & + coeff(2) * math_outer(math_cross(normal, direction), normal) &
math_cross(normal, direction)) & + coeff(3) * math_outer(math_cross(np, direction), np) &
+ coeff(6) * math_outer(direction, direction) + coeff(4) * math_outer(normal, normal) &
+ coeff(5) * math_outer(math_cross(normal, direction), &
math_cross(normal, direction)) &
+ coeff(6) * math_outer(direction, direction)
end select
end select end select
end if end if
end do end do