subroutine cart_to_cyl_p(pchunk,X_X,X_Y,X_Z,Y_R,Y_PHI,Y_Z)
implicit none
INTEGER, INTENT(IN) :: pchunk
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: X_X
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: X_Y
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: X_Z
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: Y_R
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: Y_PHI
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: Y_Z
INTEGER :: pp
!! Iterator.
!$OMP SIMD
! !$OMP& aligned(Y_R,Y_PHI,Y_Z,X_X,X_Y,X_Z)
do pp=1_idef,pchunk
Y_R(pp) = SQRT(X_X(pp)*X_X(pp) + X_Y(pp)*X_Y(pp))
Y_PHI(pp) = ATAN2(X_Y(pp), X_X(pp))
Y_PHI(pp) = MODULO(Y_PHI(pp), 2.0_rp*C_PI)
Y_Z(pp) = X_Z(pp)
end do
!$OMP END SIMD
end subroutine cart_to_cyl_p