TABCMP_X

Latest: TABCMP_X v2.00 (27AUG19) [Download]
05JAN24
Contents

Introduction

Part of the RFM handling of
Look-Up Tables.

TABCMP_X is the Fortran90 program to compress RFM-generated look-up tables of pre-tabulated absorption coefficient (.tab files, created using the TAB option) in the p,T,q domains, essentially by removing axis points where the absorption coefficient can be accurately reconstructed by interpolation from the adjacent points.

This is intended to follow on from compression in the spectral domain (TABCMP_V) but is unlikely to produce such significant compression unless the user has vastly over-specified the resolution along one or more of the p,T,q tabulation dimensions.

General Comments

  1. This program can be run on any .tab file but since the entire file contents have to be held in memory it is probably necessary first to compress it in the spectral domain using the TABCMP_V program.
  2. The program can be run on either ASCII or binary versions of the .tab file, and output can be to either format (see Binary Files).
  3. The program asks for an Accuracy Criterion. This approximates the maximum interpolation error in transmittance, or as a fraction of radiance, resulting from the compression. If in doubt, go for a smaller number (resulting in less compression).
  4. The program always retains the upper/lower points in each dimension, giving an indication of the range of validity of the tabulation. However, where axes are reduced to just 2 points you should consider creating a separate table where this axis (most likely q) is removed entirely to see if this meets your accuracy requirements.
  5. You are advised to compare RFM runs for a few selected cases using both uncompressed and compressed .tab files (just a matter of changing the filename(s) in the *LUT section of the driver file) to verify that the additional error from the compression is acceptable.

Compression Procedure

A
.tab file contains a tabulation of absorption coefficient k(ν,p,T,q) [m2/kmol] of a single species, where ν,p,T,q are axes of wavenumber, pressure, temperature and volume mixing ratio (VMR) scale factor (the last two are optional), as well embedded profiles of temperature and VMR interpolated to the pressure axis.

Spectral dependence aside, the main variation in k is likely to be in the pressure domain (at least for molecules with distinct spectral lines) due to the influence of pressure (or Lorentz) broadening on the lineshape at pressures higher than a few mb (troposphere and lower stratosphere). There will also be some temperature dependence both via the dependence on the pressure broadening halfwidth on temperature (a parameter read from the HITRAN database) but also the Doppler broadening at low pressures. Some molecules also have a dependence on their own partial pressure, either through self-broadening or continuum features (H2O is the main example in terrestrial atmospheres).

For any given path condition of (lnp,T,lnq) the RFM performs a 3-dimensional linear interpolation in lnk (actually 4-dimensional if the spectral axis is included).

For the compression, the user specifies an Accuracy Criterion Δτ with which the transmittance of every cell matches the original transmittance as spectral points are removed and interpolated.

| exp(-k'lu) - exp(-klu) | ≤ Δτ
where k' is the (p,T,q)-interpolated k. This limit has to be satisfied for every spectral point νl for every cell (equivalent to (pi, Tj, qk) axis points). Unlike with the spectral compression, there is no option to specify resolution.

The procedure is to evaluate the maximum error over all cells if each (p,T,q)-axis point in turn were removed and all tabulated k values (including the spectral domain) replaced by an re-interpolated value. The axis point with the smallest maximum error is removed. The procedure is repeated until no more points can be removed without exceeding the specified error limit.

Installing tabcmp_x

First download the source code: [tabcmp_x.f90]

Then compile with any FORTRAN compiler, eg

gfortran tabcmp_x.f90 -o tabcmp_x
(although, if using binary .tab files, use the same compiler as for the RFM which created the original files — see Introduction).

Running tabcmp_x

To run the program, simply type tabcmp_x and respond to the prompts.

A typical run might be (user responses in bold)

tabcmp_x R-TABCMP_X: Running TABCMP_X v2.0 Input file: tab.asc Max absorption error (eg 0.001): 0.01 Output file: tab.asc_cmp I-TABCMP_X: Reading in LUT ... I-TABCMP_X: Starting to remove points. Initial No.= 663 Removing p-axis value= 2.585E-05 [mb], ERR= 0.0000783 Removing p-axis value= 4.565E-05 [mb], ERR= 0.0001334 Removing p-axis value= 1.244E-03 [mb], ERR= 0.0009010 Removing p-axis value= 3.055E-03 [mb], ERR= 0.0008864 Removing p-axis value= 7.187E-03 [mb], ERR= 0.0009885 Removing p-axis value= 9.210E-05 [mb], ERR= 0.0009949 Removing T-axis value= 290.00 [K], ERR= 0.0016804 Removing T-axis value= 280.00 [K], ERR= 0.0035770 Removing p-axis value= 8.280E+01 [mb], ERR= 0.0037369 Removing p-axis value= 2.772E+01 [mb], ERR= 0.0040321 Removing T-axis value= 250.00 [K], ERR= 0.0044927 Removing p-axis value= 1.620E-02 [mb], ERR= 0.0049934 Removing p-axis value= 3.559E-02 [mb], ERR= 0.0046838 Removing p-axis value= 4.417E+01 [mb], ERR= 0.0050603 Removing p-axis value= 3.509E+00 [mb], ERR= 0.0052969 Removing p-axis value= 1.818E+02 [mb], ERR= 0.0053198 Removing p-axis value= 5.801E+02 [mb], ERR= 0.0056596 Removing p-axis value= 9.694E+01 [mb], ERR= 0.0062442 Removing T-axis value= 220.00 [K], ERR= 0.0064197 Removing T-axis value= 190.00 [K], ERR= 0.0071797 Removing p-axis value= 6.605E+02 [mb], ERR= 0.0072523 Removing p-axis value= 2.145E+01 [mb], ERR= 0.0081903 Removing p-axis value= 7.074E+01 [mb], ERR= 0.0083593 Removing p-axis value= 4.946E+00 [mb], ERR= 0.0094710 I-TABCMP_X: Summary: Orig Npts= 663 New Npts= 256 Red.Factor= 38.6%: I-TABCMP_X: Writing new .tab file R-TABCMP_X: Successful completion

The program takes a few seconds to remove each point, depending on the original table size.

Notes

  1. The first line tells you which version (2.0) of the program is being executed.
  2. The second line asks you for the .tab file to be compressed,
  3. The third line asks for the maximum error in transmittance for each cell. A value 0.001 is suggested which approximately equates to a 0.1% maximum difference in spectra (transmittance, absorption or radiance) from the applied spectral compression, although here a value 0.01 is chosen.
  4. The fourth line asks for the name of the output file. If the filename contains the string .bin it is assumed to be binary format, otherwise it will be ASCII. If it differs from the input file format a further message will be printed stating that the format is being changed.
  5. The following lines indicate progress. The first such message tells you that the original number of tabulated points in the (p,T,q) domain is 663 (in this case Np=51 NT=13 Nq=1, 663 = 51×13). It then lists each axis point that is removed, in this case 19 p-axis points and 5 T-axis points, with the resulting maximum interpolation error after each axis point is removed.
  6. The processing finishes with a summary of the number of points retained, in this case 256 = 32×8 and then writes the output file.

Version History

v2.00 (27AUG19)
Completely recoded, changing from F77 to F90
v1.21 (05AUG15)
Change '$' in WRITE statements to avoid gfortran warnings
v1.2 (24FEB15)
Improve auto-detection of input file-type
v1.1 (16DEC14)
Assume .tab file contains ln(k) rather than k values.
v1.00 (04NOV14)
Original code