Read me for template.cpp - a template for writing your own program to call Cloudy as a subroutine

 

This program is a template you can use to start writing your own program that calls Cloudy as a subroutine. You can freely modify the code inside the try block, but should normally not touch any of the catch blocks. They are designed to catch any exceptions that Cloudy may throw. If they were not caught, your code would crash and your output would be lost!

To demonstrate how you can define an input script for Cloudy, a single call to cdRead is included which exercises the smoke test. You should replace that with a series of calls to cdRead to define your own input script. The call to cdDrive causes the script to be executed. Since you typically want to calculate a series of models in the program (e.g. some sort of special grid) a simple loop is included in the program to demonstrate how this can be done. You can of course change the loop in any way that suits you, or even use multiple nested loops.

last modified 19 July, 2008