subroutine unitVectors_p(pchunk,b_unit_X,b_unit_Y,b_unit_Z,b1_X,b1_Y,b1_Z, &
b2_X,b2_Y,b2_Z,b3_X,b3_Y,b3_Z)
INTEGER, INTENT(IN) :: pchunk
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: b_unit_X,b_unit_Y,b_unit_Z
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: b1_X,b1_Y,b1_Z
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: b2_X,b2_Y,b2_Z
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: b3_X,b3_Y,b3_Z
REAL(rp), DIMENSION(pchunk) :: b2mag,b3mag
integer(ip) :: cc
!$OMP SIMD
! !$OMP& aligned(b1_X,b1_Y,b1_Z,b_unit_X,b_unit_Y,b_unit_Z, &
! !$OMP& b2_X,b2_Y,b2_Z,b2mag,b3_X,b3_Y,b3_Z,b3mag)
do cc=1_idef,pchunk
b1_X(cc) = b_unit_X(cc)
b1_Y(cc) = b_unit_Y(cc)
b1_Z(cc) = b_unit_Z(cc)
b2_X(cc) = b1_Y(cc)
b2_Y(cc) = -b1_X(cc)
b2_Z(cc) = 0._rp
b2mag(cc)=sqrt(b2_X(cc)*b2_X(cc)+b2_Y(cc)*b2_Y(cc)+b2_Z(cc)*b2_Z(cc))
b2_X(cc) = b2_X(cc)/b2mag(cc)
b2_Y(cc) = b2_Y(cc)/b2mag(cc)
b2_Z(cc) = b2_Z(cc)/b2mag(cc)
b3_X(cc)=b1_Y(cc)*b2_Z(cc)-b1_Z(cc)*b2_Y(cc)
b3_Y(cc)=b1_Z(cc)*b2_X(cc)-b1_X(cc)*b2_Z(cc)
b3_Z(cc)=b1_X(cc)*b2_Y(cc)-b1_Y(cc)*b2_X(cc)
b3mag(cc)=sqrt(b3_X(cc)*b3_X(cc)+b3_Y(cc)*b3_Y(cc)+b3_Z(cc)*b3_Z(cc))
b3_X(cc) = b3_X(cc)/b3mag(cc)
b3_Y(cc) = b3_Y(cc)/b3mag(cc)
b3_Z(cc) = b3_Z(cc)/b3mag(cc)
end do
!$OMP END SIMD
end subroutine unitVectors_p