Making/Using LUT files, complex case

RFM Examples

07JUN24

Description

As an extension to the simple case, this is a more complicated example dealing with water vapour (nadir-viewing).

For terrestrial atmospheres, water vapour is the only absorber where the self-broadening contribution is large enough to make the absorption coefficient a function of absorber concentration as well as p,T, so requiring use of the third axis of the LUT tables.

It is also anticipated that the H2O LUT will be used with the H2O continuum (the RFM default behaviour for H2O LUTs [Details ...]) which means that the CTM flag is not used in the driver table to generate the LUT, but is used when the LUT is an input.

This example also introduces an optional compression step to reduce the size of the LUT file before use.

Step 1: Create the LUT

*FLG section
TAB flag: switches RFM into LUT-generation mode
*SPC section
Sets the wavenumber axis for the LUT file. Here it is anticipated that the the LUT will actually be used to simulate the range, 1215–1220 cm-1 but add a margin of ±1 cm-1 to allow for some spectral convolution. (NB: the spectral resolution here is set to 0.01 cm-1 just to keep the file sizes small, but 0.001 cm-1 would be more reasonable)
*ATM section
An atmospheric profile containing at least pressure, temperature and target molecule is always required in order to establish profiles of T(p) and H2O(p) included in the LUT file format which, in this case, are needed to interpret the axes.
*DIM section
Sets the pressure, temperature and VMR axes for the LUT file

Driver Table

*HDR 07JUN24 RFM Example: Create H2O LUT *FLG TAB *SPC 1214 1221 0.01 ! NB: too coarse for realistic spectra *GAS H2O *ATM ../atm/usa.atm *DIM PCG 11 -50 50 4 50 200 *HIT ../hit/hitran_2016.bin *END

RFM Output Files

Step 2: LUT Compression

The resulting LUT file tab_h2o.asc has size 24Mb (it could have been made smaller by adding the BIN flag). It has been created with 701 (ν) x 51 (p) x 11 (T) x 4 (q) = 1 573 044 data points.

There are two separate FORTRAN programs that can be used to compress the data by removing axis points where the values can be adequately represented by interpolation from the remaining axis points.

Compression in wavenumber axis

The first of these is TABCMP_V, which compresses in the wavenumber axis. User inputs in red
R-TABCMP_V: Running TABCMP_V v2.01 Input file: tab_h2o.asc Convolved resolution [cm-1]: 0.1 Max absorption error (eg 0.001): 0.001 Output file: tab_h2o_v.asc I-TABCMP_V: Reading in LUT ... I-TABCMP_V: Starting to remove points. Initial No.= 701 700 1214.1500 3.1531E-06 99.9% 370 Err.lim.= 1.0202E-03 I-TABCMP_V: Summary: Orig Npts= 701 New Npts= 370 Red.Factor= 52.8% I-TABCMP_V: Writing new .tab file ... R-TABCMP_V: Successful completion

It has been assumed that an absorption error of 0.001 within any profile layer is acceptable, and that the LUT output will be convolved to a resolution of 0.1 cm-1.

This took a few second to run (but increases with number of spectral points), and results in a file tab_h2o_v.asc of size 13Mb containing 370 instead of 701 spectral axis points.

Compression in p,T,q axes

Next use the program TABCMP_X to compress in the (p,T,q) axes.
R-TABCMP_X: Running TABCMP_X v2.01 Input file: tab_h2o_v.asc Max absorption error (eg 0.001): 0.005 Output file: tab_h2o_vx.asc I-TABCMP_X: Reading in LUT ... I-TABCMP_X: Starting to remove points. Initial No.= 2244 Removing q-axis value= 150.00 [%], ERR= 0.0024713 I-TABCMP_X: Summary: Orig Npts= 2244 New Npts= 1683 Red.Factor= 75.0%: I-TABCMP_X: Writing new .tab file R-TABCMP_X: Successful completion
This is rather quicker to run. 'Orig Npts' and 'New Npts' here refer to N(p) x N(T) x N(q) axis points, while for TABCMP_V they were spectral axis points. In this case just a single q-axis point was removed (150%) out of the four, hence the 25% reduction in size.

The new file tab_h2o_vx.asc is size 11Mb, less than half of the original, and contains 370 (ν) x 51 (p) x 11 (T) x 3 (q) = 622 710 data points.

Step 3: Using the LUT

In this example the LUTs are used to calculate transmittance spectra for a vertical path through the atmosphere, convolved to 0.1 cm-1 resolution for output.
*FLG section
AVG flag: in this example the output spectra are reduced in resolution by convolution with a triangular function
CTM flag: add continuum absorption (just for H2O in this case)
LUT flag: using LUTs for (some) molecular absorption data
TRA flag: calculate transmittance spectra
ZEN flag: upward-viewing spectra, as observed from the ground
*SPC section
The spectral range is narrower than the LUT, although with the AVG flag an extra ±0.1 cm-1 will be used.
*GAS section
In this example CH4 is added, but without a corresponding LUT, hence still the need to include the HITRAN database in the *HIT section
*LUT section
H2O LUT file to be used
*FIN section
Ensure underlying spectral fine grid matches that used for LUT generation

Driver Table

*HDR 07JUN24 RFM Example: Use H2O LUT *FLG AVG CTM FIN LUT TRA ZEN *SPC 1215 1220 0.1 *GAS H2O CH4 *ATM ../atm/usa.atm *SEC 1 *LUT tab_h2o_vx.asc *HIT ../hit/hitran_2016.bin *FIN 0.01 *END

RFM Output Files

Output Spectrum

[plot.py]

The calculated spectrum is shown in blue, but the plot also shows the difference compared to spectra calculated line-by-line (ie without LUTs), using the original uncompressed LUT, and using the LUT after just the wavenumber compression stage (almost identical).

Only the strong line at 1218.5 cm-1 is due to water vapour, the weaker lines are CH4, which is calculated line-by-line in all cases.