Latest: TABCMP_X v1.21 (05AUG15)
Part of the RFM handling of Look-Up Tables.
tabcmp_x.f is the FORTRAN77 program to compress RFM-generated
look-up tables of pre-tabulated absorption coefficient
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
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.
- 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.
- 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).
- The program asks for an Accuracy Criterion.
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).
- 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.
- 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) - just
to verify that the additional error from the compression is acceptable.
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
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
For the compression, the user specifies an Accuracy
with which the transmittance of every
cell matches the original transmittance as spectral points are removed
| 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
(pi, Tj, qk) axis points).
Unlike with the spectral compression, there is no option to specify
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.
This is because the total number of
Np × NT × Nq
axis points (=14600 in this case)
exceeds the local array size 10000. To fix this, edit the source code and
set PARAMETER MAXX to be ≥
Np × NT × Nq.
download the source code: [tabcmp_x.f]
Then compile with any FORTRAN77 compiler, eg
f77 tabcmp_x.f -o tabcmp_x
(although, if using binary .tab files, use the same compiler as for the RFM
which created the original files - see Introduction).
To run the program, simply type tabcmp_x and respond to the prompts.
A typical run might be
(user responses in bold)
R-TABCMP_X: Running TABCMP_X v1.0
Input file: tab_h2o_v.asc
Max absorption error (eg 0.001): 0.001
Output file: tab_h2o_x.asc
I-TABCMP_X: Starting to remove points. Initial No.= 1380
Removing p-axis value= 1.898E-04 [mb], ERR= .0000039
Removing p-axis value= 1.257E-02 [mb], ERR= .0075648
I-TABCMP_X: Summary: Orig Npts= 1380 New Npts= 1260 Red.Factor= 91.3%:
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.
- The first line tells you which version (1.0) of the program is being
- The second line asks you for the
.tab file to be compressed,
- 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.
- 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.
- 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 1380 (in this case
It then lists each axis point that is removed, in this case just 2
p-axis points, with the resulting maximum interpolation
- The processing finishes with a summary of the number of points
retained, in this case 1260 = 31×12×5 and then writes
the output file.
When running the program, after responding to the prompt for the input file,
the program may halt with a message printed to the terminal
F-RWAXIS: No.p*T*q-axis pts > MAXX
Another possible error is of the form
F-TABCMP_X: LUT contains 20001 spectral points, > local dimension MAXV= 10001
In this case the local array dimension set by PARAMETER MAXV would
have to be increased to (at least) 20001.
- 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