Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | pchunk | |||
real(kind=rp), | intent(in) | :: | q_cache | |||
real(kind=rp), | intent(in) | :: | m_cache | |||
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | U_X | , where is the particle's velocity. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | U_Y | , where is the particle's velocity. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | U_Z | , where is the particle's velocity. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | E_X | Electric field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | E_Y | Electric field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | E_Z | Electric field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | B_X | Magnetic field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | B_Y | Magnetic field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(in), | DIMENSION(pchunk) | :: | B_Z | Magnetic field seen by each particle. This is given in Cartesian coordinates. |
|
real(kind=rp), | intent(out), | DIMENSION(pchunk) | :: | Frad_X | The calculated synchrotron radiation reaction force . |
|
real(kind=rp), | intent(out), | DIMENSION(pchunk) | :: | Frad_Y | The calculated synchrotron radiation reaction force . |
|
real(kind=rp), | intent(out), | DIMENSION(pchunk) | :: | Frad_Z | The calculated synchrotron radiation reaction force . |
subroutine radiation_force_p(pchunk,q_cache,m_cache,U_X,U_Y,U_Z,E_X,E_Y,E_Z, &
B_X,B_Y,B_Z,Frad_X,Frad_Y,Frad_Z)
INTEGER, INTENT(IN) :: pchunk
REAL(rp), INTENT(IN) :: m_cache,q_cache
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: U_X,U_Y,U_Z
!! \(\mathbf{u} = \gamma \mathbf{v}\), where \(\mathbf{v}\) is the
!! particle's velocity.
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: E_X,E_Y,E_Z
!! Electric field \(\mathbf{E}\) seen by each particle. This is given
!! in Cartesian coordinates.
REAL(rp), DIMENSION(pchunk), INTENT(IN) :: B_X,B_Y,B_Z
!! Magnetic field \(\mathbf{B}\) seen by each particle. This is given
!! in Cartesian coordinates.
REAL(rp), DIMENSION(pchunk), INTENT(OUT) :: Frad_X,Frad_Y,Frad_Z
!! The calculated synchrotron radiation reaction force \(\mathbf{F}_R\).
REAL(rp), DIMENSION(3) :: F1
!! The component \(\mathbf{F}_1\) of \(\mathbf{F}_R\).
REAL(rp), DIMENSION(pchunk) :: F2_X,F2_Y,F2_Z
!! The component \(\mathbf{F}_2\) of \(\mathbf{F}_R\).
REAL(rp), DIMENSION(pchunk) :: F3_X,F3_Y,F3_Z
!! The component \(\mathbf{F}_3\) of \(\mathbf{F}_R\).
REAL(rp), DIMENSION(pchunk) :: V_X,V_Y,V_Z
!! The particle's velocity \(\mathbf{v}\).
REAL(rp), DIMENSION(pchunk) :: vec_X,vec_Y,vec_Z
REAL(rp), DIMENSION(pchunk) :: cross_EB_X,cross_EB_Y,cross_EB_Z
REAL(rp), DIMENSION(pchunk) :: cross_BV_X,cross_BV_Y,cross_BV_Z
REAL(rp), DIMENSION(pchunk) :: cross_BBV_X,cross_BBV_Y,cross_BBV_Z
REAL(rp), DIMENSION(pchunk) :: dot_EV,dot_vecvec
!! An auxiliary 3-D vector.
REAL(rp),DIMENSION(pchunk) :: g
!! The relativistic \(\gamma\) factor of the particle.
REAL(rp) :: tmp
INTEGER :: cc
!$OMP SIMD
! !$OMP& aligned(g,U_X,U_Y,U_Z,V_X,V_Y,V_Z, &
! !$OMP& cross_EB_X,cross_EB_Y,cross_EB_Z,E_X,E_Y,E_Z,B_X,B_Y,B_Z, &
! !$OMP& dot_EV,cross_BV_X,cross_BV_Y,cross_BV_Z, &
! !$OMP& cross_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(cc) - cross_BV_X(cc)
vec_Y(cc) = E_Y(cc) - cross_BV_Y(cc)
vec_Z(cc) = E_Z(cc) - cross_BV_Z(cc)
dot_vecvec(cc)=vec_X(cc)*vec_X(cc)+vec_Y(cc)*vec_Y(cc)+vec_Z(cc)*vec_Z(cc)
F3_X(cc) = (tmp*g(cc)**2)*( dot_EV(cc)**2 - dot_vecvec(cc) )*V_X(cc)
F3_Y(cc) = (tmp*g(cc)**2)*( dot_EV(cc)**2 - dot_vecvec(cc) )*V_Y(cc)
F3_Z(cc) = (tmp*g(cc)**2)*( dot_EV(cc)**2 - dot_vecvec(cc) )*V_Z(cc)
Frad_X(cc) = F2_X(cc) + F3_X(cc)
Frad_Y(cc) = F2_Y(cc) + F3_Y(cc)
Frad_Z(cc) = F2_Z(cc) + F3_Z(cc)
end do
!$OMP END SIMD
end subroutine radiation_force_p