Function adas.create_ca_adf04

def create_ca_adf04(adf34=None, adf27=None, adf04_t1=None, adf04_t5=None, adf04_t3=None, te=None)

Generates a configuration average (CA) adf04 file from an adf34 or an adf27 driver driver file.

Parameters

adf34 : str
full name of ADAS adf34 driver file, if set adf27 must not be supplied.
adf27 : str
full name of ADAS adf27 driver file, if set adf34 must not be supplied.
adf04_t1 : str
full name of ADAS type 1 adf04 output file, suitable for adf34 and incompatible with adf27 driver.
adf04_t5 : str
full name of ADAS type 5 adf04 output file, suitable for adf27 and incompatible with adf34 driver.
adf04_t3 : str
full name of ADAS type 3 adf04 output file.
te : float, array
electron temperatures for the type 3 file in Kelvin.

Returns

nothing - the output is file(s) written to disk
 

Notes

Pure python code but calls either the rcn and rcn2 steps from adas8#1 if supplied with an adf34 driver file, or runs autostructure if an adf27 driver file is given. Compiled routines which are dependent on fortran are also called. adas7#3 is called to convert type 1/5 to type 3. Therefore this routines needs a full ADAS installation to work.

The routine is controlled by an adf34 driver file which is the format detailing the configurations (and some control parameters) of the Cowan code (adas8#1). A driver file can be written by calling write_adf34.py and taking the options from one of the files in central ADAS adas/adf34/heavy_species/ (xxdata_34 return the parameters in a suitable dictionary).

The adf27 driver file is checked for the CUP parameter in the &SALGEB namelist being set to 'CA' or 'CAR'. AS v30 is required since the definition of a CA collision strength is ambiguous. Earlier versions of AS assumed that the statistical weight of the just the active electrons is used to produce rates rather than the total statistical weight in the adf04 file.

Note that the adas8#1 approach can be significantly faster so a message is printed to screen.

References

ADAS manual description of adf34: http://www.adas.ac.uk/man/appxa-34.pdf

Version History

  • Martin O'Mullane, 31-08-2022

    • First version
  • Martin O'Mullane, 05-10-2022

    • The info dictionary from xxsple is now optional and as it is not used here, change the call.
  • Martin O'Mullane, 21-10-2022

    • Assign zpla after sorting the energy levels.
  • Martin O'Mullane, 24-10-2022

    • Too few significant figures for Te were passed to adas7#3.
  • Martin O'Mullane, 24-08-2023

    • Add adf27 driver as an alternative option.
    • Move from adas8xx/adas801 to adaslib/atomic.
    • Improve temporary files cleanup.

Example

Generate a type 3 (effective collision strength assuming Maxwellian) energy distribution) configuration average adf04 file for Ar12+.

>>> import adas as adas
>>> adf34 = '/home/adas/adas/adf34/heavy_species/argon/ar12.dat'
>>> adas.create_ca_adf04(adf34=adf34, adf04_t3='/tmp/ar12ca.dat')