In order to simulate the system properly, random numbers must be used in such a fashion that when many photons are simulated, the probabilistic events occur in the simulation with the frequency predicted by theory. To verify that the code is correct, each components of the code was tested. The results are presented here.

**Random Number Generation:**

The random number generator must
provide uniform weighting
on the interval (0,1). The
graph below
shows the distribution of 10 million random numbers from Matlab’s
default
Marsaglia *subtract with borrow* random number
generator, with resolution
0.001. As one can
see, the distribution
is quite uniform. Although
this
preliminary test appears reasonable, further testing will be carried
out.

Figure
1. 10 million
random numbers from Matlab’s
default generator.

**Optical path length
selection:**

Bulk layers have an IOP known as the
“volume extinction
coefficient” (or just “extinction”), which is the sum of the volume
scattering
coefficient and the volume absorption coefficient.
The extinction *σ* is defined as the
fraction of photons or
energy lost from a beam per infinitesimal distance traveled. For finite distances this
results in “Beer’s
Law” , which states that the intensity decreases exponentially with the
extinction times the distance: . This is rigorously
true for absorption loss, but for scattering, photons may multiply
scatter and
“reenter” the beam path. Also,
depending on how one measures the “beam”, photons may be scattered
through such
small angles that they still appear to be part of the initial beam, and
are
counted even when measured in a very small solid angle.
But for low scattering path lengths, Beer’s
Law holds up.

The AO3D model employs a random
number to determine the path
transmission (optical path traveled) for each photon.
By integrating the optical path within each layer, the
photon’s
final extinction location is determined.
In order to test this algorithm, the number of photons
passing through
each distance interval were calculated with AO3D, and plotted (green
markers)
in Figures 2 and 3. A
plot of Beer’s
Law is also shown for comparison (solid blue line).
Figure 2 is for pure absorption, while Figure 3 is for
pure
scattering. The
results are from a run
of the code with a single atmospheric layer with a marine aerosol,
which
scatters almost entirely into small angles, and the extinction set to
0.01 m^{-1}. The
observation is set to a downwelling
radiance grid with 1-meter resolution in the z-direction, and 1-degree
acceptance half-angle.

Figure
2. Beer’s Law Test,
50,000 photons, absorption
= 0.01 m^{-1}, scattering = 0 m^{-1}.

Figure
3. Beer’s Law Test,
50,000 photons, absorption
= 0 m^{-1}, scattering = 0.01 m^{-1},
acceptance half-angle = 1
degree.

Figure 3 shows the results of the pure scattering test. Again it is nearly perfect. Note that for longer distances, the number of photons in the beam is higher than Beer’s Law predicts. We also see that virtually no photons exit and reenter the beam within 1 degree, as the conformance at greater distances is nearly complete. Further studies are being carried out with higher scattering coefficients.

**Scattering Angle Selection
(Phase Function tests):**

The
phase
function is the probability density function of scattering for a
particular
solid angle (PDF_{Ω}).
When the
phase function is integrated over a solid angle (PDF_{angle}),
it
describes the probability of a photon being scattered within particular
polar
and azimuth angles. The
Monte Carlo
approach must select scattering angles which conform with the phase
function
once many realizations have been carried out.
To test the AO3D code, scattering angles selected from the
Monte Carlo
approach were compared with
the
original probability density curves for the phase functions.

Figure
4
shows the base-10 logarithm of the total weighted phase function for a
typical
polluted marine aerosol with air.
Figure 5 is a
plot of the theoretical PDF_{angle} and the frequency of occurrence of sampled
angles.

Figure
4.
Polluted Marine Atmosphere Phase Function, 500 nm

Figure
5.
Polluted Marine Atmosphere Actual and Sampled PDF – 100,000 photons

Figure
6
shows the base-10 logarithm of the total weighted phase function for
typical
turbid water. Figure 7 is a plot of the theoretical
probability density function (PDF_{angle}) and
the frequency of occurrence of sampled angles.

Figure
6.
Snohomish River West of Jetty Phase Function, 500 nm

Figure
7. Snohomish River
West of Jetty Actual and
Sampled PDF – 100,000 photons

Figure
8. Frequencies of
occurrence of ocean surface
x- and y-tilts calculated by Monte Carlo approach.
The weighting distribution is based on the Cox and Munk
model. (wind speed
10 m/s, 1 million
photons).

Figure
9. Frequency of
occurrence of alongwind slope (y-axis), wind speed of 10 m/s in
y-direction.

Solid line is the Cox and
Munk
expression. Green
markers show Monte
Carlo results.

Figure
10. Frequency
of occurrence of crosswind slope (x-axis), wind speed of 10 m/s in
y-direction.

Solid line is the Cox and
Munk
expression. Green
markers show Monte
Carlo results.