Material prepared for the 52nd Saas-Fee Advanced Course on "The circum-galactic medium across cosmic time: an observational and modelling challenge"¶

by Alejandro Benitez-Llambay & Michele Fumagalli¶

Contact for questions or comments: alejandro.benitezllambay@unimib.it

For this hands-on tutorial, we will use CLOUDY, a spectral synthesis code that can simulate the conditions of the interstellar medium under a broad range of conditions. Before going into the set of problems, please install the software on your laptop following the steps described below.

Cloudy Installation¶

Download the code¶

The latest version of Cloudy (as of March 2023) can be obtained using either wget or curl:

curl -O https://data.nublado.org/cloudy_releases/c22/c22.01.tar.gz
wget https://data.nublado.org/cloudy_releases/c22/c22.01.tar.gz </code>,

after which you can untar and uncompress the file with

tar xvfz c22.01.tar.gz

Building the code¶

Now, you can go to c22.01/source and type make, after which the compilation of the code will start. At the end of the process, this should produce the file source/cloudy.exe

If you encounter problems with building the code, you can check https://gitlab.nublado.org/cloudy/cloudy/-/wikis/CompilingCloudyNext, where there is information about building CLOUDY for different operating systems.

Testing the code¶

The CLOUDY documentation proposes to check that the code works as intended by running the Smoke Test. To this end, run CLOUDY using:

./cloudy.exe
test

If the test does not work, please check the following webpage, which can help resolve your particular problem:

https://gitlab.nublado.org/cloudy/cloudy/-/wikis/Smoke%20Test

Running CLOUDY¶

To run CLOUDY, we need to provide an input file containing all the commands that control the code, one per line. The typical example would be a file named "cloudy_script.in" with the following lines:

title typical input stream
blackbody 1.2e5 K
luminosity 37
radius 17
hden 4
save overview "cloudy_script.ovr"

To run this script, simply type:

./path_to_cloudy/cloudy.exe -r cloudy_script

which after a couple of minutes produces a file cloudy_script.out.

Cloudy Commands¶

To understand how Cloudy commands are passed as in the previous example, you can read Chapter 3 (page 19), of the documentation, particularly, "Hazy1.pdf", but also:

c22.01/docs/hazy1.pdf
c22.01/docs/hazy2.pdf
c22.01/docs/hazy3.pdf