Sasktran Version 3  3.0
Sasktran Version 3 Documentation
Sasktran V2 is a new implementation of the Sasktran scalar radiative transfer model. The model is written in C++ and is currently available for Windows in both 32 bit and 64 bit versions. Linux and other Unix versions are not yet available although porting the code would not be a major challenge. The primary goal of the model is to achieve a sensible balance between speed of execution and accuracy of solution so it can be applied to satellite operations for the inversion and retrieval of trace species from various radiance measurements.

The model is intended for optically thin media on a spherical body. The model is well suited for applications in the stratosphere and mesosphere. The model is not well suited for ray tracing in optically thick media, such as dense clouds. The model explicitly assumes all rays are traced in a spherical atmosphere. Thus the model is most appropriate for conditions where unit optical depth along one ray occurs on a scale size where the curvature of the atmosphere is important. In Earth's atmosphere for example, atmospheric curvature is important on scale sizes of tens and hundreds of kilometers.

Successive Orders Model
The model employs an iterative successive orders algorithm to calculate radiance. In principle, this calculating the radiance at every point and direction using source functions generated from scattering the radiancesz from the last iteration. The problem is 5 dimensional which translates to large memory footprints. The current version of Sasktran reduces this to a 4 dimensional problem by assuming the profiles of atmospheric optical properties are symmetric in solar longitude. Future releases will not always assume symmetry.

Components The model, from a programming perspective, has the following components

#- the ray geometry used by the model. This is implemented in a class derived from #SKTRAN_GridSpecifications_V2
#- the optical properties of the atmosphere. This is implemented in class #SKTRAN_AtmosphericState
#- the ground albedo defined by a class derived from class #SKTRAN_RTAlbedo
#- The Sasktran engine, implmented in class #SKTRAN_EngineInterface_V2

(often only one) and the accuracy of these terms depends mostly upon the validity of the coarse interpolation. execution and are sufficiently accurate for calculate the radiance coming into a single point at a single instant in time from several directions at several wavelengths. The single point represents an observer who may be below, in or above the atmosphere. The model was built to analyze radiances collected from limb viewing spacecraft but can be applied to nadir viewing geometries. Solar occultation geometries are not yet fully supported (2009-03-31) as we do not include the direct "no scatter" signal from the sun to the observer (this will change).

Numerical Efficiency
The model
Ray Tracing
The model currently assumes all rays at all wavelengths follow the same trajectories through the atmosphere. This allows the model to calculate ray trajectories through the atmosphere just once and use the same trajectories for different wavelengths. Optical properties or rays such as absorption, scattering and extinction change with wavelength but ray trajectories are assumed to be independent of wavelength. We currently (2009-03-31) support straight line geometry but may include refractive bending (which is almost wavelength independent in optical regions) in later versions.
\Memory Usage
This radiative transfer model typically consumes between several hundred of megabytes of memory to a few tens of gigabytes. This
is a heavy burden on any operating system and can quickly exhaust system memory through memory fragmentation. The best strategy to avoid 
memory allocation failure is to use one instance of #SKTRAN_EngineInterface_V2 and keep it alive for the length of the process. This
is especially useful if the ray geometry configuration is not changing the nature of the ray tracing (eg the number of heights is the same).
Sample Code
A piece of example code is given below to help get you on your way. This code snippet focuses on usage of the the engine in a typoical inversion scenario.
bool ok;
SKTRAN_AtmosphericOpticalState_V2* species;
SKTRAN_GridSpecificationsLegacy_V2* specs;
SKTRAN_EngineInterface_V2* sasktranengine;
skRTAlbedo_Constant* albedo;
nx1dArray<double> wavelens;
size_t numorderscatter;
nx2dArray<double> lineofsightradiance;
sasktranengine = new SKTRAN_EngineInterface_V2; // Create the engine instance
ok = MakeUserDefined_Specifications( &specs, i ); // Make the ray-tracing specs for this geometry
ok = ok && sasktranengine->ConfigureGeometry( specs ); // Configure the ray tracing geometry
for (i = 0; i < numiterations; i++) // For each iteration
{ // Setup the atmosphere
ok = MakeUserDefined_SpeciesList ( &species, i ); // Make the atmospheric optical properties for this iteration
ok = ok && MakeUserDefined_Albedo ( &albedo, i ); // Make albedo object for this iteration
ok = ok && MakeUserDefined_Wavelengths ( &wavelens, &numorderscatter, i ); // Make array of wavelengths for this iteration
if (ok) // If everything is good
{ // then configure wavelengths for this iteration
ok = ok && sasktranengine->SetWavelengths ( wavelens.UnsafeArrayBasePtr(), numorders, wavelens.size(), 0 );
ok = ok && sasktranengine->SetSpeciesList ( species ); // Setup the atmospheric properties
ok = ok && sasktranengine->SetAlbedo ( albedo ); // Setup the albedo
ok = ok && sasktranengine->StartWavelengthProcessingThreads ( true); // Start wavelength procesisng, wait for it to complete
if (ok) // If it worked
{ // then
lineofsightradiance = *(sasktranengine->ObserverLOSRadianceArray()); // get the line of sight array
AdjustNextIteration( lineofsightradiance ); // adjust the iteration
} // and we are done
} // with this iteration
species->Release(); // Release current atmospheric properties
albedo->Release(); // Release current albedo properties
} // do all of the iterations
delete sasktranengine; // delete the engine (you might keep it around if we have more iterations to do)
specs->Release(); // Release the geometry specifications
// and we are donme