Computer Programs
Plane-Parallel Codes
I compute the structure of stellar atmospheres using computer programs
based on the Atlas codes developed by
Robert Kurucz.
Kurucz has two versions of his program. The older version is named
Atlas9, and it assumes traditional plane-parallel geometry, hydrostatic
pressure equilibrium and LTE populations. Its important contribution
is the inclusion of the opacity from millions of atomic, ionic and
molecular spectral lines using opacity distribution functions (ODFs)
that have been pre-computed for a wide range of temperatures, pressures,
compositions and microscopic velocity fields. The newer Atlas12
version differs from the Atlas9 code by employing an opacity sampling
(OS) of the spectral lines, which eliminates the discrete values of
temperature and pressure imposed by the ODFs, as well as providing
complete flexibility in choosing the composition and the microscopic
velocity fields, both of which might vary with depth.
My versions of the Atlas codes try to remain true to the intent of the
originals available from Kurucz, but they have been completely rewritten
to modify the programs in a number of ways, including:
- Where Atlas9 differs from Atlas12, except if this is required by
the different treatment of line opacity, the coding from the
newer Atlas12 has been adopted.
- The code is rewritten in modern Fortran, currently version 2008,
although there are features of modern Fortran that have not yet
been employed.
- All "go to" statements have been removed because this structure is
deprecated in modern Fortran. This necessitated rewriting many
routines to eliminate discontinuous jumps. The goal is to have
every routine flow continuously from top-to-bottom.
- All "equivalence" statements have been removed because this
structure is deprecated in modern Fortran. This avoids any
confusion about what a particular variable represents.
- All "common" statements have been replaced by modules. In
particular, program dimensions and physical constants are defined
in modules that can be edited once and these changes then
propagate to the whole program.
- Alternative utility routines, often taken from Numerical
Recipes, have been added. These have been tested against the
original routines to determine if they are faster or more
accurate.
- Kurucz's original integral equation method for radiative transfer
has been supplemented with two additional routines. One uses the
second-order differential equation method of Feautrier, and the
other uses Rybicki's restructuring of the Feautrier method.
- Routines that are used in only one place have been made internal
to the routine that calls them.
- The codes have been broken into a series of units, largely
following the approach suggested by Kurucz in his original
publication (SAO Special Report 309). These units can be edited
individually, then compiled and relinked into the executable by a
Makefile.
- main - this unit contains the top level of the
program, as well as the output routine, among others.
- read - this unit reads in the input instructions
and data, and also contains routines needed to compute starting
data from the input.
- conv - this unit contains a single routine to
compute the convective energy flow.
- kapp - this unit contains the routines that
determine the radiative opacity from all sources at all
temperatures.
- pops - this unit calculates the populations of all
the atoms, ions and molecules at every temperature and pressure
of the atmosphere.
- josh - this unit has the three routines mentioned
above that calculate the transfer of radiation.
- tcorr - this unit has a single routine that
determines the temperature correction needed at the end of an
iteration to improve the conservation of energy from level-to-level
in the atmosphere, as well as improve the gradient of the
energy conservation.
- utils - this unit holds various utility routines
that are used by other routines throughout the code.
To avoid confusion, the modified version of Atlas9 is called Atlas_ODF
and the modified version of Atlas12 is called Atlas_OS. Compressed tar
files of the source files can be accessed at
Atlas_ODF
and
Atlas_OS.
ODFs are available from either Kurucz or from
Fiorella Castelli,
which are recommended by Kurucz. The Castelli and Kurucz ODF files
have different dimensions for the pressures and temperatures.
Instructions have been added to Atlas_ODF to identify which dimensions
to use, but the defaults are the Castelli dimensions.
The binary ODFs files provided by either Castelli or Kurucz are read and
rewritten as binary files using the program bdf2bin. The purpose of this
is to:
- use array element order (as Kurucz does) but with 2-byte integers
- use a record length specified in bytes, not words
Using the original ODF files downloaded from Castelli or Kurcuz will
lead to an error because the Atlas_ODF code assumes this conversion has
been done. The validity of the conversion can be checked by using the
program test_newbdf to convert the reformated ODF file from binary to
ASCII, and then using the program bdf2asc to write out the original ODF
as ASCII. The two outputs should be identical. These programs are
included in the Atlas_ODF distribution.
Atlas_OS uses the line lists given on the Kurucz web site.
In addition to the programs to compute model atmospheres, the Kurucz
programs to compute synthetic spectra have also been modified in the
same way as the Atlas_ODF and Atlas_OS programs. These are included
in the Atlas_ODF distribution.
Spherical Codes
Spherical versions of both Atlas_ODF and Atlas_OS have been developed,
called SAtlas_ODF and SAtlas_OS and described in Lester & Neilson, 2008,
Astronomy & Astrophysics, vol. 491, p. 633. Because
these programs use spherical geometry for the atmospheres, only the
Rybicki radiative transfer routine is appropriate. The source code
files are available at
SAtlas_ODF
and
SAtlas_OS, and the SAtlas_ODF distribution has
spherical versions of the spectrum synthesis programs.