Skip to main content

Trinity College Dublin, The University of Dublin

Trinity Menu Trinity Search

You are here Research > Research Groups > Surface, Interface Physics & X-ray Spectroscopy > Cowan code

Robert D. Cowan's Atomic Structure Code

This webpage serves as a repository for Robert D. Cowan's atomic structure codes.

These codes are described in detail in his text "The Theory of Atomic Structure and Spectra".

In the past his codes have been publicly available from the T-4 Atomic and Optical Theory group at LANL at this ftp address: where versions as recent as 2005 can be found.

I have been given permission by Robert Cowan to host his codes (and any updates he cares to send me) on this website as a service to the community. This is partly because he can no longer easily update the codes on the T-4 site due to security reasons.

The Theory of Atomic Structure and Spectra


If you want to download, install and compile the Cowan code then download this file which has everything on this page: Cowan.tgz
- last major update November 8th 2009
- last minor update December 30th 2009

Robert Cowan's atomic structure codes

The fortran source codes are as follows:

  • A short description of the codes from the author
    • readme - last updated November 2002
  • RCN / RCN2 - Computation of Atomic Radial Wavefunctions
    • Documentation by the author - (Revised February 2005) - pdf - txt
  • RCG - Calculation of Atomic Energy Levels and Spectra
    • RCG - Mod 11.5.4 - Dated: February 2007
    • Documentation by the author - (Revised February 2005) - pdf - txt
    • RCE - Mod 20b - Dated: November 2001
    • Documentation by the author - (Revised August 1993) - no pdf - txt

The copyright owner of the codes obviously lies with the authors, primarily Robert Cowan.

Downloading the codes

For your convenience a single gzipped tar file with all of the source code (all versions), patches (see below) and original documentation from the author is CowanCode.tgz

Compiling the codes

  • A compiler that can be used is the Intel fortran compiler which is freely available for non-commercial academic use on Linux, and the patches (see below) will allow for compilation with no warning errors.
  • (Unfortunately g77 is no longer available on modern Linux distributions, and gfortran will not compile the code. Where g77 is available on older systems then g77 can be used also to compile the code.)
  • Mostly the patches involve alignment of common blocks. Patches have been made for the latest versions addressing this issue to enable it to compile. These can be found in patches and are listed in this directory as "fixes".
  • If you download the .tgz above then this can be unpacked on a Linux/unix machine by typing "tar zxvf CowanCode.tgz" and then:
    1. Edit the "makefile" and change the DISTDIR variable to where you want the program to be isntalled.
    2. Change the "FC" variable to either "g77", "ifort" or the name of your compiler.
    3. Type "make" to compile and "make install" to install to your selected directory if compilation is successful.
  • By default it will compile rcg.11.5.4.f and assumes you have the Intel compiler installed. It will also by default compile the codes in the original "LANL" versions and the ever-so-slightly modified "UCD" versions.

Other input files

Earlier versions

  • An archive of all earlier versions of these codes available to me is also found here if you browse this directory
  • This archive of older versions may allow those people who have made their own modications to older versions to reintegrate those back into the more recent main version.
  • If you have any earlier versions than these listed here then please pass them on.

For your convenience a single gzipped tar file with all of the source code (all versions) and documentation is CowanCode.tgz


  • Some earlier versions of the documentation by the author can be found here if you browse this directory. The most recent versions are those listed to the left.
  • Out of date LaTeX source versions of the 1993 manuals are available here and also as a gzipped tarred download.
  • These LaTeX versions can produce .ps, .pdf files or html files for your convenience with most LaTeX installations.
    • (Perhaps someone could update the LaTeX source to the current versions of the documentation from the author and I will update them here.)
  • For your convenience a single gzipped tar file with all of the documentation is CowanDocumentation.tgz

Downloading everything

  • All of the above - bundled into one file: Cowan.tgz - updated November 8th 2009
  • CAVEAT: Unfortunately, I no longer routinely use these codes for my present research and cannot aid with complex compilation issues or compilation errors.
  • I am happy to try to answer other questions

Example atomic calculations

A number of example calculations are given here:

  • K5+ (K VI) - optical spectrum - in36, in2, in2misc.
  • Cl-, Br- and I-like 5p spectra of Ar, Kr, Xe and Cs - in36.
  • Ga2+ (Ga III) - 3d absorption spectrum - ga3, ga3.in2.
  • Iodine (I 1) - 4d9 5p6 2D3/2 autoionisation calculation - io1a_d32, io1a_d32.in2.

If you would like to provide an example calculation to be included here then please let me (Cormac McGuinness) know and I will be happy to include these here.

Unix scripts for running code

  • Several convenient unix Bash shell scripts for running a batch calculation are given here mostly written in UCD between 1993-1999. They will work on Windows provide you install Cygwin.
  • A description of how to use these shell scripts - in particular - is given here.
  • CowanScripts.tgz - updated November 8th 2009 (fixed Makefiles)

Utilities for post-processing

  • A number of utilities for post-processing the output of RCG to quickly generate plots by Unix/Linux utilities are available here mostly written in Fortran again in UCD between 1993 and 1999.
  • These utilities (and the shell scripts above) are described here. Thanks to Paul van Kampen in particular for parts of the shrink utility.
  • Some patches to modify the output of the RCG code are necessary for these (in particular for shrink) to run. These patches are the ones named "mk-...ucd..."
  • CowanUtilities.tgz - updated November 8th 2009 (fixed Makefiles)

Alternate versions of Cowans code:

Several adapted versions exist both for atomic structure and for atomic multiplet calculations in condensed matter physics.

If you know of any other adaptation or version which should be listed here then please let me (Cormac McGuinness) know.

Atomic Structure:

Atomic Multiplets: