Commit for Python 69a .tar Release

Precursor python_68h
Changes - This is a major revision to the code, including the ability to define a power law source in the location of the central star, a new ionization mode using the sim factor, a new wind mode to generate a thin shell, and also associated changes to balance.
Several additions to the structures in python.h
New spectype (power law)
new system_type (AGN - just a disk and a power law source)
additions to geo structure for agn power law and luminosity, distance to AGN (for balance), sim weight and alpha for sim code
additions to allow for a thin shell test wind.
Additions to allow for the creation and writing out of spectrum files in logarithmic units
atomic.h
density_min parameter changed to 1e-100 - this is to avoid checks which force the sim code to ignore low density ions which may actually be important once we compute correction factors.
bands.c
New bands to allow arbitrary frequency bands to take in x-rays
extract.c
Small modification to take account of the new system types.
ionization.c
Some external variables (sim_numin, sim_numax and sim_meanfreq) set up to communicate with zbrent to allow sim estimateors to be calculated
zbrent added to the end of the file - this is a duplicate, and perhaps should be dome more cleverly
the function sim_alpha_funch is added to the end of the file. This is the equation 18 in thr 2008 paper and links mean frequency with alpha. It is the equation solved in zbrent.
in ionization, mode 4 is added for the initial run thruogh. This is LTE with sim correction, but weight and alpha set to initial values everywhere in the wind.
Mode 5 added, this calls oneshot then sim correction.
sim_numin and sim_numax are hardwired here to 1.25e15Hz and 1.21e19Hz. This might need correcting in the future.
It is in this file that the calculations are made to compute sim_alpha and sim_w. These are used in the sim correction code.
In one_shot, slight modification to take account of the new ionization modes. Also some printf lines
levels.c
Simple modification to take account of new modes. in if is called with mode 3, it does a non lte level calculation with weight=1 and temperature=t_e
partition.c
Modification to deal with new ionization mode. If called in mode 3, it computes partition functions with w=1 and t=t_e
pdf.c
Lots of modifications 'changed the way in which pdf_gen_from_function works so it will change the number of points that are used in the array pdf_array in situlations where the number of points that are used in the array where the binning is too coarse. October 2010 KSL
photon_gen.c
lines added to allow photons to be generated from AGN. AGN photons added to sum of total nmber of photons, and a call is made to the new function photo_gen_agn (located in agn.c)
python.c
n_ioniz and lum_ioniz are now declared externally so that the total ionizing photon number and luminosity (computed in photon_check) can be reported.
modifications to wind_ionization line to allow sim mode to be selected
modifications to allow the agn system to be defined, along with spectrum type for agn. Some calculations are done to inform the user of sensible radius for the AGN given the schwartzchild radius
A line is here after the call to bands_init to make sure that freqmin and fregmax are updated to take account of any user modified frequency bands.
calls to spectrum_summary added to allow logarithmic spectra to be generated and output.
*

saha.c
A new mode is defined in saha - mode 5. LTE followed by sim correction.
In concentrations, a new mode is also defined, mode 3 which is currently identical to mode 1.
In order to improve the agreement with SS's FE ionisation fractions in his 2010 paper, density(first) is set to 1e-250 instead of 1. This allows a greater dynamic range of SAHA predicted ions, which then allows huge sim correction factors to give more accurate results.
The big parameter which is designed to limit the ratios between adjacent ions in also increased by a factor of 1 million in the line big=big*1e6
There are also a few printf statements to help understand what is going on.
spectra.c
There are modifications to allow for the new possible sources of radiation to be output in the spectrum files
There are also several lines that allow the generation and output of logarithmic spectra. These are selected with a new switch added to the call to spectrum_summary - loglin. If loglin=0, we are producing a linear spectrum, if loglin=1 we are producing a logarithmic spectrum.
spherical.c
There are modifications to the spherical geometrey file to produce a really thin shell for direct comparison with balance calculations. They allow a shall at 1e16 cm to be produced. This is a work in progress and probably ruins the old spherical geometry.
stellar_wind.c
Here are the lines to generate the new very thin shell wind.
The line equating geo.wind_rmin with geo.rstar is commented out to allow them to differ
stuart_sim.c
This is an entirely new file containing all the machinery to compute the sim correction factor and apply it. There are several functions
sim_driver - this is based on lucy (in saha.c). It cycles of all the elements in he model, calling sim_pl for each
sim_pl - this is based on lucy_mazzali (in saha.c) It decides which ions are important (this is where density_min, set in atomic.h becomes important because if it is set too low, ions are ignored which will actually be important once the correction factor is applied). For each important ion it calls xinteg_sim, which carries out the integrations for the sim_facor. This code also decides where in the ground_frac tables we go to for the xi parameter. Once it has the sim factors, it computes the new abundances. The frequencies over which the ionization cross sections are calculated are hardwired into the code here as f1 and f2.
xinteg_sim - This is based upon xinteg_fb (in recomb.c). It decides if it is going to use topbase or verner cross sections, then calls qromb with the suitable function. All of the functions for the numerators and denominators of the sim correction factor are also in the file. There is a check to make sure that the denominator (black body times cross section) is not too low, and if it is it makes sure that the numerator is set to a more reasonable number. This is needed because it is possible that the planck function is zero over the whole frequency range integrated over, which gives infinities. This is a big problem, and should probably be fixed in a better way.
tb_planck - topbase cross sections multiplied by the planck function
verner_planck - verner cross sections multiplied by the planck function
tb_pow - topbase cross sections multiplied by a power function
verner_pow - topbase cross sections multiplied by a power function
sim_alphasolve - this is a little bit of code which solves equation 18 in sim et al 2008 to get the alpha for a cell from the mean frequencies. I think this is now defunct since I decided to use the numerical recipies solver.
sim_w
- a code to work out the effective radiative weight in a cell for a power law - it implements equation 19 in sim et al 2009.
wind2d.c
Two new parameters are computed for each cell of the wind. plasmamain.sim_alpha is set to geo.alpha_agn and sim_w is set to geo.const_agn divided by the surface of a sphere at the centre of the cell, and alos divided by 4pi. As it turns out, we dont actually use these, because the made the decision to set up the ionization fractions as a simple LTE calculation. These lines coupld probably be removed
There are also some commented out lines which set up the ionization fractions to SAHA + SIm ? at initialization.
wind_updates2d.c
There are a few lines here which compute an ionisation parameter in a very simplistic manner, just by working out the luminoisty from 100ev to 50kev, dividing by distance to the centre of the geometry squared, and dividing by the local hydrogen density.
There are also lines to output ion fractions, but only if the wind type is the thin spherical shell.