!
Subroutine far_Components(zet, min, max, eM, eN)
use Advertisement
implicit none
integer*4, intent(in) :: min, max
real*8, intent(in) :: zet
complex*16, intent(out) :: eM(3, *), eN(3, *)
real*8 p(n_max+terms-1), t(n_max+terms-1)
complex*16 i
call nLegendre(max, zet, dsqrt(1.d00-zet*zet), p, t)
do n=min, max
 l=n-4*(n/4)
 if(l.eq.0) i=(1.d00,0.d00)
 if(l.eq.1) i=(0.d00,-1.d00)
 if(l.eq.2) i=(-1.d00,0.d00)
 if(l.eq.3) i=(0.d00,1.d00)
 eM(2, n)=(0.d00,-1.d00)*i*m*nu(n)*p(n)
 eN(2, n)=i*nu(n)*t(n)
 eM(3, n)=(0.d00,1.d00)*eN(2, n)
 eN(3, n)=(0.d00,1.d00)*eM(2, n)
end do
End Subroutine far_Components
!
Subroutine TE_TM_Sections(nmx)
use Advertisement
implicit none
integer*4, intent(in) :: nmx
real*8 at, af, nrm, sct, scf
at=0.d00; af=0.d00; sct=0.d00; scf=0.d00
call oMatrix_Making(nmx, 2)
call oMatrix_Conversion_to_M_M(m_min, nmx, 1, l_max) !
!call Multiplication(m_min, nmx, d_e1, d_e2, d_o1, d_o2) !
call T_Matrix !
call Coefficients_Conversion_to_eo(m_min, nmx, 4) !
call far_Components(z0, m_min, nmx, n_M, n_N) 
if (m.eq.0) then
 do n=m_min, nmx
  at=at+dimag(d_e2(n)*n_N(2, n))  ! TM
  af=af+dimag(d_e1(n)*n_M(3, n))  ! TE
  sct=sct+cdabs(d_e2(n))**2  ! TM
  scf=scf+cdabs(d_e1(n))**2  ! TE
 end do
else
 do n=m_min, nmx
  at=at+dimag(d_o1(n)*n_M(2, n)+d_e2(n)*n_N(2, n)) ! TM
  af=af+dimag(d_e1(n)*n_M(3, n)+d_o2(n)*n_N(3, n)) ! TE
  sct=sct+cdabs(d_o1(n))**2+cdabs(d_e2(n))**2 ! TM
  scf=scf+cdabs(d_e1(n))**2+cdabs(d_o2(n))**2 ! TE
 end do
end if
!nrm=pi*rad*rad*dsqrt((1.d00-z0*z0)/(1.d00-exc)+z0*z0) ! shadow section
nrm=pi*rv*rv ! the shadow of equivolume sphere
teQscat=teQscat+scf/nrm*pi
tmQscat=tmQscat+sct/nrm*pi
teQexc=teQexc+4.d00*af*pi/nrm
tmQexc=tmQexc+4.d00*at*pi/nrm
End Subroutine TE_TM_Sections
!
