- Remove the Stokes parameters as an intermediate step in the
conversion between Jones vectors and polarisation ellipses.
- Document every single step performed when converting between
different parametrisations and how the polarisation at the
plasma boundary is computed. This includes how everything
was derived from first principles.
- Mark the subroutines as pure.
- Remove `set_pol` entirely.
In situations when multiple beams are traced, either when allowing
multiple plasma crossings (raytracing.ipass > 0) or the initial polarisation
is mixed (raytracing.ipol == .true.), the couplings of all but the first
beam (with least index_rt) were invalid.
The bug is due to the re-use of the psipol,chipol variables as the beams
are traced sequentially over the beam_loop. For the first beam being
traced the psipol,chipol are correctly initialised to the user-defined
value and the resulting coupling is correct.
However, in each subsequent beam the values were not set to those of the
parent beam (or to the user-defined value in the case of the first X
mode beam), but to those of the previous beams (current index_rt - 1).
This change repurposes the psipv,chipv arrays to store the polarisation
of the parent beams, including the initial user-defined value and makes
plasma_in always use these to compute the coupling.
In addition, in the case the polarisation is not immediately known (i.e.
if raytracing.ipol == .false.), this change postpones the computation of
the Jones vector (ext, eyt) from the launch point, if the magnetic
equilibrium is available, to when the ray actually crosses the
plasma boundary.
The original code, besides being strictly incorrect, can lead to
non-negligible alterations to the coupling. This change also mean:
1. most of the functionality of `set_pol` has been merged with
`plasma_in`
2. the polarisation is undefined and the Jones vector is set to the
placeholder value [1, 0] till `plasma_im` is called
Finally, `polarcold` is removed because it's unused.
- merge branch with a method to control the speed of iteration and
improve the convergence of `warmdisp` (thanks Thomas)
- unify `diel_tens_fr` and `diel_tens_wr` into a single subroutine,
`dielectric_tensor`
- stay as close as possible to the notation of Daniela Farina's paper
- make `sox` an integer
- mark more subroutines as pure
- add more comments