Read me file for the sample programs

For more information visit Cloudy's web site at www.nublado.org


These are a series of programs that show how Cloudy can be used as a subroutine of other, larger, programs.  When I use it in this way I first create a library, compile the new main program, and link this to the library. 

Each sample program includes the header files cddefines.h and cddrive.h.  These are included in the Cloudy source directory.  The main programs have explicit paths to where these files live on my computer.  You will need to alter these lines so that they point to where the files live on your machine.


hazy_coolingcurve.c

This is an example of a 1-D calculation.  The gas temperature is varied over a very broad range and photoionization is turned off.  This is a model in collisional equilibrium, with cosmic and cosmic ray backgrounds (the last establishes a small level of ionization).  A single zone is computed and the temperature and cooling are printed.  This was used to create a figure in Hazy.  The calculation is fast, taking several minutes on my workstation.

This figure shows a plot of the results from this test.  The x-axis is the log of the gas temperature (K).  The y-axis is the cooling divided by the square of the density (erg s-1 cm3).


vary_nete.c

This is an example of a 2D calculation.  Both the electron density and temperature are varied over a broad range and several [O III] lines are predicted.

This figure shows the [O III] 4363 / 5007 ratio as a function of density and temperature, as output from this program.


hizlte.c

This program tests the ability of the code to go to the strict thermodynamic equilibrium limit.  The gas has a very high metallicity so that the heavy elements dominate the thermal equilibrium.  The radiation field has different temperatures but is a true blackbody, with the energy density and color temperatures equal.  The output gives the radiation field temperature, the equilibrium temperature, and the difference between the two.

In this figure the x-axis is the log of the radiation field temperature.  The y-axis is the difference between the radiation field and deduced gas kinetic temperatures.  The two should be equal, and are, to substantially better than 1%.


varyn.c

This is a 1-D calculation in which the density is varied, and the intensities of some [OII] lines relative to [OII] 3727 are printed.  The plot shows two density-sensitive ratios.

The x-axis is the log of the electron density (cm-3) and the y-axis is the intensity of the line relative to [OII] 3727.


comp4.c, hilohi.c

These programs check that the code is properly initialized when it sets up.  Two different models and computed twice, and the output goes to file1.txt (the first pair) and file2.txt (the second).  These files should be exactly the same.


hazy_kmt.c

This reproduces the calculation originally done by Krolick, McKee, & Tarter (1981; ApJ, 249, 422),  The output file hazy_kmt.txt gives the log of the temperature, the temperature (K), and pressure.

In this figure the x-axis is the log of the temperature, and the y-axis is the pressure.


mpi.c

This is my main routine for running large grids on our HP cluster.  It uses MPI to place a grid point on each processor.


If you find a problem

Cloudy should run on all platforms without errors.  Botched asserts or outright crashes should never happen. I can't fix it if I don't know it's broken.  Please let me know of any problems. My email address is gary@pa.uky.edu


Visit www.nublado.org  for details and latest updates. 

Good luck,
Gary J. Ferland