HITXSC

Note that RFM v5 accepts the HITRAN *xsc files directly, so there is no need to run this program to reformat the data

Latest: HITXSC v1.20 (24OCT13)

Contents

24OCT13

Introduction

hitxsc.f is the FORTRAN77 program to convert the molecular cross-section data (*.xsc files) from the HITRAN web-site to
.xsc files used by the RFM.

In most cases this simply means inserting header records which the RFM uses to identify the molecule and file structure, but sometimes more complicated manipulation is required to put the data in increasing wavenumber order and/or remove ambiguous overlapping data.

It is assumed that the user has already downloaded the original cross-section files from the HITRAN web-site (www.hitran.com), or has other cross-section data in the same format.

The current version of hitxsc is compatible with the molecules on the HITRAN web-site (Oct 13), and with RFM v4.3, but not with older versions of the RFM (since the RFM-numbering of cross-sectional molecules has changed).

This page contains the essentials on installing and running hitxsc, subsequent sections are for information only.

Installing hitxsc

First download the source code: [hitxsc.f]

Then compile with any FORTRAN77 compiler, eg

f77 hitxsc.f -o hitxsc

Running hitxsc

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

A typical run might be (user responses in bold)

hitxsc
R-HITXSC: Running HITXSC v.01AUG13
Input file: ClONO2_IR04.xsc
I-HITXSC: Checking file contents ...
I-HITXSC: Molecule identified as: ClONO2. Assigning RFM ID= 101
Spectral Range: 1 750.0004 830.0003 18
Spectral Range: 2 1260.0011 1320.0007 18
Spectral Range: 3 1680.0530 1789.9760 5
I-HITXSC: File contents successfully read
Output file: test.xsc
R-HITXSC: Successful completion

The program takes a few seconds to complete.

Notes

  1. The first line tells you which version (1.0) of the program is being executed.
  2. The second line asks you for the input cross-section file (eg a file downloaded from the HITRAN web-site)
  3. The third line shows that the program has recognised the molecule name listed in the first line of the file, and assigned the appropriate RFM molecule identification
  4. The following lines list the different spectral ranges found within the file, together with lower,upper wavenumber limits, and the code representing the data source (higher numbers are assumed to be more recent).
  5. In this case (as with most cross-section files on the HITRAN web-site) the spectral ranges are in ascending order without any overlaps so the program simply inserts its header records at the start of each spectral range and terminates.

Sorting/Merging

The above example is the (usual) simple case but there are two complications that can arise
  1. The spectral ranges may not be in ascending order
  2. Two datasets may have overlapping spectral ranges, leading to an ambiguity over which one to use
The cross-section file CH3CN_IR12.xsc is particularly problematic.

hitxsc
R-HITXSC: Running HITXSC v.01AUG13
Input file: CH3CN_IR12.xsc
I-HITXSC: Checking file contents ...
I-HITXSC: Molecule identified as: CH3CN. Assigning RFM ID= 142
Spectral Range: 1 624.7652 783.3822 32
Spectral Range: 2 867.6927 1158.7116 32
Spectral Range: 3 1175.5255 1686.3906 32
Spectral Range: 4 2217.0225 2342.7349 32
Spectral Range: 5 879.9967 1700.0022 53
Spectral Range: 6 2217.0225 2342.7349 32
Spectral Range: 7 2786.3444 3260.9300 32
Spectral Range: 8 3881.8386 4573.9200 32
Spectral Range: 9 2549.9964 3300.0010 43
I-HITXSC: File contents successfully read I-HITXSC: Sorting/merging spectral ranges into ascending order...

Here you can see that the spectral ranges are not in ascending order so the first thing that hitxsc does is create a scratch file containing the same contents but this time put in ascending order (this can take a few seconds). The program then continues

I-HITXSC: Reading sorted file instead of original...
Spectral Range: 1 624.7652 783.3822 32
Spectral Range: 2 867.6927 1158.7116 32
Spectral Range: 3 879.9967 1700.0022 53
Spectral Range: 4 1175.5255 1686.3906 32
Spectral Range: 5 2217.0225 2342.7349 32
Spectral Range: 6 2549.9964 3300.0010 43
Spectral Range: 7 2786.3444 3260.9300 32
Spectral Range: 8 3881.8386 4573.9200 32
I-HITXSC: File contents successfully read

Having sorted the file the program has realised that the original spectral ranges #4 and #6 were identical (with the same source reference, 32) so these have now been merged into the new range#5.

However there is now the problem that some of the spectral ranges overlap. The program continues ...

File contains overlapping spectral ranges:
Spc# Wmin Wmax NpT Ref
2 867.6927 1158.7116 2 32
3 879.9962 1700.0047 12 53
4 1175.5255 1686.3906 2 32
6 2549.9964 3300.0022 11 43
7 2786.3444 3260.9300 3 32
Select which Spc# to exclude (<CR>= 2):
File contains overlapping spectral ranges:
Spc# Wmin Wmax NpT Ref
3 879.9962 1700.0047 12 53
4 1175.5255 1686.3906 2 32
6 2549.9964 3300.0022 11 43
7 2786.3444 3260.9300 3 32
Select which Spc# to exclude (<CR>= 4):
File contains overlapping spectral ranges:
Spc# Wmin Wmax NpT Ref
6 2549.9964 3300.0022 11 43
7 2786.3444 3260.9300 3 32
Select which Spc# to exclude (<CR>= 7):
Output file: ch3cn.xsc

The program has identified that spectral ranges #2,3,4 and #6,7 all overlap (the additional number provided in the 4th column, 'NpT', is the number of different pressure,temperature tabulations provided in the spectral range, to give you an idea of how much data is associated with each range).

Since #2 is the oldest reference (32, same as #4 and #7), this is the first dataset that is excluded, and the overlap check repeated. The next time #4 is excluded, meaning that #3 no longer overlaps any other spectral range and leaving just #6 and #7 overlapping. Finally #7 is excluded and the file is now suitable for the RFM so the user is prompted for an output name.

User Control

The file hitxsc.f as downloaded has no user-control over the sorting/merging process. The 'sorted' version of the input file is a scratch file, deleted when the program finishes while the overlaps are handled on the basis of excluding the data with the lowest reference number for the source.

This set-up has the advantage that the code will always have predictable user-responses (ie just the input and output file names), so easily incorporated into a script to process a sequence of cross-section files. However it is recognised that the user may wish to intervene.

In the FORTRAN source code, just after the start of the EXECUTABLE CODE, there are two logical flags currently set to .FALSE. . The user can set either or both of these to .TRUE. (and recompile) to achieve the following

SRTFIL
This flag gives the user the option of creating a spectrally-sorted version of the input file. If set .TRUE. then, having identified that sorting is required, the program prompts the user for an output file name. This file is then accessible after the program has terminated.
SELECT
This flag gives the user the option of specifying which spectral ranges are to be discarded in the event of overlaps. In the above output for the CH3CN data the program prompts the user after each line eg 'Select which Spc# to exclude (<CR>=2)' (in this case, file#2 being the default option that the program would normally select itself).

Scripts

The following scripts can be used to process a number of cross-section files (just copy and paste into your own files, then chmod +x hitxsc.sh etc.

First define a generic script hitxsc.sh to run hitxsc with input and output files specified by two arguments

#! /bin/sh
cat <<EOF>> inphitxsc_$$
$1
$2
EOF

hitxsc < inphitxsc_$$

rm inphitxsc_$$

exit 0

Second define a script, eg HITXSC.sh just containing all the individual calls to hitxsc.sh with the required input/output filenames

hitxsc.sh ClONO2_IR04.xsc clono2.xsc
hitxsc.sh N2O5_IR04.xsc n2o5.xsc
hitxsc.sh SF6_IR00.xsc sf6.xsc
hitxsc.sh CCl4_IR00.xsc ccl4.xsc
hitxsc.sh HNO4_IR04.xsc hno4.xsc
hitxsc.sh SF5CF3_IR04.xsc sf5cf3.xsc
hitxsc.sh BrONO2_IR12.xsc brono2.xsc
hitxsc.sh ClOOCl_IR12.xsc cloocl.xsc

hitxsc.sh CFC-11_IR00.xsc f11.xsc
hitxsc.sh CFC-12_IR00.xsc f12.xsc
hitxsc.sh CFC-113_IR00.xsc f113.xsc
hitxsc.sh CFC-114_IR00.xsc f114.xsc
hitxsc.sh CFC-115_IR00.xsc f115.xsc
hitxsc.sh C2F6_IR01.xsc f116.sh
hitxsc.sh CFC-13_IR01.xsc f13.xsc
hitxsc.sh CFC-14_IR01.xsc f14.xsc

hitxsc.sh HCFC-21_IR00.xsc f21.xsc
hitxsc.sh HCFC-22_IR01.xsc f22.xsc
hitxsc.sh HCFC-123_IR00.xsc f123.xsc
hitxsc.sh HCFC-124_IR00.xsc f124.xsc
hitxsc.sh HCFC-141b_IR11.xsc f141b.xsc
hitxsc.sh HCFC-142b_IR11.xsc f142b.xsc
hitxsc.sh HCFC-225ca_IR00.xsc f225ca.xsc
hitxsc.sh HCFC-225cb_IR00.xsc f225cb.xsc

hitxsc.sh HFC-125_fix.xsc f125.xsc
hitxsc.sh HFC-32_IR00.xsc f32.xsc
hitxsc.sh HFC-134_IR00.xsc f134.xsc
hitxsc.sh HFC-134a_IR00.xsc f134a.xsc
hitxsc.sh HFC-143a_IR00.xsc f143a.xsc
hitxsc.sh HFC-152a_IR00.xsc f152a.xsc

hitxsc.sh CH3OH_IR12.xsc ch3oh.xsc
hitxsc.sh CH3CN_IR12.xsc ch3cn.xsc
hitxsc.sh CH3CHO_IR11.xsc ch3cho.xsc
hitxsc.sh CH3COCH3_IR11.xsc acetone.xsc
hitxsc.sh PAN_IR11.xsc pan.xsc

hitxsc.sh C2H6_IR10.xsc c2h6.xsc
hitxsc.sh C3H8_IR10.xsc c3h8.xsc
hitxsc.sh C6H6_IR08.xsc c6h6.xsc
This would all be expected to take 10-20 minutes to run (some of these are large files).

Version History

v1.20 (24OCT13)
Allow for GEISA and UV molecules. Also check for records containing just "<CR>" character
v1.10 (20SEP13)
Bug fix: don't write RFM headers for excluded data
v1.00 (15AUG13)
Original code (much simplified from earlier versions of this program)