Notes on the program CLE, by P. Judge.
Original: December 1, 2005, V1.0
Updated:  July 13, 2006
Updated: Dec  21, 2012  (makefiles put into one file, makefile.osx)
Updated: Jan 7 2020 (code optimization, correction
         for degeneracy of levels in inelastic collision rates
	 see BUGS.TXT
Updated: Mar 5 2020 V2.0 with improved atom files in data/,
         including updated Fe XIII data which were erroneously
	 older data adopted from CHIANTI V5.  Latest data are
	 CHIANTI V9.

COMPILATION
-----------

in the current/ directory do

unix> make cle

this will build an executable cle* in the current/ directory

DATA
----

Data needed for the code can be found in the data/ directory

The atomic data files come with their own input files, e.g.
to run cle*  for Si IX do 

cp atom.si9 ATOM
cp input.si9 INPUT


WHAT THE CODE DOES
------------------

For details see Casini, R. & Judge, P. G., 1999. ApJ 522, 524-539.

The program CLE computes emission coefficients for Stokes I,Q,U and V
for magnetic dipole coronal emission lines.  The emission coefficients
are integrated along each line-of-sight to produce emergent
intensities (erg/cm2/s/sr/A and erg/cm2/s/sr) in these lines.  Just
one atomic ion at a time is computed (e.g., Fe XIII).  

The code assumes thermal collisional processes (but may allow proton
and electron temperatures to differ, if proton collision rates exist
in the ionic model - file ATOM).  At each grid point, it computes the
total population of all the ion's level populations from a table of
ionization equilibria from CHIANTI.  It then solves the statistical
equilibrium equations using the irreducible tensor basis for
bound-bound processes within each ion (see Casini, R. & Judge, P. G.,
1999. ApJ 522, 524-539).  The incident radiation is limb-darkened,
solar radiation from Allen (1973, A.Q.).  The emergent Stokes
parameters are computed by integrating all emission coefficients along
the line-of-sight.  The reference direction for Stokes Q is I believe
along the Y axis defined below. (NOTE- this is being checked July 13,
2006). (NOTE - it appears actually the reference direction is N-S, the
 Z direction - see e.g. program run/qu2polvec.pro -- SG MAR 2014)

Because the bound-bound and bound-free processes are treated
separately, one can even make a calculation with no collisional
effects in the bound-bound calculations (set ICOLL=0 in file INPUT). 



COORDINATES
-----------

In the program the observer's geometry relative to sun
center uses Cartesian and spherical polar coordinates.

The X axis is aligned along the line of sight, and the Z and
Y axes lie in the plane of the sky (X=0) intersecting Sun
center.  The Y axis corresponds to E-W, Z axis is N-S. The
point (x,y,z)=(0,0,0) is Sun center. X increases with
distance from the observer. Y increases towards the west, Z
increases towards N.

The spherical polar coordinates (R, theta, phi) are given as
follows.  R is measured from (x,y,z)=(0,0,0).  Theta is
measured clockwise from the positive z-axis. Phi is measured
from the positive X-axis.

The magnetic field and coronal parameters must be given by a
subroutine which returns local values of the vector magnetic
field, the electron density, hydrogen (proton plus neutral)
density, temperature, plasma line of sight velocity,
microturbulent velocity, as a function of the polar position
(R,theta,phi).  As an example, the following first line of a
subroutine to compute dipolar fields is given:

	SUBROUTINE DIPOLE(RAD,THET,PH,B,T,P,EDENS,HDENS,
     *    TEMP,VEL,TURBV,IPRINT)

Thus, at spherical polar position (RAD, THET, PH) the
routine returns the magnitude of magnetic field B, and its
orientation (by polar angles T and P) and the thermal
parameters and velocities. 


UPDATE: JAN 7 2020 (CODE OPTIMIZATION, ADDITION OF K CORONAL EMISSION)

Modifications have been made to the following code:

include files:
	CATOM
	GRDPAR	
	PARAM

subroutines and functions, these are documented within each .f file

	atom
	c2
	c6
	ce
	colcal
	colrd
	corona
	cuser
	dipole
	emission    K-coronal emission added
	eqion
	field_int
	field_int_allen
	field_int_gauss
	gammae
	gammai
	gammas
	outs
	r4
	rinput
	se0
	se0
	watmos
	wdebug

