next up previous

5.4 Program Execution

The code is well commented (refer to the Postscript two-column listing for line numbers). Here, we go through the process, subroutine by subroutine.

Subroutine input

  1. First, the geometry is calculated (lines 182 through 219).
  2. Next, the material properties are computed and stored (lines 220 through 232).
  3. Finally, the analytical answers are calculated and stored (lines 233 through 263).

Next, the solution phase is invoked. Line 54 initiates the loop over surfaces. For each surface, we loop over nstop full surface emissions (line 58), each of np particles (here, 10,000). Within this loop, we invoke the following subroutines:

Subroutine emit

  1. The ``starting'' coordinate is defined for the first particle of this vector of np particles (lines 292--298).
  2. The emission coordinates are defined in lines 299--306. The student must supply the right sides of lines 305 and 306.
  3. The outgoing local spherical angles (lines 307 through 318), local Cartesian components (lines 319 through 325) and global Cartesian components (lines 326--333) are obtained. The student must supply the right sides of lines 313, 318, 324, 325, 332 and 333.