You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 1<br />
User’s <strong>Guide</strong><br />
LIDORT, Version 2.3<br />
A Linearized Discrete Ordinate Radiative Transfer<br />
Model for Atmospheric Retrieval<br />
Author: Robert Spurr<br />
Harvard-Smithsonian Center for Astrophysics<br />
60 Garden Street, Cambridge, MA 02138, USA<br />
Tel. +1 617 496 7819<br />
email: rspurr@cfa.harvard.edu<br />
January 2001
LIDORT - User’s <strong>Guide</strong> to Version 2.3 2<br />
Table of Contents<br />
1. Introduction to LIDORT Versions V2.3S and V2.3E<br />
1.1 Background and General Introduction<br />
1.2 Scope of Version 2.3<br />
1.3 Summary of User’s <strong>Guide</strong> to Version 2.3<br />
2. LIDORT Structures; Input/Output and Initialization File<br />
2.1 Standard Structures<br />
2.2 Extended Structures<br />
2.3 Initialization File Example<br />
3. LIDORT Package; Environment and Master Module<br />
3.1 LIDORT Package Organization<br />
3.2 Use of LIDORT Master Module in an External Environment<br />
3.3 Computational Sequence in LIDORT_V23E_MASTER<br />
4. Geophysical Input Preparation<br />
4.1 Preparation for LIDORT_GEOPHYS.VARS (Standard)<br />
4.2 Preparation for LIDORT_L_GEOPHYS.VARS (Extended)<br />
5. Installation, Makefile and Test Example<br />
5.1 Installation Procedure<br />
5.2 Makefile Example in Directory V23E_RELEASE<br />
5.3 Test-case Example in Directory V23E_RELEASE<br />
6. Error Handling, Utilities, Validation, References<br />
6.1 Error Handling<br />
6.2 Utilities<br />
6.3 A Note on Validation<br />
6.4 References
LIDORT - User’s <strong>Guide</strong> to Version 2.3 3<br />
1. Introduction to LIDORT Versions 2.3S and 2.3E<br />
1.1 Background and History<br />
LIDORT [1] [7] is a generic discrete ordinate radiative transfer package designed to produce both backscatter<br />
intensities and weighting functions for a general atmospheric scenario. In addition to the usual<br />
backscatter intensity simulation, LIDORT can generate simultaneously whole fields of analytic weighting<br />
functions, without the need for repeated RT model calls based on finite-difference estimations. It is thus<br />
ideally suited to retrieval applications in the earth’s atmosphere. The model is a pure scattering formalism<br />
using optical depth as the vertical coordinate; there are no databases, and the user must define and set up<br />
the required inputs before calling the package as a subroutine within a test environment.<br />
Version 1.0 of LIDORT was developed in Summer 1999 for a plane-parallel multi-layer atmosphere with<br />
full multiple scattering, beam and thermal emission source terms, and with a general reflecting boundary<br />
condition. Version 1.0 may be termed the “satellite application”, that is, output is restricted to upwelling<br />
intensities and weighting functions at the top-of-the-atmosphere (TOA) reference level. As far as intensities<br />
are concerned, the scope of Version 1.0 is almost the same as that for the DISORT plane-parallel package<br />
[2], except for the restriction to TOA output. A number of modifications and additional features were<br />
developed for Version 1.1, which was given public release in November 1999 (there is now a website for<br />
LIDORT - see Chapter 5). For details, see [1]. This version was validated against DIOSRT Version 1.<br />
Version 2.1 of LIDORT was developed over the period October 1999 to July 2000. The basic package of<br />
Version 1.1 was completely reorganized in order to incorporate a number of extensions which are<br />
described in the next section. Version 2.1 was released in October 2000. As with Version 1, the LIDORT<br />
package was written in FORTRAN 77; double precision arithmetic was used throughout. For a description<br />
of the theory and some applications of Version 2.1, see [7]. Version 1.1 was based on a complete perturbation<br />
analysis of the plane-parallel discrete ordinate solution in a multi-layered atmosphere; the emphasis in<br />
Version 2.1 is on explicit differentiation of the discrete ordinate solution in order to find Jacobian derivatives<br />
of the intensity field; the techniques are equivalent since the discrete ordinate differential equations<br />
are linear. We use the term linearization to denote the process of differentiation.<br />
Version 2.3 contains an extension to generate weighting functions with respect to phase function expansion<br />
coefficients. This is of great potential importance for the retrieval of aerosol properties, and this extends the<br />
scope of the model to a new area of retrieval problems. The inputs have been simplified for this version;<br />
principally, only the total single scattering albedo and phase function moments (and their parameter derivatives<br />
for the linearization) are taken as input - references to individual scatterers have been dropped. The<br />
inputs are now exactly the same as those for DISORT. Version 2.3 also comes with a single scatter correction<br />
package based on the Nakajima-Tanaka (NT) algorithm [8]. Partial validation against DISORT Version<br />
2.0 (which has the NT single scatter correction) has been carried out for a number of situations [9].<br />
Fast and accurate 4 and 6 stream versions of LIDORT Version 2.3 have been developed for use in the ozone<br />
profile retrieval algorithms for GOME and related instruments [9]. When the single scatter correction is<br />
performed, it is only necessary to do the main LIDORT discrete ordinate calculation for the multiple-scatter<br />
contributions. Some saving in time is gained in this manner, as the Fourier azimuth convergence is<br />
faster for the multiple-scatter parts.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 4<br />
1.2 Scope of Version 2.3<br />
In addition to the classical treatment of the beam particular integral discrete ordinate solution developed by<br />
Chandrasekhar [3] and used in the DISORT work [2], Versions 2.1 and 2.3 feature an alternative treatment<br />
of this source term using the powerful Green’s function technique developed by Siewert and co-workers<br />
[4]. Both Versions 2.1 and 2.3 have the ability to generate weighting functions and intensity fields anywhere<br />
in the atmosphere, for upwelling and downwelling directions, for arbitrary optical depths and stream<br />
angles. This extends the scope of the model to cover a much wider range of geophysical scenarios, including<br />
all ground-based and airborne applications. There is also a facility for output of layer-integrated multiple<br />
scatter source terms and their weighting functions; this is useful for limb scattering retrieval<br />
applications, and for the sphericity correction required for wide-angle off-nadir viewing in the GOME-2<br />
instrument [9].<br />
In addition to the plane parallel formulation, Versions 2.1 and 2.3 have the ‘pseudo-spherical’ approximation<br />
of the radiative transfer equation, in which the direct beam attenuation is treated in a curved atmosphere.<br />
In Version 2.1, all slant path optical thickness values were input to the model (no ray tracing). In<br />
Version 2.3, these are (optionally) calculated inside LIDORT for a non-refractive atmosphere; for a refracting<br />
atmosphere, they must be input. Both weighting functions and intensities can be generated using the<br />
‘average secant’ approximation to the solar beam attenuation - this is valid for most applications with solar<br />
zenith angles < 90 degrees. The Delta-M scaling option [5] is available for the treatment of sharply peaked<br />
forward scattering scenarios. The NT single scatter correction package for Version 2.3 is dependent on the<br />
use of results from LIDORT, and is performed after the main discrete ordinate calculation.<br />
The Green’s function technique allows the spherical-atmosphere direct beam attenuation to be treated in a<br />
more sophisticated manner using a Fourier sine series to represent the attenuation. This additional feature<br />
is the subject of a separate research development for intensity-only calculations [6]; it will not be included<br />
in the present package.<br />
Following discussions with a number of users of the model, it has been decided in Versions 2.1 and 2.3 to<br />
make a division between an intensity-only model (Versions 2.1S and 2.3S) and an extended model with the<br />
additional weighting function capability (Versions 2.1E and 2.3E). Apart from the three topmost high-level<br />
modules, all code in the “S” package is a subset of that used in the “E” packages; the extended versions<br />
have been constructed around the core of the “S” packages.<br />
This user’s guide is a description of the Extended Version 2.3E. In view of the above remarks, the guide<br />
will cover all the necessary requirement for the standard “S” version. Additional remarks on installation of<br />
the standard version will be given where appropriate.Version 2.3E has the following features:<br />
• Quasi-spherical (average secant) and plane-parallel treatments for an external beam source;<br />
• Particular integral solution using the “classical” technique or the Green’s function method;<br />
• Full multiple scattering formalism for several scatterers;<br />
• Bi-directional reflectance at the lower boundary, including surface thermal emission (isotropic);<br />
• Intensity output at arbitrary optical depth, for any set of azimuth and elevation angles, for upwelling<br />
and/or downwelling directions;<br />
• Additional options for mean value output (flux, mean intensity) at arbitrary optical depth;<br />
• Additional options for layer-integrated multiple scatter source terms and their weighting functions;<br />
• Weighting function output at arbitrary optical depth, for any set of azimuth and elevation angles, for<br />
upwelling and/or downwelling directions;
LIDORT - User’s <strong>Guide</strong> to Version 2.3 5<br />
• Weighting functions with respect to layer atmospheric variables (including phase function quantities)<br />
defined by the user, weighting functions for albedo and surface emission.<br />
• The Nakajima-Tanaka single scatter module, for both intensity and weighting function correction.<br />
1.3 Summary of User’s <strong>Guide</strong> to Version 2.3<br />
The layout of the present document is similar to that used in the earlier User’s <strong>Guide</strong> for Version 2.1. Chapter<br />
2 deals with the structures (collections of variables) used in the model, with particular emphasis on<br />
input and output structures; this is followed by an example of the initialization file which controls the handling<br />
of input variables. Chapter 3 starts with a summary of the contents of the LIDORT package, and discusses<br />
the environment for a call to LIDORT. A “pseudo-code” description of the top-level calculation<br />
module is given.<br />
The preparation of geophysical atmospheric inputs (single scattering albedos, vertical optical thickness<br />
values, phase function moments, albedos etc., plus variational derivatives required for the linearization) is<br />
application-specific, and must be done by the user. This is the most important part of the input procedure,<br />
and we deal with this aspect in detail in Chapter 4, using a number of simple examples including one taken<br />
from a terrestrial atmosphere application (the forward model component of the ozone profile retrieval from<br />
nadir backscatter measurements in the UV).<br />
Chapters 5 deals with installation aspects, from the use of a “makefile” in the compilation and linking, to<br />
the verification procedure for a given test-case example. The last chapter describes briefly the LIDORT<br />
error handling procedure and auxiliary modules required for numerical calculations.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 6<br />
2. LIDORT Structures; Input/Output and Initialization File<br />
Structures are just files with variable declarations and a storage facility (in FORTRAN 77 we use COM-<br />
MON block statements). The set of LIDORT structures is divided in two groups - one for the intensity-only<br />
calculations in V2.3S (the Standard or core structures, dealt with in Section 2.1), and a second group<br />
which is required for the weighting function applications in V2.3E (the Extended or supplementary structures,<br />
Section 2.2). The Initialization file is described with an example in Section 2.3. Here are summary<br />
lists.<br />
First Group - Standard Structures<br />
Structures in this group are required for both the standard and the extended versions of LIDORT. All structures<br />
in this Section are found in a directory labeled include_s. The following is a complete list:<br />
Constants, symbolic dimensions and fixed indices<br />
• LIDORT.PARS<br />
Input structures (control and model/geophysical variables)<br />
• LIDORT_CONTROL.VARS<br />
• LIDORT_MODEL.VARS<br />
• LIDORT_GEOPHYS.VARS<br />
Output structure (intensities)<br />
• LIDORT_RESULTS.VARS<br />
Lidort internal structures<br />
• LIDORT_LEGENDRE.VARS<br />
• LIDORT_MULTIPLIERS.VARS<br />
• LIDORT_SETUPS.VARS<br />
• LIDORT_SOLUTION.VARS<br />
• LIDORT_SSCORRECTION.VARS<br />
Second Group - Extended Structures<br />
Structures in this group are required only for the extended version V2.3E of LIDORT. All structures in this<br />
Section are found in a directory labeled include_e. The following is a complete list:<br />
Additional symbolic dimensions<br />
• LIDORT_L.PARS<br />
Additional Input structures (control and geophysical variables)<br />
• LIDORT_L_CONTROL.VARS<br />
• LIDORT_L_GEOPHYS.VARS<br />
Additional Output structure (weighting functions)<br />
• LIDORT_L_RESULTS.VARS<br />
Lidort internal structures
LIDORT - User’s <strong>Guide</strong> to Version 2.3 7<br />
• LIDORT_L_MULTIPLIERS.VARS<br />
• LIDORT_L_SETUPS.VARS<br />
• LIDORT_L_SOLUTION.VARS<br />
• LIDORT_L_SSCORRECTION.VARS<br />
2.1 Standard Structures<br />
The first 5 files in the above list of standard structures cover the input/output requirements for all applications,<br />
and they must be included in any interface and environment modules. The fixed structure<br />
LIDORT.PARS must be declared before all other structures to ensure consistency with the dimensioning.<br />
These 5 files are described in detail below; the remaining four internal structures are not required in the<br />
input/output description, but are noted briefly here.<br />
2.1.1 Fixed Structure LIDORT.PARS<br />
We leave out fixed numbers such as π, 0.0, 1.0, etc., and some fixed character strings used for output formatting.<br />
File unit numbers are also omitted. The following parameter indices are used to indicate the error<br />
status for the package or any part of it:<br />
LIDORT_SUCCESS = 0 (status index for a successful execution).<br />
LIDORT_SERIOUS = 1 (status index for an aborted execution).<br />
We now describe the basic set of dimensioning parameters. These numbers should be altered to suit memory<br />
requirements and/or a particular application. For example, if a calculation with clouds is required,<br />
allowance should be made for a large number of phase function moments and sufficient quadrature<br />
streams, so MAXSTRM and MAXMOMENT should be increased in value. All other dimensioning parameters<br />
are combinations of this basic set, and are not described here.<br />
MAXSTRM<br />
Maximum possible number of half-space quadrature streams.<br />
MAXLAYER<br />
Maximum allowed number of layers in the atmosphere.<br />
MAXMOMENT<br />
Maximum number of Legendre expansion coefficients. This should be at least twice MAXSTRM.<br />
MAXFOURIER<br />
Maximum number of allowed terms in the Fourier cosine azimuth series.<br />
This should be at least twice MAXSTRM.<br />
MAX_DIRECTIONS<br />
Maximum number of directions (= 2, “upwelling” or “downwelling”).<br />
MAX_USER_STREAMS<br />
Maximum allowed number of user-defined off-quadrature stream angles desired for output.<br />
MAX_USER_RELAZMS
LIDORT - User’s <strong>Guide</strong> to Version 2.3 8<br />
Maximum allowed number of user-defined relative azimuth angles desired for output.<br />
MAX_OUT_USERTAUS<br />
Maximum allowed number of user-defined optical depths at which output is required.<br />
MAX_OFFGRID_USERTAUS<br />
Maximum allowed number of off-grid optical depths at which output is required (Off-grid means optical<br />
depths between layer boundaries). This number should always be less than MAX_OUT_USERTAUS.<br />
There are two dimensioning parameters here for the optical depth output, as this gives maximum amount of<br />
choice in output specification.<br />
The following two parameters are used to ‘toggle’ special cases.<br />
HOPITAL_TOLERANCE<br />
If the difference between a user-stream cosine and (say) the solar zenith angle cosine is less than<br />
HOPITAL_TOLERANCE, L’Hopital’s Rule will be invoked to provide a limit value. Currently set at 10 -5 .<br />
OMEGA_SMALLNUM<br />
If any total layer single scattering albedo is within OMEGA_SMALLNUM of unity, then its value will be<br />
reset to 1.0 - OMEGA_SMALLNUM. Currently set at 10 -6 .<br />
The following parameters are used to deal with underflow in the transmittance factors.<br />
MAX_TAU_SPATH<br />
If the solar path optical thickness exceeds this limit, then corresponding transmittances (negative exponentials)<br />
will be set to zero. Current value 32.<br />
MAX_TAU_UPATH, MAX_TAU_QPATH<br />
If (respectively) the path optical thickness values for the user-defined and quadrature directions exceed<br />
these limits, then corresponding transmittances (negative exponentials) will be set to zero. Current values<br />
32.<br />
2.1.2 Input Structure LIDORT_CONTROL.VARS<br />
This file contains major control variables for the execution of the package. All variables may be specified<br />
using explicitly-coded statements written by the user, or they may be assigned by reading entries in the Initialization<br />
file (this task is done using the LIDORT_V23S_INPUT or LIDORT_V23E_INPUT master<br />
modules). In this structure, all entries are Boolean values (with the exception of the “FILENAME” variables).<br />
Where appropriate, all variables are checked for consistency inside the LIDORT package, before<br />
execution of the main radiative transfer modules.<br />
DO_DIRECT_BEAM<br />
Control for the inclusion of the direct beam contribution in the output. Should be set .TRUE. This variable<br />
will be replaced in later version.<br />
DO_CLASSICAL_SOLUTION<br />
Flag for using the Chandrasekhar (classical) solution of the discrete ordinate particular integral for the<br />
beam source. If not set, the Green’s function solution will be used.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 9<br />
DO_QUASPHER_BEAM<br />
Flag for use of the quasi-spherical approximation for the direct beam attenuation. If not set, the atmosphere<br />
will be plane-parallel.<br />
DO_QSREFRAC_BEAM<br />
Flag for using refractive geometry input in the quasi-spherical approximation. DO_QUASPHER_BEAM<br />
must be set first (this is checked). Ray tracing in a refractive atmosphere is not done inside LIDORT, and if<br />
this flag is set, the slant path optical thickness values TAUTHICK_INPUT (see below) must be calculated<br />
by the user. If set, a small internal adjustment will be made to the direct beam zenith angles at each layer.<br />
DO_CHAPMAN_FUNCTION<br />
Flag for making an internal calculation of TAUTHICK_INPUT for either plane-parallel or non-refractive<br />
pseudo-spherical geometry. This will not work with DO_QSREFRAC_BEAM (a check is made for this). If<br />
called, you must specify a height grid and earth radius in order that the goniometry can be done inside<br />
LIDORT. (New to Version 2.3).<br />
DO_RAYLEIGH_ONLY<br />
Flag for performing simulations in a Rayleigh atmosphere with only one scatterer (in this case, molecules).<br />
If set, a maximum of 3 Fourier terms will be used in the azimuth expansion (Rayleigh phase function has<br />
cos 2 Θ behavior). (Checked internally).<br />
DO_ISOTROPIC_ONLY<br />
Flag for performing simulations in an isotropically scattering atmosphere. If set, then only the azimuthindependent<br />
contribution is required (first Fourier component). DO_NO_AZIMUTH must be set “true”.<br />
(Checked internally).<br />
DO_LAMBERTIAN_ALBEDO<br />
Flag for using the Lambertian surface reflection condition at the lower boundary. If “false”, boundary is<br />
assumed fully bidirectional.<br />
DO_SURFACE_EMISSION<br />
Flag for inclusion of the black-body surface emission term.<br />
DO_NO_AZIMUTH<br />
Flag for controlling inclusion of azimuth dependence in the output. If set, then only the fundamental harmonic<br />
(azimuth-independent) contribution will be calculated. Must be set for the DO_ISOTROPIC_ONLY<br />
option to be taken.<br />
DO_FULL_QUADRATURE<br />
Flag controlling the use of a single quadrature scheme over complete elevation space (both hemispheres).<br />
If not set, quadrature will default to the standard double scheme of DISORT and other models. Not recommended<br />
for practical use. This will be removed in the next version.<br />
DO_ALL_FOURIER<br />
Flag controlling calculation of Fourier azimuth terms. If set, LIDORT will calculate all possible Fourier<br />
components, regardless of any accuracy convergence criterion. If not set, usual convergence criterion will<br />
apply. Should only be required for test purposes.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 10<br />
DO_DELTAM_SCALING<br />
Flag for controlling use of the Delta-M scaling option. In most circumstances, this flag will be set. Delta-M<br />
scaling is now automatic in DISORT Version 2.0, but we prefer to leave the option open.<br />
DO_ADDITIONAL_MVOUT<br />
Flag to produce mean-value output in addition to intensities and weighting functions. This is now independent<br />
of DO_QUAD_OUTPUT and DO_USER_STREAMS flag settings. The model will produce mean<br />
value results on-the-fly.<br />
DO_MVOUT_ONLY<br />
Flag to generate mean-value output only. Since these quantities are hemisphere-integrated, there is no need<br />
for any angular output, and in addition, only the fundamental harmonic (azimuth-independent) contributes.<br />
Thus the DO_USER_STREAMS and DO_NO_AZIMUTH flags will be checked for consistency.<br />
SAVE_LAYER_MSST<br />
Flag to produce layer-integrated multiple scatter source term output in addition to total intensities and<br />
weighting functions. This output is restricted to whole layers and can only be generated if flag<br />
DO_LBOUND_TAUS (see below) is set at the same time. (Output is also restricted to off-quadrature<br />
angles).<br />
This is a specialist option and should be used only in certain circumstances, principally the following: (a)<br />
for a limb-scattering application, in which the single scatter source terms are generated by ray tracing<br />
along the limb paths, then added to a suitable combination of layer-integrated multiple scatter source<br />
terms to generate the backscatter field; and (b) for nadir applications with wide viewing angles, where the<br />
upwelling single scatter contributions may be replaced by NT-corrected accurate values.<br />
DO_FULLRAD_MODE<br />
If set, LIDORT will give a full radiance calculation of intensities and weighting functions. The only time<br />
this flag should not be set is when SAVE_LAYER_MSST output is required.<br />
DO_SSCORRECTION<br />
If set, LIDORT will perform the single scatter correction. DO_FULLRAD_MODE must be set first. This<br />
only works for user-defined stream output, so DO_QUAD_OUTPUT should not be set (this is checked).<br />
When DO_SSCORRECTION and DO_FULLRAD_MODE are both set, LIDORT will do an internal discrete<br />
ordinate calculation only of the multiple-scatter field, leaving the single scatter field to be evaluated in<br />
the SSCORRECTION post-processing module. This is the normal mode of operation; it saves considerably<br />
on time, since Fourier azimuth convergence is tested only on the multiple-scatter field.<br />
DOUBLE_CONV_TEST<br />
(New to Version 2.3). If set, the Fourier azimuth series will be examined twice for convergence; in previous<br />
versions the double test was fixed. If not set, a single test is made; in this case one saves on an additional<br />
Fourier computation. However in normal mode, LIDORT examines convergence of the multiple scatter<br />
field; one test may well be enough for this. Testing is currently being done to verify this is the case.<br />
DO_QUAD_OUTPUT<br />
If set, there will be output at the quadrature zenith angles used in the discrete ordinate solution. Not normally<br />
required, but may be of use. Cannot be used with the single scatter correction<br />
DO_SSCORRECTION.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 11<br />
DO_USER_STREAMS<br />
If set, there will be output at a number of off-quadrature zenith angles to be specified by the user. This<br />
would normally be the output flag to use for stream angle output. If this and the previous flag are not set,<br />
then there will be no output - this is checked.<br />
DO_USER_TAUS<br />
Flag for arbitrary optical depth output. This would normally be used in conjunction with a number of specified<br />
levels of output. This is the usual flag to set for optical depth.<br />
DO_LBOUND_TAUS<br />
Flag for output at layer boundaries. This is complementary to the previous DO_USER_TAUS flag; the two<br />
cannot be set together. If you want just layer boundary output, this is the one to use.<br />
DO_UPWELLING, DO_DNWELLING<br />
Flag for obtaining upwelling and/or downwelling output. One or both must be set!<br />
DO_DEBUG_INPUT<br />
Flag for writing-to-file for debugging. Do not use.<br />
DO_WRITE_INPUT<br />
Flag for writing-to-file of all input variables (including those in the present structure). Optional.<br />
DO_WRITE_SCENARIO<br />
Flag for writing a summary of the atmospheric geophysical input to file. Optional.<br />
DO_WRITE_RESULTS<br />
Flag for writing output to file. This is not mandatory, as LIDORT may be embedded in a wavelength loop<br />
(for example) and the results of each call may be stored and written at a later stage in the test environment.<br />
DO_WRITE_RESULTS_IDL<br />
Flag for writing results to IDL file. Not recommended for use in the present version.<br />
DO_WRITE_FOURIER<br />
Flag for output of Fourier components. Not normally required.<br />
INPUT_WRITE_FILENAME, IDLRESULTS_WRITE_FILENAME, SCENARIO_WRITE_FILENAME<br />
FOURIER_WRITE_FILENAME, RESULTS_WRITE_FILENAME<br />
These 5 character strings are for the specification of 5 output files corresponding to the above 5 flags controlling<br />
output.<br />
LIDORT_ERROR_FILENAME<br />
Character string indicating name of file to contain error messages (if any). This file will be opened at the<br />
first serious error encounter and closed before exiting the package. This string will be assigned at the start<br />
of the initialization file-read, to the string passed as an argument into the file-read master module (see Section<br />
3.2 for an example). If you do not specify a name, the error file will be “fort.25”.<br />
LIDORT_ERROR_INIT
LIDORT - User’s <strong>Guide</strong> to Version 2.3 12<br />
This Boolean flag will be set “false” at the start of the input file-read. LIDORT will set this flag internally if<br />
any errors have occurred. It is not read from the Initialization File.<br />
2.1.3 Input Structure LIDORT_MODEL.VARS<br />
This file contains major variables controlling the execution. In addition to such key numbers as<br />
NSTREAMS and NLAYERS (see below), this file contains all the geometrical input quantities - the solar<br />
zenith angle cosine, the quadrature stream angles and weights, the fields of user-defined azimuth angles<br />
and off-quadrature zenith angles, as well as optical depth input. The file is divided into those variables<br />
which must be specified beforehand by the user (either explicitly or using the file-read capability), and<br />
those which are derived internally (for example, the Gaussian quadrature weights and cosines which are<br />
computed afresh with each call to LIDORT).<br />
User-defined (file-read) variables<br />
NSTREAMS<br />
Number of quadrature streams in the zenith cosine half space [0,1]. Must be less than or equal to the symbolic<br />
dimension MAXSTRM set in the fixed-numbers structure LIDORT.PARS.<br />
NLAYERS<br />
Number of layers in the atmosphere (NLAYERS=1isallowed). Must be less than or equal to the symbolic<br />
dimension MAXLAYER.<br />
NMOMENTS_INPUT<br />
Number of moment coefficients characterizing the phase function. When using the delta-M scaling<br />
NMOMENTS_INPUT should be at least equal to 2*NSTREAMS to ensure that the delta-M truncation<br />
factor is meaningfully calculated. NMOMENTS_INPUT need not be the same as the internal variable<br />
NMOMENTS which governs the Legendre phase function expansions in the full discrete ordinate computations<br />
(see below). NMOMENTS_INPUT will be used in the single scatter correction to generate accurate<br />
phase functions, so it should be set accordingly. Must be less than MAXMOMENTS.<br />
FLUX_FACTOR<br />
Beam source irradiance value. Normally set equal to 1 for “sun-normalized” output.<br />
LIDORT_ACCURACY<br />
This is the accuracy criterion for convergence of the Fourier cosine series in relative azimuth. If for each<br />
output stream, addition of the m th Fourier harmonic changes the total (Fourier-summed) intensity by less<br />
than LIDORT_ACCURACY of the total, then we have passed the convergence test for the first time (the<br />
double test is controlled by flag DOUBLE_CONV_TEST). Convergence is tested for all output intensities<br />
at all output stream angles, optical depths and azimuth angles.<br />
SUN0<br />
Beam source zenith angle (degrees). (Checked internally to be in the range [0,90)).<br />
EARTH_RADIUS<br />
Earth’s radius in [km]. Only required when DO_CHAPMAN_FUNCTION has been set. This number is<br />
needed to do the geometry internally in this case. Checked internally to be in the range [6320,6420].
LIDORT - User’s <strong>Guide</strong> to Version 2.3 13<br />
SUNLOCAL_INPUT(MAXLAYER)<br />
Beam source zenith angles, defined one for each layer. Only required for refractive geometry attenuation of<br />
the solar beam (DO_QSREFRAC_BEAM), in which case the user must define it. For non-refractive geometry<br />
SUN0 will be used for every layer.<br />
ZENITH_TOLERANCE<br />
Zenith tolerance (nearness of output zenith cosine to 1.0)<br />
N_USER_STREAMS<br />
Number of user-defined zenith streams (off-quadrature). Must be not greater than symbolic dimension<br />
MAX_USER_STREAMS set in LIDORT.PARS.<br />
USER_ANGLES_INPUT(MAX_USER_STREAMS)<br />
Array of user-defined angles at which off-quadrature output is to be generated (values in degrees). The<br />
ordering is not important (LIDORT orders and checks this input internally).<br />
N_USER_RELAZMS<br />
Number of relative azimuth angles at which output is to be generated. Must be not greater than symbolic<br />
dimension MAX_USER_RELAZMS set in LIDORT.PARS.<br />
USER_RELAZMS(MAX_USER_RELAZMS)<br />
Values of relative azimuth angles in degrees.<br />
N_OUT_USERTAUS<br />
Number of optical depth output values. Required if DO_USER_TAUS is set. Should be less than or equal<br />
to the symbolic dimension MAX_OUT_USERTAUS.<br />
USER_TAUS_INPUT(MAX_OUT_USERTAUS)<br />
Output optical depth values. These can be in any order (LIDORT sorts them in ascending order internally).<br />
They are checked to see if any value exceeds the optical depth grid defined below as part of the geophysical<br />
input structure. Repetition of input values is also checked.<br />
LBOUND_TAUS_INPUT(MAX_OUT_USERTAUS)<br />
Integer values indicating which layer boundaries are required for optical depth output. Can be specified in<br />
any order; the value 0 indicates top of the atmosphere, the value 1 indicates the bottom boundary of the first<br />
layer, etc. Should not be greater than NLAYERS (this is checked). Should only be used if the associated<br />
flag is set (DO_LBOUND_TAUS). Repetition of input values is also checked.<br />
Derived variables computed internally in LIDORT<br />
DO_MSMODE_LIDORT<br />
Internal flag controlling execution of main LIDORT discrete ordinate calculation. This will be set when<br />
DO_FULLRAD_MODE and DO_SSCORRECTION are both set. Basically it tells LIDORT to compute<br />
multiple scatter field only.<br />
NSTR2 = 2 * NSTREAMS<br />
NTOTAL = NSTR2 * NLAYERS<br />
N_SUBDIAG, N_SUPDIAG
LIDORT - User’s <strong>Guide</strong> to Version 2.3 14<br />
NSTR2 is the total number of upward and downward streams; NTOTAL is the actual dimension of boundary-value<br />
matrix problem. The other two integers are the umber of super- and sub- diagonals used in the<br />
band-matrix storage scheme required for the boundary value problem. (Both = 3*NSTREAMS - 1).<br />
X(MAXSTRM), A(MAXSTRM)<br />
Gaussian half-space quadrature abscissae and weights. AX(MAXSTRM) is the product of X and A.<br />
XANG(MAXSTRM) are the quadrature angles in degrees computed from the cosine abscissae X.<br />
NMOMENTS<br />
This variable is set internally. Normally NMOMENTS = 2*NSTREAMS - 1. The following settings are<br />
also used, depending on their respective input flags: NMOMENTS = 0 for isotropic case, NMOMENTS =<br />
2 for Rayleigh only.<br />
USER_STREAMS(MAX_USER_STREAMS)<br />
USER_SECANTS(MAX_USER_STREAMS)<br />
Cosines and inverse cosines of the angles in USER_ANGLES array.<br />
X0<br />
Cosine of solar zenith angle SUN0<br />
SUN_SZA_COSINES(MAXLAYER)<br />
Cosines of solar zenith angles in SUNLOCAL_INPUT (refractive geometry only).<br />
N_DIRECTIONS, WHICH_DIRECTIONS(MAX_DIRECTIONS)<br />
Number of directions (1 or 2) and directional array.<br />
N_OUT_STREAMS<br />
Total number of streams for output. This equals N_USER_STREAMS if there is no quadrature output,<br />
NSTREAMS if there is only quadrature output, and the sum of the two otherwise.<br />
OUT_ANGLES(MAX_OUT_STREAMS)<br />
All output angles (quadrature and/or user-defined) arranged in ascending order.<br />
QUADOUTPUT_INDEX(MAXSTRM)<br />
Integer mask indicating which of the output angles (if any) are quadrature values.<br />
USEROUTPUT_INDEX(MAX_USER_STREAMS)<br />
Integer mask indicating which of the output angles (if any) are user-defined values.<br />
N_CONVTESTS<br />
Number of convergence tests which must be satisfied before exiting the Fourier loop. Depends on the number<br />
of output streams, relative azimuth angles and optical depth output points.<br />
N_CONV_STREAMS<br />
Number of zenith streams used in the convergence. Elevation streams within ZENITH_TOLERANCE of<br />
the nadir position will be omitted from the convergence testing.<br />
LOCAL_UM_START
LIDORT - User’s <strong>Guide</strong> to Version 2.3 15<br />
Integer indicating start of loop over user-defined angles. This is normally 1, but if one or more of the output<br />
angles is zero (nadir) or tolerably close to zero (as defined by ZENITH_TOLERANCE), then there is no<br />
need to repeat calculations for azimuthally-dependent Fourier terms - in this case LOCAL_UM_START ><br />
1.<br />
N_OFFGRID_USERTAUS<br />
OFFGRID_UTAU_LAYERIDX(MAX_OFFGRID_USERTAUS)<br />
OFFGRID_UTAU_VALUES(MAX_OFFGRID_USERTAUS)<br />
OFFGRID_UTAU_OUTFLAG(MAX_OUT_USERTAUS)<br />
OFFGRID_UTAU_OUTINDEX(MAX_OUT_USERTAUS)<br />
UTAU_LEVEL_MASK_UP(MAX_OUT_USERTAUS)<br />
UTAU_LEVEL_MASK_DN(MAX_OUT_USERTAUS)<br />
Optical depth output values are sorted internally into those that coincide with one of the boundary values,<br />
and those that lie inside a given layer (the OFFGRID_UTAU values). These arrays are masks and indicators<br />
which control this division.<br />
N_LAYERSOURCE_UP, N_LAYERSOURCE_DN<br />
N_ALLLAYERS_UP, N_ALLLAYERS_DN<br />
STERM_LAYERMASK_UP(MAXLAYER)<br />
STERM_LAYERMASK_DN(MAXLAYER)<br />
In the ‘post-processing’ of the solution (integration of the source function), these integers indicate the number<br />
of whole layers (N_LAYERSOURCE_UP/DN) which must be so integrated. For example if we require<br />
only upwelling intensity at a point somewhere in the middle of the atmosphere, the source function integration<br />
will start at the bottom boundary and work upwards until the output level is reached - we do not need<br />
to do any further integration upwards of this point. The Boolean arrays STERM_LAYERMASK_UP/DN<br />
control the execution of layer source function integration.<br />
2.1.4 Input Structure LIDORT_GEOPHYS.VARS<br />
This file has all geophysical variables required for input to the LIDORT package. The first group contains<br />
all atmospheric variables required for an intensity calculation (without reference to linearization and<br />
weighting function output - see Section 2.2.4 for this). This group includes total phase function moment<br />
coefficients in each layer, total single scattering albedos in each layer, and layer optical depth coordinates<br />
(expansion coefficients for the layer thermal blackbody function were also specified in Version 1.1). The<br />
second group comprises all surface information (albedo, bidirectional reflection components, surface emission<br />
Planck function value, emissivity values). In Chapter 4 we discuss the creation of these geophysical<br />
inputs for a number of simple examples.<br />
The input has been simplified to exclude any reference to scatterers - the single scattering albedo is a total<br />
value and the phase function moments are weighted means of the individual scatterer moments. These total<br />
geophysical inputs are exactly the same as those required for DISORT, and this has facilitated validation<br />
comparisons with the models (“apples” and “apples”).<br />
Group 1. Main atmospheric input.<br />
OMEGA_TOTAL_INPUT(MAXLAYER)
LIDORT - User’s <strong>Guide</strong> to Version 2.3 16<br />
Single scattering albedo for each layer. Note that none of these values should be equal to one. The values<br />
are checked internally, and LIDORT will abort if any single scattering albedo is within<br />
OMEGA_SMALLNUM of unity (this small number is set in the file LIDORT.PARS).<br />
TAUGRID_INPUT(0:MAXLAYER)<br />
Vertical optical depth grid τ v (n). The first entry is zero (TOA = top of the atmosphere); the other values are<br />
the optical depths at the lower boundaries of the layers.<br />
HEIGHT_GRID(0:MAXLAYER)<br />
Heights in [km] at the layer boundaries, measured from TOA, thus HEIGHT_GRID(0) is TOA, and<br />
HEIGHT_GRID(NLAYERS) is the surface level. Only required when the Chapman function calculation of<br />
TAUTHICK_INPUT is done internally. Must be monotonically decreasing from TOA (this is checked).<br />
(New to Version 2.3).<br />
TAUTHICK_INPUT(MAXLAYER,MAXLAYER)<br />
This quantity τ(n,k) is the slant optical thickness in layer k for a solar beam atmospheric path ending at the<br />
lower boundary of layer n; thus<br />
n<br />
∑<br />
k = 1<br />
τ( nk , )<br />
=<br />
where τ slant (n) is the total slant optical depth for the sun’s ray through all layers up to and including n. For<br />
a plane-parallel atmosphere, τ slant (n) =τ v (n) /µ 0 , τ(n,k) =(τ v (k) −τ v (k−1)) / µ 0 . For the quasi-spherical<br />
option in a refracting curved atmosphere, it is necessary to use an external ray tracing module in the preparation<br />
interface. For a non-refractive atmosphere (straightforward shell geometry), τ(n,k) can also be calculated<br />
externally, but by turning on flag DO_CHAPMAN_FUNCTION and setting EARTH_RADIUS and<br />
the height grid HEIGHT_GRID, the calculation will be done internally within LIDORT (this latter option<br />
is new to Version 2.3).<br />
PHASMOMS_TOTAL_INPUT(0:MAXMOMENT,MAXLAYER)<br />
For each layer, we define the quantities β l which are the Legendre moments of the phase function expansion<br />
multiplied by (2l+1). The first coefficient (indexed by 0) should always be 1 (an internal check is done<br />
for this). For the isotropic case, there is only this value. Don’t forget to supply enough coefficients if you<br />
are using the Delta-M scaling option and if you want the single scatter correction using an accurate (nontruncated)<br />
form of the phase function. These are total phase function moments.<br />
Group 2. Surface input.<br />
τ slant<br />
( n)<br />
ALBEDO<br />
This should always be specified, for Lambertian and bidirectional cases. The bidirectional coefficients<br />
should always be albedo-normalized (see Section 4.1 and [1]).<br />
BIREFLEC(0:MAXMOMENT,MAXSTRM,MAXSTRM)<br />
Albedo-normalized bidirectional reflection Fourier expansion coefficients ρ m (−µ i ,µ j ) for scattering from<br />
incident quadrature direction −µ i to reflecting quadrature direction µ j . This is required for the reflection of<br />
the downward radiation.<br />
BIREFLEC_0(0:MAXMOMENT,MAXSTRM)
LIDORT - User’s <strong>Guide</strong> to Version 2.3 17<br />
Albedo-normalized bidirectional reflection Fourier expansion coefficients, for scattering from incident<br />
direction −µ 0 to reflecting quadrature direction µ j . This is required for the reflection of the direct beam at<br />
the surface.<br />
EMISSIVITY(MAXSTRM)<br />
Surface emission is assumed isotropic so is only present for the fundamental Fourier harmonic. The directional<br />
emissivity is given by Kirchhoff’s law, so this quantity is to be computed by integrating the reflection<br />
function (see [1]). For an assumed Lambertian albedo R, the emissivity is 1 − R for all directions. Only<br />
required if surface emission flag is set.<br />
SURFBB<br />
Black-body Planck function at the surface. Only required if surface emission flag is set.<br />
USER_BIREFLEC(0:MAXMOMENT,MAX_USER_STREAMS,MAXSTRM)<br />
These are the albedo-normalized bidirectional reflection Fourier expansion coefficients, for scattering from<br />
incident quadrature direction −µ i to reflecting off-quadrature direction µ α (one of the user-defined stream<br />
angles) This is required for the reflection of the field at the surface.<br />
USER_BIREFLEC_0(0:MAXMOMENT,MAX_USER_STREAMS)<br />
Albedo-normalized bidirectional reflection Fourier expansion coefficients, for scattering from incident<br />
direction −µ 0 to reflecting off-quadrature direction µ α . This is required for the reflection of the direct beam<br />
at the surface.<br />
USER_EMISSIVITY(MAX_USER_STREAMS)<br />
Directional emissivity for off-quadrature streams. Again follows from Kirchhoff’s law. Only required if<br />
surface emission flag is set.<br />
2.1.5 Output Structure LIDORT_RESULTS.VARS<br />
This file contains all output variables divided into four groups - (i) the complete set of Fourier-summed<br />
intensities and the single Fourier-term values of intensity; (ii) the mean-value output; (iii) layer-integrated<br />
multiple scatter source term output (Fourier component and summed values); and (iv) direct and diffuse<br />
source terms at the lower boundary (Fourier and summed). The latter two groups should only be used in<br />
conjunction with the flag SAVE_LAYER_MSST. The component terms are local to the Fourier loop inside<br />
LIDORT_MASTER - they are added to the summed solution values inside the module which performs the<br />
convergence test on the intensity. Fourier component results may be printed to file (optional), and will then<br />
be overwritten after the next Fourier component is calculated.<br />
Group 1. Intensity output<br />
INTENSITY(MAX_OUT_USERTAUS, MAX_OUT_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Backscatter intensity I(t,u,d,a) at any optical depth t, output stream angle u, direction d (upwelling and/or<br />
downwelling), and for azimuth angle a.<br />
INTENSITY_F(MAX_OUT_USERTAUS,MAX_OUT_STREAMS,MAX_DIRECTIONS)<br />
Fourier component of the backscatter intensity I m (t,u,d) at any optical depth t, output stream angle u, direction<br />
d (upwelling and/or downwelling).
LIDORT - User’s <strong>Guide</strong> to Version 2.3 18<br />
Group 2. Mean-value output.<br />
MEAN_INTENSITY(MAX_OUT_USERTAUS,MAX_DIRECTIONS)<br />
FLUX(MAX_OUT_USERTAUS,MAX_DIRECTIONS)<br />
Values of flux and mean intensity at any optical depth (upwelling and/or downwelling).<br />
Group 3. Layer-integrated multiple scatter source term output.<br />
MSCATSTERM(MAXLAYER,MAX_USER_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Layer-integrated multiple scatter source term L(n,u,d,a) for layer n, off-quadrature user angle u, direction d<br />
and relative azimuth angle a.<br />
MSCATSTERM_F(MAXLAYER,MAX_USER_STREAMS,MAX_DIRECTIONS)<br />
Fourier component L m (n,u,d) of layer-integrated multiple scatter source term for layer n, off-quadrature<br />
user angle u, and direction d.<br />
Group 4. Diffuse and direct-beam bottom-of-atmosphere source term output.<br />
MSCATBOA_SOURCETERM(MAX_USER_STREAMS, MAX_USER_RELAZMS)<br />
Bottom-of-the-atmosphere (BOA) multiple scatter source term B(u,a) for off-quadrature user angle u and<br />
relative azimuth angle a (upwelling direction only).<br />
MSCATBOA_SOURCETERM_F(MAX_USER_STREAMS)<br />
Fourier component B m (u) of BOA multiple scatter source term for off-quadrature user angle u.<br />
DIRECTBOA_SOURCETERM(MAX_USER_STREAMS, MAX_USER_RELAZMS)<br />
Bottom-of-the-atmosphere (BOA) direct-beam source term B*(u,a) for off-quadrature user angle u and relative<br />
azimuth angle a (upwelling direction only).<br />
DIRECTBOA_SOURCETERM_F(MAX_USER_STREAMS)<br />
Fourier component B* m (u) of BOA direct-beam source term for off-quadrature user angle u.<br />
2.1.6 Internal Standard Structures<br />
LIDORT_LEGENDRE.VARS<br />
Contains all Legendre polynomials required for the discrete ordinate solution (at quadrature angles), at<br />
arbitrary stream angles (post-processed solution), and for the direct beam zenith angles.<br />
LIDORT_MULTIPLIERS.VARS<br />
A number of storage arrays required for the post-processing of the RT solution at arbitrary stream angles<br />
and optical depths.<br />
LIDORT_SETUPS.VARS<br />
Storage for local geophysical variables (the single scattering albedos and other geophysical inputs will be<br />
changed if the Delta-M scaling option is set). All transmittance factors (optical depth exponential transmittances)<br />
with the exception of the eigenstream transmittances are pre-calculated before the RT equation is
LIDORT - User’s <strong>Guide</strong> to Version 2.3 19<br />
solved, and the results stored in this structure. Other set-up quantities required for the RT solution are also<br />
stored here; these are computed in the associated module LIDORT_MISCSETUPS, called only for the first<br />
(m=0) Fourier component.<br />
LIDORT_SOLUTION.VARS<br />
All variables associated with the discrete ordinate solution, including the homogeneous solution separation<br />
constants and eigenvectors, the particular integral solution vectors, and the matrices and column vectors<br />
required for the boundary value problem. Many of these quantities are required repeatedly in the weighting<br />
function computations which follow the solution for the original intensity field.<br />
LIDORT_SSCORRECTION.VARS<br />
Storage for variables computed in the single scatter post-processing for the intensity. Many of these quantities<br />
are required repeatedly in the single scatter weighting function computations which follow.<br />
2.2 Extended Structures<br />
The first 4 files in this list cover the I/O requirements for all extended (weighting function) applications,<br />
and they must be included in any interface and environment modules. The fixed structure<br />
LIDORT_L.PARS must be declared before the following 3 I/O structures. These 4 files are described in<br />
detail below; the remaining 3 internal structures are not part of the I/O description, and are given brief<br />
mention here.<br />
2.2.1 Fixed Structure LIDORT_L.PARS<br />
MAX_PARAMETERS<br />
This is the only additional symbolic dimension required for the extended version. It denotes the maximum<br />
number of atmospheric parameters for which weighting functions will be available.<br />
2.2.2 Input Structure LIDORT_L_CONTROL.VARS<br />
As before, all variables may be specified using explicitly-coded statements written by the user, or they may<br />
be assigned by reading entries in the Initialization file (this task is done using the LIDORT_V23E_INPUT<br />
master module). There are 4 Flags which must be set by the user - the final flag is set internally. Version 2.3<br />
addition: A list of weighting function names has been included for ease of identification.<br />
DO_SIMULATION_ONLY<br />
If set, then no weighting functions will be computed. The model will then compute the intensities alone<br />
using the standard code (which can of course be run in stand-alone mode in a Version 2.1S application).<br />
DO_LAYER_LINEARIZATION<br />
Indicates that atmospheric weighting functions should be output.<br />
DO_ALBEDO_LINEARIZATION<br />
Control for albedo weighting functions. Will not execute for a black surface (albedo = 0).<br />
DO_SURFBB_LINEARIZATION<br />
Control for weighting functions with respect to the surface Planck function. Will only execute if the corresponding<br />
flag is set in the core input control.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 20<br />
DO_LINEARIZATION<br />
Set internally when one or more of the above 3 linearization flags has been set.<br />
TOTAL_LAYERWF<br />
Total number of desired weighting functions. Not every weighting function will be output for every layer<br />
(though this is usually the case) and this number represents a maximum number. Must be less than dimensioning<br />
parameter MAX_PARAMETERS.<br />
LAYERWF_NAMES(MAX_PARAMETERS)<br />
A character-string array (31 characters presently specified) for descriptions of the weighting functions.<br />
This is for labelling purposes only.<br />
2.2.3 Input Structure LIDORT_L_GEOPHYS.VARS<br />
This file contains all additional variables that specify the layer weighting function output. They are only<br />
required if the general flag DO_LAYER_LINEARIZATION has been set. They include inputs<br />
LAYER_VARY_FLAG and LAYER_VARY_NUMBER which determine the extent of weighting function<br />
calculations for atmospheric parameters.<br />
LAYER_VARY_FLAG(MAXLAYER)<br />
If DO_LAYER_LINEARIZATION has been set, then this flag indicates which layers will be varied in the<br />
linearization, i.e. weighting functions will be output only for those layers which have been thus flagged.<br />
LAYER_VARY_NUMBER(MAXLAYER)<br />
Controls the number of weighting functions to be computed for a given layer (number of parameters varied<br />
in given layer). Each entry must be less than the dimensioning parameter MAX_PARAMETERS.<br />
OMEGA_VARS_TOTAL_INPUT(MAX_PARAMETERS,MAXLAYER)<br />
OMEGA_VARS_TOTAL_INPUT(q,n) is the relative variation in the total single scattering albedo in layer<br />
n, with respect to varying parameter q in that layer. (Version 2.3: no reference to scatterer).<br />
EXT_VARS_INPUT(MAX_PARAMETERS, MAXLAYER).<br />
Relative variation in extinction coefficient for layer n with respect to varying parameter q in that layer.<br />
PHASMOM_VARS_TOTAL_INPUT(MAX_PARAMETERS, MAXLAYER).<br />
Relative variation in phase function moment coefficients. For Legendre moment l and for layer n with<br />
respect to varying parameter q in that layer. (New feature in Version 2.3).<br />
2.2.4 Output Structure LIDORT_L_RESULTS.VARS<br />
As with the standard results structure (Section 2.1.5), the variables are classified in four groups. Again,<br />
groups (iii) and (iv) are only required for the specialist option flagged by SAVE_LAYER_MSST.<br />
Group 1. General and Fourier-component Weighting function output.<br />
ATMOSWF (MAX_PARAMETERS, MAXLAYER, MAX_OUT_USERTAUS,<br />
MAX_OUT_STREAMS, MAX_DIRECTIONS, MAX_USER_RELAZMS)
LIDORT - User’s <strong>Guide</strong> to Version 2.3 21<br />
Weighting functions K(q,n,t,u,d,a) with respect to atmospheric variable q in layer n, at optical depth t, output<br />
stream angle u, upwelling and/or downwelling direction d, and for relative azimuth angle a.<br />
ALBEDOWF (MAX_OUT_USERTAUS, MAX_OUT_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Weighting functions K R (t,u,d,a) with respect to surface albedo, at optical depth t, output stream angle u,<br />
upwelling and/or downwelling direction d, and for relative azimuth angle a.<br />
SURFBBWF (MAX_OUT_USERTAUS, MAX_OUT_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Weighting functions K S (t,u,d,a) with respect to surface black-body emission, at optical depth t, output<br />
stream angle u, upwelling and/or downwelling direction d, and for relative azimuth angle a.<br />
ATMOSWF_F (MAX_PARAMETERS, MAXLAYER, MAX_OUT_USERTAUS,<br />
MAX_OUT_STREAMS, MAX_DIRECTIONS)<br />
Fourier component weighting functions K m (q,n,t,u,d) with respect to atmospheric variable q in layer n, at<br />
optical depth t, output stream angle u, upwelling and/or downwelling direction d.<br />
ALBEDOWF_F (MAX_OUT_USERTAUS, MAX_OUT_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Fourier component weighting functions K Rm (t,u,d) with respect to surface albedo, at optical depth t, output<br />
stream angle u, upwelling and/or downwelling direction d, and for relative azimuth angle a.<br />
Group 2. Mean-value Weighting function output.<br />
MINT_ATMOSWF (MAX_PARAMETERS, MAXLAYER,<br />
MAX_OUT_USERTAUS, MAX_DIRECTIONS)<br />
Weighting functions of Mean intensity K I (q,n,t,d) with respect to atmospheric variable q in layer n, at optical<br />
depth t, and upwelling and/or downwelling direction d.<br />
MINT_ALBEDOWF (MAX_OUT_USERTAUS, MAX_DIRECTIONS)<br />
Weighting functions of Mean intensity K IR (t,d) with respect to surface albedo, at optical depth t, direction<br />
d.<br />
MINT_SURFBBWF (MAX_OUT_USERTAUS, MAX_DIRECTIONS)<br />
Weighting functions of Mean intensity K IS (t,d) with respect to surface black-body emission, at optical<br />
depth t, direction d.<br />
FLUX_ATMOSWF (MAX_PARAMETERS, MAXLAYER,<br />
MAX_OUT_USERTAUS, MAX_DIRECTIONS)<br />
Weighting functions of Flux K F (q,n,t,d) with respect to atmospheric variable q in layer n, at optical depth t,<br />
and upwelling and/or downwelling direction d.<br />
FLUX_ALBEDOWF (MAX_OUT_USERTAUS, MAX_DIRECTIONS)<br />
Weighting functions of Flux K FR (t,d) with respect to surface albedo, at optical depth t, direction d.<br />
FLUX_SURFBBWF (MAX_OUT_USERTAUS, MAX_DIRECTIONS)
LIDORT - User’s <strong>Guide</strong> to Version 2.3 22<br />
Weighting functions of Flux K FS (t,d) with respect to surface black-body emission, at optical depth t, direction<br />
d.<br />
Group 3. Multiple scatter layer source term weighting function output.<br />
ATMOSWF_MSCATSTERM (MAX_PARAMETERS, MAXLAYER, MAXLAYER,<br />
MAX_OUT_STREAMS, MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Layer-integrated multiple scatter source term weighting functions L(q,n,k,u,d,a) for layer k, off-quadrature<br />
stream angle u, upwelling and/or downwelling direction d and relative azimuth angle a, with respect to<br />
atmospheric variable q which is varying in layer n.<br />
ALBEDOWF_MSCATSTERM (MAXLAYER, MAX_USER_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Layer-integrated multiple scatter source term weighting functions L R (k,u,d,a) with respect to surface<br />
albedo for layer k, off-quadrature stream angle u, upwelling and/or downwelling direction d and relative<br />
azimuth angle a.<br />
SURFBBWF_MSCATSTERM (MAXLAYER, MAX_USER_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Layer-integrated multiple scatter source term weighting functions L S (k,u,d,a) with respect to surface blackbody<br />
emission for layer k, off-quadrature stream angle u, upwelling and/or downwelling direction d and<br />
relative azimuth angle a.<br />
ATMOSWF_MSCATSTERM_F (MAX_PARAMETERS, MAXLAYER, MAXLAYER,<br />
MAX_USER_STREAMS, MAX_DIRECTIONS)<br />
Layer-integrated multiple scatter source term Fourier component weighting functions L m (q,n,k,u,d) for<br />
layer k, off-quadrature stream angle u and direction d, with respect to atmospheric variable q which is varying<br />
in layer n.<br />
ALBEDOWF_MSCATSTERMF_F (MAXLAYER, MAX_USER_STREAMS,<br />
MAX_DIRECTIONS, MAX_USER_RELAZMS)<br />
Layer-integrated multiple scatter source term Fourier component weighting functions L Rm (k,u,d) with<br />
respect to surface albedo for layer k, off-quadrature stream angle u and upwelling and/or downwelling<br />
direction d.<br />
Group 4. Bottom-of-atmosphere source term weighting function output.<br />
ATMOSWF_MSCATBOA_STERM (MAX_PARAMETERS, MAXLAYER,<br />
MAX_OUT_STREAMS, MAX_USER_RELAZMS)<br />
BOA multiple scatter source term weighting functions B(q,n,u,a) for off-quadrature stream angle u and relative<br />
azimuth angle a, with respect to atmospheric variable q varying in layer n.<br />
ATMOSWF_DIRECTBOA_STERM (MAX_PARAMETERS, MAXLAYER,<br />
MAX_OUT_STREAMS, MAX_USER_RELAZMS)<br />
BOA direct-beam source term weighting functions B(q,n,u,a) for off-quadrature stream angle u and relative<br />
azimuth angle a, with respect to atmospheric variable q varying in layer n.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 23<br />
ALBEDOWF_MSCATBOA_STERM (MAX_USER_STREAMS, MAX_USER_RELAZMS)<br />
BOA multiple scatter source term weighting functions B R (u,a) with respect to surface albedo for offquadrature<br />
stream angle u and relative azimuth angle a.<br />
SURFBBWF_BOA_STERM (MAX_USER_STREAMS, MAX_USER_RELAZMS)<br />
BOA source term weighting functions B S (u,a) with respect to surface black-body emission for off-quadrature<br />
stream angle u and relative azimuth angle a.<br />
ATMOSWF_MSCATBOA_STERM_F<br />
(MAX_PARAMETERS, MAXLAYER,MAX_USER_STREAMS)<br />
BOA multiple scatter source term Fourier component weighting functions B m (q,n,u) for off-quadrature<br />
stream angle u, with respect to atmospheric variable q which is varying in layer n.<br />
ATMOSWF_DIRECTBOA_STERM_F<br />
(MAX_PARAMETERS, MAXLAYER,MAX_USER_STREAMS)<br />
BOA direct-beam source term Fourier component weighting functions B m (q,n,u) for off-quadrature stream<br />
angle u, with respect to atmospheric variable q which is varying in layer n.<br />
ALBEDOWF_MSCATBOA_STERM_F (MAX_USER_STREAMS)<br />
BOA multiple scatter source term Fourier component weighting functions B Rm (u) with respect to surface<br />
albedo for off-quadrature stream angle u.<br />
2.2.5 Internal Extended Structures<br />
LIDORT_L_MULTIPLIERS.VARS<br />
A number of storage arrays required for the post-processing of the linearized RT solution at arbitrary<br />
stream angles and optical depths.<br />
LIDORT_L_SETUPS.VARS<br />
Storage for local geophysical variables required for the linearization (weighting function) analysis (the single<br />
scattering albedo, optical depth and phase function moments variational inputs will be changed if the<br />
Delta-M scaling option is set). All linearizations of the transmittance factors computed in the original setup<br />
operation and stored in LIDORT_SETUPS.VARS are held in this structure, along with any other help<br />
arrays that can be pre-computed before the weighting function computation starts.<br />
LIDORT_L_SOLUTION.VARS<br />
All variables associated with the linearization of the discrete ordinate solution, including linearized values<br />
of the homogeneous solution separation constants and eigenvectors, particular integral solution vectors and<br />
multipliers, and column vectors required for the linearized boundary value problem.<br />
2.3 Initialization File Example<br />
In this section, we present a typical initialization file. [We use the “Courier” Font to denote text copied<br />
from software code]. The file is read in LIDORT_V23E_INPUT, using the FINDPAR module - this looks<br />
for a character string comprising a prefix (in this case the word “LIDORT”) and a text indication of the<br />
variable to be assigned (for example Include direct beam?) and then reads the variables specified<br />
underneath the character string. All strings ending with a question mark indicate the assignment of Bool-
LIDORT - User’s <strong>Guide</strong> to Version 2.3 24<br />
ean variables. The file-read is divided into three parts - one task for the assignment of variables in<br />
LIDORT_CONTROL.VARS, the second task for variables in LIDORT_MODEL.VARS, and the third task<br />
assigns variables in LIDORT_L_CONTROL.VARS. The first two parts are mandatory for both versions<br />
V2.3S and V2.3E, the third part is only required for V2.3E.<br />
**** PART 1. Variables in LIDORT_CONTROL.VARS ****<br />
LIDORT - Do full radiance calculation?<br />
.TRUE.<br />
LIDORT - Do single scatter correction?<br />
.TRUE.<br />
LIDORT - Output multiple scatter layer source functions?<br />
.FALSE.<br />
LIDORT - Perform double convergence test?<br />
.TRUE.<br />
LIDORT - Rayleigh atmosphere only?<br />
.FALSE.<br />
LIDORT - Isotropic atmosphere only?<br />
.FALSE.<br />
LIDORT - Include direct beam?<br />
.TRUE.<br />
LIDORT - Use classical beam solution?<br />
.FALSE.<br />
LIDORT - Quasi-spherical treatment of direct beam?<br />
.TRUE.<br />
LIDORT - Perform internal Chapman function calculation?<br />
.TRUE.<br />
LIDORT - Beam path with refractive atmosphere?<br />
.FALSE.<br />
LIDORT - Lambertian albedo?<br />
.TRUE.<br />
LIDORT - Include surface emission?<br />
.FALSE.<br />
LIDORT - No azimuth dependence in the solution?<br />
.TRUE.<br />
LIDORT - Use full -1 to +1 quadrature?<br />
.FALSE.<br />
LIDORT - Compute all Fourier components?<br />
.FALSE.<br />
LIDORT - Include Delta-M scaling?<br />
.TRUE.<br />
LIDORT - Generate mean-value output additionally?<br />
.TRUE.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 25<br />
LIDORT - Generate only mean-value output?<br />
.FALSE.<br />
LIDORT - Upwelling output?<br />
.TRUE.<br />
LIDORT - Downwelling output?<br />
.TRUE.<br />
LIDORT - Debug write?<br />
.FALSE.<br />
LIDORT - Input control write?<br />
.TRUE.<br />
LIDORT - Input scenario write?<br />
.TRUE.<br />
LIDORT - Results write?<br />
.TRUE.<br />
LIDORT - Results write IDL output?<br />
.FALSE.<br />
LIDORT - Fourier component output write?<br />
.FALSE.<br />
LIDORT - Include quadrature angles in output?<br />
.TRUE.<br />
LIDORT - User-defined stream angles?<br />
.TRUE.<br />
LIDORT - User-defined optical depths?<br />
.FALSE.<br />
LIDORT - Layer boundary optical depths?<br />
.TRUE.<br />
LIDORT - filename for main output<br />
lidort_myproblem.result<br />
LIDORT - filename for main IDL output<br />
lidort_myproblem_IDL.result<br />
LIDORT - filename for input write<br />
lidort_myproblem.input<br />
LIDORT - filename for scenario write<br />
lidort_myproblem.scenario<br />
LIDORT - Fourier output filename<br />
lidort_myproblem.fourier<br />
**** Part 2. Variables in LIDORT_MODEL.VARS ****<br />
LIDORT - Number of half-space streams<br />
10<br />
LIDORT - Number of atmospheric layers<br />
43<br />
LIDORT - Number of Legendre moments
LIDORT - User’s <strong>Guide</strong> to Version 2.3 26<br />
19<br />
LIDORT - Solar flux constant<br />
1.0<br />
LIDORT - Fourier series convergence<br />
0.001<br />
LIDORT - Zenith tolerance level<br />
0.0001<br />
LIDORT - Solar zenith angle (degrees)<br />
65.0<br />
LIDORT - Earth radius (km)<br />
6371.0<br />
LIDORT - Number of user-defined relative azimuth angles<br />
2<br />
LIDORT - User-defined relative azimuth angles<br />
60.0<br />
50.0<br />
LIDORT - Number of user-defined stream angles<br />
3<br />
LIDORT - User-defined stream angles<br />
0.0<br />
15.0<br />
30.0<br />
LIDORT - Number of user-defined optical depths<br />
1<br />
LIDORT - User-defined optical depths<br />
0.2065<br />
LIDORT - Number of layer boundary optical depths<br />
3<br />
LIDORT - Which layer boundaries for optical depth<br />
0<br />
1<br />
2<br />
**** Part 3. Variables in LIDORT_L_CONTROL.VARS ****<br />
LIDORT - Simulation only?<br />
.FALSE.<br />
LIDORT - Variation for atmospheric layers?<br />
.TRUE.<br />
LIDORT - Variation for surface albedo?<br />
.FALSE.<br />
LIDORT - Variation for surface emission?
LIDORT - User’s <strong>Guide</strong> to Version 2.3 27<br />
.FALSE.<br />
LIDORT - Total number of Layer weighting functions<br />
1<br />
LIDORT - Layer weighting function names<br />
ozone volume mixing ratio------
LIDORT - User’s <strong>Guide</strong> to Version 2.3 28<br />
3. LIDORT Package; Environment and Master Modules<br />
3.1 Package Organization<br />
The LIDORT package is organized in six directories:<br />
src_v23e_master<br />
src_v23s_master<br />
src_standard<br />
src_extension<br />
include_s<br />
include_e<br />
All structures as described in the previous chapter are to be found in the two “include” directories. The<br />
source code is divided into 4 directories which we list here with remarks.<br />
Directory src_v23e_master<br />
This contains 3 high-level master modules which control the execution of the extended model. These are:<br />
LIDORT_V23E_INPUT. This carries out the initialization file-read as described in the previous Section. It<br />
is called directly from a user-defined environment; an example is given in the next Section.<br />
LIDORT_V23E_MASTER. This is the main module, again called directly from a user-defined environment.<br />
The next Section gives an example of its use.<br />
LIDORT_V23E_FOURIER. This is the master module for calculation of a single Fourier component of the<br />
intensity and weighting function output. It is called directly in LIDORT_V23E_MASTER as part of the<br />
Fourier loop, but the call will not be present in the user-defined environment. In Section 3.3 we illustrate<br />
the use of this module inside LIDORT_V23E_MASTER.<br />
Directory src_v23s_master<br />
Contains 3 high-level master modules which control the execution of the standard model. These are<br />
LIDORT_V23S_INPUT, LIDORT_V23S_MASTER and LIDORT_V23S_FOURIER. The role of these<br />
modules is exactly analogous to their equivalents in the extended master directory, and the above remarks<br />
apply equally. Usage of these modules will be noted in the examples that follow.<br />
Directory src_standard<br />
Contains all core code for the standard version; there are 12 modules in all. We list them with a brief note<br />
on function. The first 9 are called in the order in which they appear in the main and/or the Fourier master<br />
modules; the remaining 3 are auxiliary modules.<br />
LIDORT_CHECKINPUT.f<br />
Checks all control, model and geophysical inputs for consistency.<br />
LIDORT_DERIVEINPUT.f
LIDORT - User’s <strong>Guide</strong> to Version 2.3 29<br />
This is an internal assignation of model variables that are not declared explicitly as part of the file-read or<br />
in an external environment. Includes tasks like sorting the stream angles input, sorting and assigning masks<br />
for the arbitrary optical depth output.<br />
LIDORT_MISCSETUPS.f<br />
Only called for Fourier component m = 0. A number of set-up operations including the Delta-M scaling<br />
and the preparation of all optical depth exponentials that can be pre-calculated.<br />
LIDORT_RTSOLUTION.f<br />
Solution of the discrete ordinate radiative transfer equation. Returns the eigensolutions and separation constants<br />
from the homogeneous equation, plus the particular (beam) solution vectors for both the classical<br />
solution technique and the Green function method.<br />
LIDORT_BVPROBLEM.f<br />
Set-up and solution of the boundary-value problem (constants of integration) in a multi-layer atmosphere.<br />
This requires the L-U decomposition (matrix inversion).<br />
LIDORT_INTENSITY.f<br />
Computation of intensities at user-defined optical depths and stream angles; this is the post-processing<br />
(source function integration).<br />
LIDORT_MULTIPLIERS.f<br />
Computation of multipliers required for the layer source terms that form the heart of the source function<br />
integration technique.<br />
LIDORT_CONVERGE.f<br />
Examines convergence of Fourier series for all intensities; upgrades the intensity Fourier series.<br />
LIDORT_SSCORRECTION.f<br />
If flagged by DO_SSCORRECTION, this module calculates the post-processed single scatter intensity and<br />
will return the corrected total intensity direct to the output.<br />
LIDORT_WRITEMODULES.f<br />
Four modules for writing outputs to file. Will produce full intensity results, Fourier components of intensity,<br />
a scenario description and a summary of the input data (corresponding to the write control flags set in<br />
LIDORT_CONTROL.VARS).<br />
LIDORT_AUX.f<br />
Standard numerical routines for eigenproblem solution (ASYMTX as used in DISORT is preferred, though<br />
LAPACK software is available), and linear algebra modules (LAPACK band storage and L-U decomposition<br />
modules). Legendre polynomial and Gauss quadrature evaluation. Includes the input file-read tool<br />
FINDPAR. Includes also error tracing modules.<br />
LIDORT_READINPUT.f<br />
Sequential read of all standard control and model variables in the initialization file.<br />
Directory src_extension
LIDORT - User’s <strong>Guide</strong> to Version 2.3 30<br />
Contains all internal modules that are additionally required for the extended version; there are 10 modules<br />
in all, and they are all concerned with aspects of weighting function generation. The first 8 are called in the<br />
order in which they appear in the main and/or the Fourier master modules; the remaining 2 are auxiliary<br />
modules. The naming is chosen so that the tasks executed by these additional modules are equivalent to the<br />
original tasks for the original (intensity-only) modules.<br />
LIDORT_L_CHECKINPUT.f<br />
Checks additional control and geophysical inputs for consistency.<br />
LIDORT_L_MISCSETUPS.f<br />
Only called for Fourier component m = 0. A number of additional set-up operations including the Delta-M<br />
scaling for variational inputs and the preparation of all optical depth exponentials that can be pre-calculated.<br />
LIDORT_L_RTSOLUTION.f<br />
Linearization analysis of the discrete ordinate radiative transfer equation. Returns the derivatives of the<br />
eigensolutions and separation constants, plus the particular (beam) solution vectors with respect to atmospheric<br />
parameter variations.<br />
LIDORT_L_BVSETUPS.f<br />
Column vector set-up for the linearized boundary-value problem. The actual matrix back-substitution<br />
which returns the linearized integration constants is done in LIDORT_V23E_FOURIER.<br />
LIDORT_L_WFCALC.f<br />
Computation of weighting functions at user-defined optical depths and stream angles. This is the post-processing<br />
(source function integration) technique; the routine is modeled along the same lines as<br />
LIDORT_INTENSITY.<br />
LIDORT_L_MULTIPLIERS.f<br />
Computation of derivatives of the multipliers required for the layer source terms that form the heart of the<br />
source function integration technique.<br />
LIDORT_L_FOURIERADD.f<br />
Upgrades the weighting function Fourier series.<br />
LIDORT_L_SSCORRECTION.f<br />
Post-processing single scatter correction for the weighting functions. This generates the single scatter<br />
quantities and returns the corrected weighting functions directly to output. Note that single scatter corrections<br />
only involve atmospheric scatter - this means that albedo weighting functions do not need to be corrected.<br />
LIDORT_L_WRITEMODULES.f<br />
Modules for writing additional (weighting function) outputs to file. Will produce full weighting function<br />
results, Fourier components, additional scenario descriptions and a summary of supplementary input data.<br />
LIDORT_L_INPUTREAD.f<br />
Read of all extended control variables in the initialization file.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 31<br />
3.2 Use of LIDORT Master Module in an External Environment<br />
This is demonstrated in this schematic computational sequence (pseudo-code), which should be referred to<br />
in the discussion that follows. Comment lines are prefaced by the letters “/*”. The example deals with a<br />
simple wavelength loop calculation. LIDORT names and variables are given in upper case letters.<br />
main user_lidort<br />
/* Core fixed structure<br />
include ‘LIDORT.PARS’<br />
/* Core input structures<br />
include ‘LIDORT_CONTROL.VARS’<br />
include ‘LIDORT_MODEL.VARS’<br />
include ‘LIDORT_GEOPHYS.VARS’<br />
/* Core output structure<br />
include ‘LIDORT_RESULTS.VARS’<br />
/* Supplementary fixed structure<br />
include ‘LIDORT_L.PARS’<br />
/* Supplementary input structures<br />
include ‘LIDORT_L_CONTROL.VARS’<br />
include ‘LIDORT_L_GEOPHYS.VARS’<br />
/* Supplementary output structure<br />
include ‘LIDORT_L_RESULTS.VARS’<br />
/* status declarations<br />
INTEGER STATUS_INPUTREAD<br />
INTEGER STATUS_INPUTCHECK<br />
INTEGER STATUS_CALCULATION<br />
/* Define output in the way you want!<br />
Declare output arrays<br />
/* File-read variables in the input structures<br />
call LIDORT_V23E_INPUT<br />
(‘LIDORT.INP’,’LIDORT.ERR’,STATUS_INPUTREAD)<br />
if (STATUS_INPUTREAD = LIDORT_SERIOUS) write message & abort<br />
/* Start wavelength loop<br />
for i = 1, n_user_wavelengths, begin<br />
/* Assign variables in LIDORT_GEOPHYS.VARS and LIDORT_L_GEOPHYS.VARS<br />
call USER_LIDORT_PREPARE<br />
/* LIDORT master call and error check<br />
call LIDORT_V23E_MASTER<br />
(STATUS_INPUTCHECK,STATUS_CALCULATION)<br />
if (STATUS_INPUTCHECK=LIDORT_SERIOUS) error message & abort<br />
if (STATUS_CALCULATION=LIDORT_SERIOUS) error message & abort<br />
copy LIDORT output to user-defined output arrays
LIDORT - User’s <strong>Guide</strong> to Version 2.3 32<br />
/* End wavelength loop<br />
end for<br />
/* finish<br />
write user-defined output arrays<br />
stop and end of program<br />
LIDORT execution is controlled by a single module LIDORT_V23E_MASTER for the extended version,<br />
and LIDORT_V23S_MASTER for version 2.3S (intensity-only). Both these modules must be called from<br />
a user-defined environment, once for each wavelength (LIDORT is monochromatic). Note that within the<br />
wavelength loop, the call to one of these master module is preceded by the user-defined preparation module<br />
which will assign values to input variables in LIDORT_GEOPHYS.VARS (both versions) and<br />
LIDORT_L_GEOPHYS.VARS (extended version only).<br />
The main call is preceded by a call to either the LIDORT_V23S_INPUT master module (intensity-only) or<br />
LIDORT_V23E_INPUT (extended version). These modules will read the appropriate input from the Initialization<br />
file LIDORT.INP (passed as a subroutine argument). File-read errors will be written to an error<br />
file name LIDORT.ERR (also passed as a subroutine argument). If the STATUS_INPUTREAD integer<br />
output is not equal to LIDORT_SUCCESS, the program should stop and the user should examine the error<br />
file. A similar output (STATUS_INPUTCHECK) is available for the checking of the input data once the<br />
file-read is complete (checking is internal to LIDORT). This step is optional; it is possible to write down<br />
the control inputs instead of using file-read methods, but this requires a certain level of confidence!<br />
After each call to the master module, the STATUS_CALCULATION integer output is examined, and the<br />
program stopped if there is a failure. Any errors arising in the master modules will be traced and written to<br />
the error file passed as an argument to the module.<br />
In most cases, it is sufficient to call LIDORT_V23E_INPUT just once before a wavelength loop, though<br />
some of the input options may be changed before each call to LIDORT_V23E_MASTER. Note that the<br />
file-read modules in LIDORT_V23E_INPUT are optional - it is possible for the user to dispense with this<br />
kind of input set-up and assignment and simply assign input variables explicitly. The output for some<br />
wavelengths may be suppressed (note that the output write files in LIDORT have “unknown” status - they<br />
are always overwritten). It is also necessary in most cases for the user to create anew the variables in<br />
LIDORT_GEOPHYS.VARS and LIDORT_L_GEOPHYS.VARS for each wavelength.<br />
The geophysical input declared in LIDORT_GEOPHYS.VARS is application-dependent, and must be set<br />
up by the user (the module USER_LIDORT_PREPARE in the above example). Note that most of the input<br />
variables in LIDORT_CONTROL.VARS and LIDORT_MODEL.VARS (and for the supplementary file<br />
LIDORT_L_CONTROL.VARS) are checked for consistency inside the LIDORT master module. In fact<br />
this is the first task - if problems arise with the inputs, then LIDORT will abort before any calculations are<br />
done. The geophysical inputs are also checked at this stage for consistency.<br />
3.3 Computational Sequence in LIDORT_V23E_MASTER<br />
This is the computational sequence inside LIDORT_V23E_MASTER, written in pseudo-code (conventions<br />
as above). Note that the three separate calls to output modules (“SCENARIO”, “FOURIER” and
LIDORT - User’s <strong>Guide</strong> to Version 2.3 33<br />
“RESULTS”) are governed by separate flags and output filenames. Note also that the list of “include”<br />
structures is the same as that required for the user-defined environment defined in the previous Section.<br />
subroutine LIDORT_V23E_MASTER<br />
(STATUS_INPUTCHECK,STATUS_CALCULATION)<br />
/* Core fixed structure<br />
include ‘LIDORT.PARS’<br />
/* Core input structures<br />
include ‘LIDORT_CONTROL.VARS’<br />
include ‘LIDORT_MODEL.VARS’<br />
include ‘LIDORT_GEOPHYS.VARS’<br />
/* Core output structure<br />
include ‘LIDORT_RESULTS.VARS’<br />
/* Supplementary fixed structure<br />
include ‘LIDORT_L.PARS’<br />
/* Supplementary input structures<br />
include ‘LIDORT_L_CONTROL.VARS’<br />
include ‘LIDORT_L_GEOPHYS.VARS’<br />
/* Supplementary output structure<br />
include ‘LIDORT_L_RESULTS.VARS’<br />
/* subroutine output arguments<br />
INTEGER STATUS_INPUTCHECK<br />
INTEGER STATUS_CALCULATION<br />
/* declare local variables (AZMFAC are Azimuth Fourier cosine factors)<br />
double precision AZMFAC(MAX_USER_RELAZMS);<br />
integer FOURIER, N_FOURIER; boolean LOCAL_ITERATION;<br />
integer LOCAL_STATUS_1, LOCAL_STATUS_2<br />
/* initialize output<br />
STATUS_INPUTCHECK = LIDORT_SUCCESS<br />
STATUS_CALCULATION = LIDORT_SUCCESS<br />
/* Check inputs<br />
call LIDORT_CHECKINPUT (LOCAL_STATUS_1)<br />
if (DO_LINEARIZATION) call LIDORT_CHECKINPUT (LOCAL_STATUS_2)<br />
if (LOCAL_STATUS_1 or LOCAL_STATUS_2 = LIDORT_SERIOUS) then<br />
STATUS_INPUT_CHECK = LIDORT_SERIOUS<br />
write message & abort<br />
end if<br />
/* If you want LIDORT to calculate TAUTHICK_INPUT, here is the call!<br />
if (DO_CHAPMAN_FUNCTION) call CHAPMAN_FUNCTION<br />
/* write input variables<br />
if (DO_WRITE_INPUT) then<br />
open input_write file
LIDORT - User’s <strong>Guide</strong> to Version 2.3 34<br />
call LIDORT_WRITEINPUT<br />
if (DO_LINEARIZATION) call LIDORT_L_WRITEINPUT<br />
close input_write file<br />
end if<br />
/* Get quadrature<br />
call to Gaussian quadrature module - get X, A, AX and XANG<br />
/* Get derived input<br />
/* (assign non-file-read model variables in LIDORT_MODEL.VARS)<br />
call LIDORT_DERIVE_INPUT<br />
/* Initialize Fourier loop<br />
Set number of Fourier components required (N_FOURIER)<br />
FOURIER = -1<br />
LOCAL_ITERATION = .true.<br />
/* Fourier loop (iterative)<br />
do while (LOCAL_ITERATION.AND.FOURIER.LT.N_FOURIER)<br />
FOURIER = FOURIER + 1<br />
Set up azimuth cosine factors AZMFAC in Fourier series<br />
call LIDORT_V23E_FOURIER (FOURIER,LOCAL_STATUS_1)<br />
if (LOCAL_STATUS_1 = LIDORT_SERIOUS) then<br />
STATUS_CALCULATION = LIDORT_SERIOUS<br />
write message & abort<br />
end if<br />
call LIDORT_CONVERGE (AZMFAC, FOURIER, LOCAL_ITERATION)<br />
if ( DO_LINEARIZATION ) then<br />
call LIDORT_L_FOURIERADD ( AZMFAC, FOURIER )<br />
end if<br />
if (DO_WRITE_FOURIER) then<br />
if (FOURIER = 0) open Fourier_write file<br />
call LIDORT_FOURIER_OUTPUT<br />
if (DO_LINEARIZATION) call LIDORT_L_WRITEINPUT<br />
if (.not.LOCAL_ITERATION) close Fourier_write file<br />
end if<br />
end do<br />
/* Single scatter corrections<br />
if (DO_SSCORRECTION) then<br />
call LIDORT_SSCORRECTION<br />
if (DO_LINEARIZATION) call LIDORT_L_SSCORRECTION<br />
end if<br />
/* write major result variables<br />
if (DO_WRITE_RESULTS) then<br />
open Results_write file<br />
call LIDORT_WRITERESULTS
LIDORT - User’s <strong>Guide</strong> to Version 2.3 35<br />
if (DO_LINEARIZATION) call LIDORT_L_WRITERESULTS<br />
close Results_write file<br />
end if<br />
/* write scenario variables<br />
if (DO_WRITE_SCENARIO) then<br />
open Scenario_write file<br />
call LIDORT_WRITESCEN<br />
if (DO_LINEARIZATION) call LIDORT_L_WRITESCEN<br />
close Scenario_write file<br />
end if<br />
/* finish<br />
end<br />
Remarks<br />
The main loop is over the Fourier components; LIDORT_V23E_FOURIER computes all intensities and<br />
weighting functions for each component. The number N_FOURIER depends on the application, but cannot<br />
be greater than a pre-defined maximum number MAX_FOURIER defined in LIDORT.PARS. For the isotropic<br />
case, N_FOURIER = 0; for Rayleigh only, N_FOURIER = 2. Normally the Fourier loop will continue<br />
until the convergence test (LIDORT_CONVERGE) has indicated that the addition of a Fourier term<br />
to the intensity has not improved the accuracy beyond that set by the input convergence criterion.<br />
LIDORT_CONVERGE will set the iteration flag LOCAL_ITERATION. (The additional module<br />
LIDORT_L_FOURIERADD merely updates the Fourier series for the weighting functions).<br />
Note the use of the DO_LINEARIZATION flag (see Section 2.2.1 for the definition). If we remove all the<br />
clauses with this flag and replace LIDORT_V23E_FOURIER with the standard (intensity-only) Fourier<br />
master module LIDORT_V23S_FOURIER, then we have simply LIDORT_V23S_MASTER, the overall<br />
master module for the standard version. It’s that simple!
LIDORT - User’s <strong>Guide</strong> to Version 2.3 36<br />
4. Geophysical input preparation<br />
We will first go through the variables in the core structure LIDORT_GEOPHYS.VARS as they appear in<br />
Section 2.2.4, showing how they may be assigned for some representative scenarios. Each layer in the<br />
atmosphere is assumed homogeneous. More details can be found in [1] and [7]. We then go through the<br />
variational input required for the supplementary structure LIDORT_L_GEOPHYS.VARS.<br />
4.1 Preparation for LIDORT_GEOPHYS.VARS Core Structure<br />
LIDORT_GEOPHYS.VARS. Main atmospheric input.<br />
OMEGA_TOTAL_INPUT(MAXLAYER). Total single scattering albedo ω p for layer p. If there is just one<br />
scatterer s with absorption coefficient is α ps and scattering coefficient σ ps , then ω p = ω ps = σ ps /(σ ps + α ps<br />
). For aerosols and clouds we are usually given σ ps and the extinction coefficient ε ps = σ ps + α ps .For<br />
molecular scattering σ ps = ρ(T p ,P p )σ Ray (λ) which is the air density ρ(T p ,P p ) for layer temperature and<br />
pressure T p and P p , multiplied by the Rayleigh scattering coefficient σ Ray (λ). Also for molecular absorption<br />
due to trace gas g, α psg = ρ(T p ,P p )V gp α gp (λ) where V gp is the volume mixing ratio of trace gas g in<br />
layer p, and α gp (λ) the trace gas absorption coefficient. In general, we have ω ps = σ ps / ε p where ε p =<br />
Σ s (ε ps ) is the total layer extinction (sum over all particulates), and ω p = Σ s ω ps .<br />
TAUGRID_INPUT(0:MAXLAYER). Using the above notation, and if the layer height thickness is h p , then<br />
the layer optical thickness is τ p −τ p-1 = ∆ p = ε p h p with τ 0 = 0. This is enough to define the vertical optical<br />
depth grid. Slant path thickness values TAUTHICK_INPUT(MAXLAYER,MAXLAYER) are obtained in<br />
a similar fashion, but vertical height thicknesses h p must be replaced by slant-path distances s p . For a<br />
plane-parallel atmosphere, s p = h p / µ 0 .<br />
PHASMOMS_TOTAL_INPUT(0:MAXMOMENT,MAXLAYER). We write (2l+1) β lps for the l th Legendre<br />
moment of the phase function of scatterer s in layer p. The first moment (indexed by 0) β 0ps =1<br />
(phase function normalization). For the isotropic case, there is only this value. For Rayleigh scattering, β 1p<br />
=0,β 2p = (1−δ)/(2+δ), where δ(λ) is the (wavelength-dependent) depolarization ratio, and β lp = 0 for<br />
l > 2. For aerosols with a Henyey-Greenstein phase function with asymmetry parameter γ p , β lp = (γ p ) l . For<br />
spherical scattering particles, Mie theory must be used to generate the required coefficients. The total<br />
moment is a sum-weighted value: ω p β lp = Σ s ω ps β lps .<br />
LIDORT_GEOPHYS.VARS. Surface input.<br />
ALBEDO, symbol R. For Lambertian case, this is to be specified explicitly. For the bidirectional case, it is<br />
1 1 1<br />
defined as R = -- µµ′ρ , where is the azimuth-independent component of<br />
4<br />
0<br />
∗<br />
∫ ( µµ′ , ) d µ dµ′<br />
ρ<br />
0∫<br />
0<br />
∗ ( µµ′ , )<br />
0<br />
the Fourier-expanded bidirectional reflectance. One can use quadrature to evaluate this integral: this<br />
quadrature need not be the same as the one specified for LIDORT computation. However, once you have<br />
calculated R, you will have to prepare the bidirectional coefficients at the LIDORT angles (quadrature and<br />
other polar angles) before use in the model (see entries BIREFELEC and USER_BIREFLEC below).
LIDORT - User’s <strong>Guide</strong> to Version 2.3 37<br />
BIREFLEC(0:MAXMOMENT,MAXSTRM,MAXSTRM). Albedo-normalized bidirectional reflection<br />
Fourier expansion coefficients ρ m (−µ i ,µ j ) for scattering from incident direction −µ i to reflection direction<br />
µ j . This is required for the reflection of the downward radiation. For the Lambertian case, ρ 0 (−µ i ,µ j )=1<br />
and ρ m (−µ i ,µ j ) = 1 for m > 0 (true for all directions).<br />
BIREFLEC_0(0:MAXMOMENT,MAXSTRM). Albedo-normalized bidirectional reflection Fourier<br />
expansion coefficients, for scattering from incident direction −µ 0 to reflection direction µ j . This is required<br />
for the reflection of the direct beam at the surface. For the Lambertian case, ρ 0 (−µ 0 ,µ j )=1andρ m (−µ 0 ,µ j )<br />
= 1 for m > 0, for all outward directions.<br />
EMISSIVITY(MAXSTRM). The directional emissivity κ(µ j ) is determined from Kirchhoff’s law:<br />
∫<br />
1<br />
κµ ( j<br />
) = 1–<br />
2R µ′ρ 0<br />
( µ j<br />
, µ′ ) dµ′<br />
, where the symbols on the right hand side are defined as above. This<br />
0<br />
may be evaluated off-line using a suitable quadrature scheme. For an assumed Lambertian albedo R, the<br />
emissivity is 1−R for all directions.<br />
USER_BIREFLEC(0:MAXMOMENT,MAX_USER_STREAMS,MAXSTRM). Albedo-normalized bidirectional<br />
reflection Fourier expansion coefficients, for scattering from incident direction −µ i to reflection<br />
direction µ α (one of the user-defined stream angles).This is required for the reflection of the field at the surface.<br />
For the Lambertian case, ρ 0 (−µ i ,µ α ) = 1 and ρ m (−µ i ,µ α ) = 1 for m > 0, for all directions.<br />
USER_BIREFLEC_0(0:MAXMOMENT,MAX_USER_STREAMS). Albedo-normalized bidirectional<br />
reflection Fourier expansion coefficients, for scattering from incident direction −µ 0 to reflection direction<br />
µ α (one of the user-defined off-quadrature stream angles). For the Lambertian case, ρ 0 (−µ 0 ,µ α )=1and<br />
ρ m (−µ 0 ,µ α ) = 1 for m > 0, for all directions.<br />
USER_EMISSIVITY(MAX_USER_STREAMS). Directional emissivity at user-defined stream angles).<br />
Again follows from Kirchhoff’s law. For Lambertian albedo R, the emissivity is 1−R for all directions.<br />
4.2 Preparation for LIDORT_L_GEOPHYS Supplementary Structure<br />
OMEGA_VARS_TOTAL_INPUT(MAX_PARAMETERS,MAXLAYER). We use the symbol u xps for the<br />
relative variation in single scattering albedo ω ps for scatterer s in layer p, with respect to variable x in that<br />
layer. We write u xp similarly for the relative variation in total single scatter albedo ω p ; this is the desired<br />
input quantity OMEGA_VARS_TOTAL_INPUT. By definition:<br />
x ∂ω<br />
u xps<br />
-------- ps<br />
x ∂ω<br />
= ⋅ ----------- and u .<br />
ω ps ∂x xp<br />
------ p<br />
= ⋅ ---------<br />
ω p ∂x<br />
Thus for the case of just one scatterer with absorption and scattering coefficients α ps and σ ps respectively,<br />
and ω ps = σ ps /(σ ps + α ps ), then if x = σ ps we have u xps = α ps /(σ ps + α ps ). Similarly if x = α ps then u xps<br />
= −α ps /(σ ps + α ps ). For molecular scattering with σ ps = ρ(T p ,P p )σ Ray (λ) and molecular absorption due<br />
to a single trace gas such that α ps = ρ(T p ,P p )M p α p (λ) where M p is the volume mixing ratio in layer p, and<br />
α p (λ) the trace gas absorption coefficient, then u xps = −ρ(T p ,P p ) α p (λ) /(σ ps + α ps ) for x = M p (result for<br />
volume mixing ratio weighting function output). Since we know that ω p = Σ s ω ps , then we have:
LIDORT - User’s <strong>Guide</strong> to Version 2.3 38<br />
ω p<br />
u xp<br />
=<br />
∑<br />
s<br />
ω ps<br />
u xps<br />
.<br />
EXT_VARS_INPUT(MAX_PARAMETERS, MAXLAYER). We use the symbol v xp for the relative variation<br />
in layer extinction coefficient e p for layer p, with respect to variable x. The definition is:<br />
v xp<br />
=<br />
x<br />
----<br />
e p<br />
∂e p<br />
⋅ --------<br />
∂x<br />
.<br />
For one scatterer in layer p with layer absorption and scattering coefficients α p and σ p respectively, we<br />
have e p = σ p + α p .Ifx = σ p then v xp = σ p /e p Note that this definition is different from that used in the<br />
User’s <strong>Guide</strong> to Version 1.<br />
PHASMOM_VARS_TOTAL_INPUT(MAX_PARAMETERS,0:MAXMOMENT,MAXLAYER). We use<br />
the symbol z xpls for the relative variation in l-th phase function moment β lps for scatterer s in layer p, with<br />
respect to variable x in that layer. We write z xpl similarly for the relative variation in the total l-th phase<br />
function moment β lp ; this is the desired input quantity PHASMOM_VARS_TOTAL_INPUT. By definition:<br />
x ∂β<br />
z xpls<br />
-------- lps<br />
x ∂β<br />
= ⋅ ----------- . and z .<br />
β lps ∂x xpl<br />
------ lp<br />
= ⋅ ---------<br />
β lp ∂x<br />
In general the derivatives z xpls must be derived from electromagnetic scattering theory, but for some simple<br />
cases, we can find them directly. For example, with the Henyey-Greenstein phase function with asymmetry<br />
parameter γ ps , β lps = (γ ps ) l . and hence z xpls = l if the parameter to be varied x = γ ps . Since we know that<br />
ω p β lp = Σ s ω ps β lps , then in general we have by differentiation:<br />
∑<br />
ω p<br />
β lp<br />
( u xp<br />
+ z xpl<br />
) = ω ps<br />
β lps<br />
( u xps<br />
+ z xpls<br />
).<br />
s<br />
where u xps and u xp have already been determined for OMEGA_VARS_TOTAL_INPUT. Note - this input<br />
should be used with caution!
LIDORT - User’s <strong>Guide</strong> to Version 2.3 39<br />
5. Installation, Makefile and Test Example<br />
5.1 Installation Procedure<br />
The LIDORT package may be downloaded from the SAO’s anonymous ftp site:<br />
ftp://cfa-ftp.harvard.edu/<br />
Change directory to<br />
cd pub/lidort/v2<br />
There are six LIDORT source code “tar” files, which contain all the master modules, internal modules and<br />
include files as outlined in Chapters 2 and 3:<br />
src_V23e_master.tar,<br />
src_V23s_master.tar<br />
src_standard.tar,<br />
src_extension.tar<br />
include_s.tar,<br />
include_e.tar<br />
The two additional files<br />
V23E_RELEASE.tar,<br />
V23S_RELEASE.tar<br />
contain user-defined environments for an extended calculation (with weighting functions) and a standard<br />
calculation (intensity-only) respectively, for an example involving backscatter radiation in a terrestrial 60-<br />
layer atmosphere with Rayleigh scattering, aerosol scattering and extinction, and ozone absorption for a<br />
number of wavelengths in the UV atmosphere. This application is important for the ozone profile retrieval<br />
algorithms. More details on this test case are given below in Section 5.3. 8 separate eponymous directories<br />
should be created for all these tar files.<br />
The “RELEASE” directories each contain a makefile, some input files and some test data results, and a<br />
“README.TXT” file which explains the installation procedure. Before compilation, the user should enter<br />
each makefile and alter the absolute path variable $(LIDORT_PATH) to the desired directory on the home<br />
computer. The user should then examine the compilation options and make changes as necessary (the list<br />
of compilation flags is by no means complete - the original work was done on a Sun unix workstation, and<br />
there are compilation options satisfying the “gnu” compiler). Executing the makefile creates all the object<br />
files and an executable (lidort_runs_V23e_o3 in the example below).<br />
5.2 Makefile Example in Directory V23E_RELEASE<br />
We now examine the makefile in the V23E_RELEASE directory. This will generate an executable for an<br />
extended calculation of intensities and weighting functions. The corresponding makefile for the standard<br />
calculation is very similar, being in essence just a subset of the extended file. We leave out details of the<br />
compilations; one example will suffice.<br />
# Makefile for LIDORT Version 2.3E<br />
# general notes<br />
###############<br />
# Name of the compiler and the LINK.f statement should be supplied.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 40<br />
# Ordering of modules follows that required for GNU - the linker<br />
# needs the modules in a certain order (a called module must be<br />
# already compiled and linked before).<br />
# GNU compilation constructed by W. Thomas, DLR, 01 December 1999<br />
# Solaris compiler instructions (original)<br />
###############################<br />
#LIDORT_COMPILE = f77 -c -u -C<br />
LIDORT_COMPILE = f77 -c -u -fast<br />
F77 = f77<br />
# The debug flag is -g<br />
# For speed, use LIDORT_COMPILE = f77 -c -u -fast<br />
# Link definition<br />
#################<br />
LINK.f = $(F77)<br />
# Path variables<br />
################<br />
# Define a variable LIDORT_PATH and users must change only this!<br />
LIDORT_PATH = /home/rspurr/LIDORT/v2p3<br />
MPATH_S = $(LIDORT_PATH)/src_V23s_master/<br />
MPATH_E = $(LIDORT_PATH)/src_V23e_master/<br />
SPATH_S = $(LIDORT_PATH)/src_standard/<br />
IPATH_S = $(LIDORT_PATH)/include_s/<br />
SPATH_E = $(LIDORT_PATH)/src_extension/<br />
IPATH_E = $(LIDORT_PATH)/include_e/<br />
# OBJECT MODULES<br />
################<br />
# LIDORT modules in directory src_standard<br />
OBJECTS_LIDORT_SOLUTIONS = LIDORT_RTSOLUTION.o \<br />
LIDORT_MULTIPLIERS.o<br />
OBJECTS_LIDORT_SETUPS = LIDORT_MISCSETUPS.o \<br />
LIDORT_DERIVEINPUT.o \<br />
LIDORT_CHECKINPUT.o<br />
OBJECTS_LIDORT_INTENSITY = LIDORT_BVPROBLEM.o \<br />
LIDORT_INTENSITY.o \<br />
LIDORT_CONVERGE.o \
LIDORT - User’s <strong>Guide</strong> to Version 2.3 41<br />
LIDORT_SSCORRECTION.o<br />
OBJECTS_LIDORT_AUX = LIDORT_AUX.o \<br />
LIDORT_READINPUT.o \<br />
LIDORT_WRITEMODULES.o<br />
# LIDORT modules in directory src_extension<br />
OBJECTS_LIDORT_L_SOLUTIONS = LIDORT_L_RTSOLUTION.o \<br />
LIDORT_L_MULTIPLIERS.o<br />
OBJECTS_LIDORT_L_SETUPS = LIDORT_L_MISCSETUPS.o \<br />
LIDORT_L_CHECKINPUT.o<br />
OBJECTS_LIDORT_L_WGHTFNS = LIDORT_L_BVSETUPS.o \<br />
LIDORT_L_FOURIERADD.o \<br />
LIDORT_L_WFCALC.o \<br />
LIDORT_SSCORRECTION.o<br />
OBJECTS_LIDORT_L_AUX = LIDORT_L_INPUTREAD.o \<br />
LIDORT_L_WRITEMODULES.o<br />
# LIDORT top level modules in directory src_V23e_master<br />
OBJECTS_LIDORT_MASTERS = LIDORT_V23E_MASTER.o \<br />
LIDORT_V23E_INPUT.o \<br />
LIDORT_V23E_FOURIER.o<br />
# environment & interface modules external to the main package<br />
OBJECTS_LIDORT_ENVIRON = user_testenv_o3.o \<br />
user_prepare_o3.o<br />
# EXECUTABLE<br />
############<br />
APPLICATION<br />
= lidort_run_V23e_o3<br />
all: $(APPLICATION)<br />
$(APPLICATION): $(OBJECTS_LIDORT_ENVIRON) \<br />
$(OBJECTS_LIDORT_MASTERS) \<br />
$(OBJECTS_LIDORT_SETUPS) \<br />
$(OBJECTS_LIDORT_SOLUTIONS) \<br />
$(OBJECTS_LIDORT_INTENSITY) \<br />
$(OBJECTS_LIDORT_AUX) \<br />
$(OBJECTS_LIDORT_L_SETUPS) \<br />
$(OBJECTS_LIDORT_L_SOLUTIONS) \<br />
$(OBJECTS_LIDORT_L_WGHTFNS) \<br />
$(OBJECTS_LIDORT_L_AUX)<br />
$(LINK.f) -o $(APPLICATION) \<br />
$(OBJECTS_LIDORT_ENVIRON) \
LIDORT - User’s <strong>Guide</strong> to Version 2.3 42<br />
# COMPILATIONS<br />
##############<br />
$(OBJECTS_LIDORT_MASTERS) \<br />
$(OBJECTS_LIDORT_SETUPS) \<br />
$(OBJECTS_LIDORT_SOLUTIONS) \<br />
$(OBJECTS_LIDORT_INTENSITY) \<br />
$(OBJECTS_LIDORT_AUX) \<br />
$(OBJECTS_LIDORT_L_SETUPS) \<br />
$(OBJECTS_LIDORT_L_SOLUTIONS) \<br />
$(OBJECTS_LIDORT_L_WGHTFNS) \<br />
$(OBJECTS_LIDORT_L_AUX) \<br />
$(FLIBRARIES)<br />
# (one example) Environment modules<br />
user_testenv_o3.o: user_testenv_o3.f \<br />
$(IPATH_S)LIDORT.PARS \<br />
$(IPATH_E)LIDORT_L.PARS \<br />
$(IPATH_S)LIDORT_CONTROL.VARS \<br />
$(IPATH_S)LIDORT_SETUPS.VARS \<br />
$(IPATH_S)LIDORT_MODEL.VARS \<br />
$(IPATH_S)LIDORT_RESULTS.VARS \<br />
$(LIDORT_COMPILE) user_testenv_o3.f<br />
etc....<br />
5.3 Test-case Example in Directory V23E_RELEASE<br />
This Directory contains the following files:<br />
user_testenv_o3.f,<br />
user_prepare_o3.f<br />
input_o3.inp<br />
scenario_o3.inp<br />
make_o3_atm_1.dat<br />
makefile<br />
O3_results.out_save<br />
O3_input.out_save<br />
O3_scenario.out_save<br />
For the test example listed here, user_testenv_o3.f is the MAIN program which calls<br />
LIDORT_V23E_INPUT and LIDORT_V23E_MASTER, while user_prepare_o3.f is a subroutine<br />
to generate the atmosphere required for this test. There are 3 input files: input_o3.inp is the initialization<br />
file to be read in LIDORT_V23E_INPUT for the control and model variables; scenario_o3.inp<br />
contains the height grid to be used in this test, and is read in user_prepare_o3.f;<br />
make_o3_atm_1.dat is a file of atmospheric data (pressure, temperature, volume mixing ratio, aerosol<br />
loading), also to be read by the preparation module. makefile will create the desired executable, which<br />
can then be run for this test case. The result will be three files ending in ‘*.out’, and these should be iden-
LIDORT - User’s <strong>Guide</strong> to Version 2.3 43<br />
tical to the existing three files ending in ‘*.out_save’. The layer weighting functions are with respect to<br />
ozone volume mixing ratio and temperature. This completes the installation test.<br />
In order to create your own application, the following steps should be carried out.<br />
1. Create a new sub-directory for the application (equivalent to V23E_RELEASE).<br />
2. Copy the user-defined environment source code files for the test case user_testenv_o3.f and<br />
user_prepare_o3.f into this new directory and rename them.<br />
3. Go inside these renamed files and alter them according to your application. The preparation module<br />
should be created using the guidelines in Section 4.<br />
4. Copy makefile and the input file input_o3.inp. Rename the input file and alter the contents<br />
according to your specifications. You may need to create some additional files for reading in your<br />
atmospheric scenario.<br />
5. Go into the makefile and make necessary name changes to the two environment source files and<br />
give the application a new name. Don’t forget to alter the absolute path variable! You do not need to<br />
alter anything else in the makefile.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 44<br />
6. Error Handling, Utilities, References<br />
6.1 Error Handling<br />
The main modules LIDORT_V23S_MASTER and LIDORT_V23E_MASTER have two status arguments<br />
- the integer variables STATUS_CHECKINPUT and STATUS_CALCULATION. They which can take one<br />
of the two values indicated in the LIDORT.PARS structure (see error indices). The error handling internal<br />
to LIDORT works as follows. If an error has been returned from one of the internal routines, then a message<br />
about the error is generated along with a trace for that error; these quantities are then written to the<br />
output error file. If an internal error has occurred this will be traced through LIDORT and an error value<br />
will be given to one of the above two STATUS variables upon output from the master module.<br />
The same applies to LIDORT_V23E_INPUT, which has three arguments - the integer variable<br />
STATUS_INPUTREAD, the name of the initialization file, and the name of the error output file. See the<br />
pseudo-code sequence in Section 3.1 for an example.<br />
Apart from the use of standard numerical routines to solve the eigensystem and a number of linear algebra<br />
problems, LIDORT is entirely analytical. With this in mind, errors are confined to the following situations.<br />
File-read errors.<br />
These will be generated by incorrect key words in the input file. These errors are detected by the FINDPAR<br />
package.<br />
Checking errors.<br />
Most of the LIDORT control, model and geophysical inputs are checked internally before actual computations<br />
start. All such consistency checks are collected in the modules LIDORT_CHECKINPUT and<br />
LIDORT_L_CHECKINPUT. All errors produced in this way will be due to incorrect or inconsistent input<br />
specifications. In addition to each error message and trace, an additional character string is generated for<br />
the error file - this string provides a hint for the user to correct the appropriate input.<br />
Numerical errors.<br />
Only in exceptional circumstances should an error condition be returned from the eigenroutine ASYMTX<br />
or one of the LAPACK [6] linear algebra modules. One possibility to watch out for is degeneracy caused<br />
by two layers having identical optical properties. Errors of this kind should be referred to the author for his<br />
perusal.<br />
Note on the use of L’Hopital’s Rule. Occasionally, analytic expressions used in LIDORT break down when<br />
there is a coincidence of stream angles. The commonest example of this occurs for downwelling radiation<br />
in a plane-parallel atmosphere when one of the user stream angles is identical to the solar zenith angle. The<br />
corresponding layer source term multiplier must be replaced by a limit value found by the use of L’Hopital’s<br />
Rule. The example noted here has already been dealt with in this manner, but similar breakdowns<br />
could in theory happen say when one of the separation constants is vanishingly close to one of the user<br />
stream angles. Additional applications of L’Hopital’s Rule will be incorporated into the code.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 45<br />
6.2 Utilities<br />
LIDORT utility routines are collected together in the source code file LIDORT_AUX.f. They include a<br />
selection of modules from the LAPACK library, plus a number of other standard numerical modules, and<br />
some file-read and error handling modules. The most important modules in the LAPACK selection are:<br />
DGBTRF<br />
DGBTRS<br />
DGETRF<br />
DGETRS<br />
DGBTF2<br />
DLASWP<br />
XERBLA<br />
DGETF2<br />
DGEMM<br />
DGEMV<br />
DGER<br />
DTBSV<br />
DTRSM<br />
These LAPACK modules are not performance-optimized for the LIDORT package (there is in particular a<br />
lot of redundancy in the linear algebra problems). In the near future, it is expected that the whole linear<br />
algebra package will be replaced by dedicated routines based in part on the above, but with enhanced performance<br />
in terms of run-time and efficiency.<br />
Additional numerical modules are:<br />
ASYMTX (eigenfunction problem solution module from DISORT);<br />
GAULEG (Gauss-Legendre quadrature determination; Numerical Recipes);<br />
CFPLGARR (Legendre-polynomial generator).<br />
The FINDPAR tool for reading the initialization file was developed by J. Lavagnino (SAO) and is also<br />
found here.<br />
6.3 A Note on Validation<br />
6.3.1 Plane-parallel validation against DISORT<br />
Since DISORT and LIDORT are discrete ordinate codes, it is possible to validate LIDORT intensity output<br />
against DISORT in a precise fashion. As far as intensity goes, both models take identical inputs, so this is<br />
really an “apples” and “apples” comparison. There is none of the difficulties inherent in comparing RT<br />
models which solve the RT equations in different ways, or with the “layers versus levels” issues that<br />
bedevil some of the comparisons. Further, DISORT is the most widely used and tested plane-parallel RT<br />
model currently in use in the atmospheric community; it has been a benchmark against which other models<br />
have been tested. Version 2.0 of DISORT has an automatic correction for the single scatter using the Nakajima-Tanaka<br />
algorithm, and we now present some examples of this validation.<br />
We take a 60-layer atmosphere with ozone as the trace gas absorber, and with Rayleigh and aerosol scattering,<br />
and with surface albedo 0.3. Optical properties are defined at wavelength 335.4579 nm. The solar<br />
zenith angle is 55 o , with a relative azimuth of 0 o , and variable line-of-sight zenith angle. We look at the
LIDORT - User’s <strong>Guide</strong> to Version 2.3 46<br />
TOA upwelling intensity, comparing the original (without single scatter correction) value with the NT-corrected<br />
value, and also making a comparison of the single scatter terms needed to make the NT-correction.<br />
Note that the uncorrected intensity is the value generated by earlier versions of DISORT. Table 1 summarizes<br />
these comparisons.<br />
.<br />
Table 1: Plane-parallel DISORT/LIDORT intensity comparisons<br />
Angle ( o ) Stream DISORT LIDORT<br />
number<br />
1. Original intensity before correction I(original):<br />
0.0 6 7.83513E-02 7.835137117005225E-002<br />
10.0 6 7.64205E-02 7.642061517245054E-002<br />
20.0 6 7.66746E-02 7.667478191066619E-002<br />
30.0 6 7.92090E-02 7.920910104336290E-002<br />
40.0 6 8.41525E-02 8.415260726598663E-002<br />
25.0 8 7.72878E-02 7.728777647817973E-002<br />
2. Nakajima-Tanaka single scatter term I(ss_exact):<br />
0.0 6 2.36675E-02 2.366747046434831E-002<br />
10.0 6 2.15248E-02 2.152485001476636E-002<br />
20.0 6 2.04918E-02 2.049181517129264E-002<br />
30.0 6 2.08425E-02 2.084253500622847E-002<br />
40.0 6 2.29805E-02 2.298054353823100E-002<br />
25.0 8 2.03631E-02 2.036306163710890E-002<br />
3. Removed single scatter term I(ss_removed):<br />
0.0 6 2.34218E-02 2.342176693498307E-002<br />
10.0 6 2.12635E-02 2.126346281984243E-002<br />
20.0 6 2.05236E-02 2.052363098791028E-002<br />
30.0 6 2.12063E-02 2.120627412852576E-002<br />
40.0 6 2.33098E-02 2.330982413854123E-002<br />
25.0 8 2.03020E-02 2.030196554124376E-002<br />
4. NT-corrected Intensity I(corrected):<br />
0.0 6 7.85970E-02 7.859707469941750E-002<br />
10.0 6 7.66818E-02 7.668200236737446E-002<br />
20.0 6 7.66428E-02 7.664296609404855E-002<br />
30.0 6 7.88453E-02 7.884536192106562E-002<br />
40.0 6 8.38232E-02 8.382332666567639E-002<br />
25.0 8 7.73489E-02 7.734887257404488E-002<br />
Remarks on Table 1:<br />
1. DISORT is single precision (apart from the eigenproblem), with LIDORT double precision throughout.<br />
This explains differences in the last decimal place.<br />
2. These results were obtained by ensuring that all possible Fourier components were calculated (that is,<br />
with 8 streams, a maximum of 7 Fourier components can be included in the intensity sum). This is the only<br />
way to get agreement between the models, since the computation of the single scatter term I(ss_removed)<br />
is only correct in DISORT when all Fourier components are included.
LIDORT - User’s <strong>Guide</strong> to Version 2.3 47<br />
6.3.2 Pseudo-spherical validation against SDISORT<br />
The situation regarding pseudo-spherical validation is similar. A pseudo-spherical version SDISORT<br />
exists, but is part of a large suite of RT programs [10]. However it is possible to extract SDISORT from this<br />
infrastructure, and carry out some comparisons. SDISORT does not have the Nakajima-Tanaka correction,<br />
so the results presented in the next table are not corrected in this way. In Table 2, results are for upwelling<br />
intensities at TOA for line-of-sight viewing zenith angles as indicated. The solar angle was 82 o , with relative<br />
azimuth angle 60 o . 16 streams in the complete polar direction space were used. Atmosphere as in previous<br />
table. The figures apply to a 60-layer atmosphere with 8 discrete ordinate streams in the half-space.<br />
Table 2: SDISORT and LIDORT comparisons, 16 stream<br />
Angle SDISORT LIDORT<br />
0.0 1.74379E-02 1.743787E-02<br />
1.0 1.74259E-02 1.742588E-02<br />
2.0 1.74194E-02 1.741939E-02<br />
5.0 1.74333E-02 1.743328E-02<br />
10.0 1.75709E-02 1.757091E-02<br />
15.0 1.78613E-02 1.786122E-02<br />
20.0 1.83187E-02 1.831864E-02<br />
25.0 1.89573E-02 1.895727E-02<br />
6.3.3 Weighting Function Validation<br />
For weighting function validation, we use a finite-difference estimate of the weighting function (FDWF):<br />
FDWF I ( ξ 1) – I( ξ 2<br />
)<br />
≈ -------------------------------<br />
2ε<br />
This requires two separate calls to the intensity-only model, once with atmospheric property ξ perturbed to<br />
ξ 1 = ξ(1+ε) to give result Ι(ξ 1 ), and then again with property ξ perturbed to ξ 2 = ξ(1−ε) to give result Ι(ξ 2 ).<br />
The two results are subtracted and divided by twice the relative perturbation ε. In the limit as ε tends to<br />
zero, the finite difference result should reproduce the exact weighting function. This kind of validation<br />
works well for variables ξ such as O 3 volume mixing ratio, but is less satisfactory for weighting functions<br />
with respect to phase function quantities such as asymmetry parameter. The atmospheric conditions for<br />
Table 3 results are the same as those for Table 1. All results were taken at line-of-sight zenith angle 25 o ; the<br />
layers are numbered from TOA (thus layer 35 is between 25 and 26 km).<br />
Table 3: Weighting Function Validation<br />
1. Original Weighting Function before correction:
LIDORT - User’s <strong>Guide</strong> to Version 2.3 48<br />
parameter angle layer WF_exact FDWF % diff ε<br />
O3 VMR 25.0 60 -1.4825540E-05 -1.4825540E-05 4.4795101E-08 0.01<br />
Temperature 25.0 60 -2.2132436E-03 -2.2134503E-03 9.3373358E-03 0.01<br />
Aer_extinction 25.0 60 -2.1818227E-02 -2.1819131E-02 4.1391573E-03 0.01<br />
Pressure 25.0 60 2.1600948E-03 2.1600946E-03 1.1995438E-05 0.01<br />
O3 VMR 25.0 35 -1.5466107E-04 -1.5461694E-04 2.8528781E-02 0.01<br />
O3 VMR 25.0 35 -1.5466107E-04 -1.5466062E-04 2.8526293E-04 0.001<br />
O3 VMR 25.0 35 -1.5466107E-04 -1.5466106E-04 3.0789991E-06 0.0001<br />
2. NT-corrected Weighting Functions<br />
Remarks on Table 3<br />
1. Weighting functions with respect to 4 parameters (O 3 VMR, temperature, pressure and aerosol extinction<br />
coefficient) are presented in the table. Two layers were selected; in particular layer 35 (at 25 km) is<br />
close to the peak concentration of O 3 , and this is where the weighting functions are largest.<br />
2. The last three rows in each section illustrate the finite-differencing; by making ε really small, one can get<br />
arbitrarily close to the exact result, which of course LIDORT produces as a matter of course.<br />
3. It is possible for LIDORT to generate any sort of weighting function - there are no limits here, as the<br />
entire discrete ordinate solution is differentiable. Finite-differencing verification is generally OK for those<br />
variables which do not affect the phase function itself. Using discrete ordinates always involves some sort<br />
of truncation of the phase function (with or without the delta-M scaling) and the discarded phase function<br />
contributions can be very sensitive to small changes in the asymmetry parameter. For this reason it is not<br />
recommended to generate weighting functions with respect to parameters which affect phase functions<br />
unless you are certain that there are enough phase function moments in the Legendre expansion to ensure<br />
that the phase function is accurately represented.<br />
6.4 References<br />
Table 3: Weighting Function Validation<br />
O3 VMR 25.0 60 -1.4827224E-05 -1.4827224E-05 1.0904033E-08 0.01<br />
Temperature 25.0 60 -2.2122634E-03 -2.2124700E-03 9.3376304E-03 0.01<br />
Aer_extinction 25.0 60 -2.1820707E-02 2.1821610E-02 4.1387162E-03 0.01<br />
Pressure 25.0 60 2.1591086E-03 2.1591083E-03 1.2019646E-05 0.01<br />
O3 VMR 25.0 35 -1.5425527E-04 -1.5421106E-04 2.8658387E-02 0.01<br />
O3 VMR 25.0 35 -1.5425527E-04 -1.5425483E-04 2.8655009E-04 0.001<br />
O3 VMR 25.0 35 -1.5425527E-04 -1.5425526E-04 3.4798750E-06 0.0001<br />
[1] Spurr, R. J. D., T. P. Kurosu and K. V. Chance, A Linearized Discrete Ordinate Radiative Transfer<br />
Model for Atmospheric Remote Sensing Retrieval, J. Quant. Spectrosc. Radiat. Transfer, in press<br />
(2000).
LIDORT - User’s <strong>Guide</strong> to Version 2.3 49<br />
[2] Stamnes, K., S.-C. Tsay, W. Wiscombe, and K. Jayaweera, Numerically stable algorithm for discrete<br />
ordinate method radiative transfer in multiple scattering and emitting layered media, Applied<br />
Optics, 27, 2502-2509 (1988)<br />
[3] Chandrasekhar, S., Radiative Transfer, Dover, New York, (1960).<br />
[4] Siewert, C. E., A concise and accurate solution to Chandrasekhar basic problem in radiative transfer,<br />
J. Quant. Spectrosc. Radiat. Transfer, 64, 109-130 (2000).<br />
[5] Wiscombe, W., J. Atmos. Sci., 34, 1408-22 (1977).<br />
[6] Anderson, E., et. al., LAPACK user’s guide, Second edition, Society for Industrial and Applied<br />
Mathematics, Philadelphia (1995)<br />
[7] Spurr, R. J. D., Simultaneous derivation of intensities and weighting functions in a general pseudospherical<br />
radiative transfer treatment, submitted to JQSRT, (2000).<br />
[8] Nakajima, T., and M. Tanaka, Algorithms for radiative intensity calculations in moderately thick<br />
atmospheres using a truncation approximation, J. Quant. Spectrosc. Radiat. Transfer, 40, 51-69,<br />
(1988).<br />
[9] van Oss, R. F., and R. J. D. Spurr, Fast and accurate 4 and 6 stream linearized discrete ordinate radiative<br />
transfer models for ozone profile retrieval, paper in preparation, (2000).<br />
[10] Kylling, A. and K. Stamnes, Efficient yet Accurate Solution of the Linear Transport Equation in the<br />
Presence of Internal sources: The Exponential-linear-in-depth Approximation, J. Comp. Phys., 102,<br />
265-276, (1992).<br />
Acknowledgments<br />
R. Spurr was funded mainly through:<br />
SCIAMACHY Data Processor Development, Contract number 332/60570480<br />
Deutsches Forschungszentrum für Luft und Raumfahrt (DLR)<br />
Postfach 1116, D82230 Wessling, Germany.<br />
Ozone SAF Visiting Scientist Grants, P-4799-2-00 and P-4799-2-01<br />
KNMI (Royal Dutch Meteorological Institute)<br />
P.O. Box 201, 3730 AE De Bilt, The Netherlands<br />
with additional internal funds from the Smithsonian Astrophysical Observatory.<br />
Biggest thanks go to my colleague Roeland van Oss for numerous stimulating discussions on the theory<br />
and applications of LIDORT; we are working together on faster LIDORT versions for the Ozone profile<br />
retrieval problem. Special thanks also to Piet Stamnes for careful reviewing of the papers, and Knut<br />
Stamnes for a number of interesting discussions on the LIDORT model. Thanks also to Thomas Kurosu for<br />
assistance with paper preparation, and Werner Thomas for help with software checks. The author is grateful<br />
for the enthusiasm and support provided by his Ph.D. thesis team (sponsor Hennie Kelder, co-sponsors<br />
Piet Stammes and Roeland van Oss, external advisor Knut Stamnes).