MAKXSC

Latest: MAKXSC v2.00 (19JUN19) [Fortran], v15MAY24 [Python]
24SEP24
Contents

Introduction

MAKXSC is a Fortran90/Python program to convert user-supplied cross-section data into HITRAN .xsc format (as described in Table 1 of the
2004 HITRAN paper), and [here]

This assumes that the user supplies a free-format file consisting of just a set of numbers representing the absorption cross-section values [cm2/molec] on a regularly spaced wavenumber grid. Other inputs are via the terminal.

For the RFM, this can also be used to format aerosol extinction data [km-1] as an .xsc file.

Installing MAKXSC

Fortran version
Download the source code: [makxsc.f90]

Compile with any Fortran compiler, eg

gfortran makxsc.f90 -o makxsc
which will create the executable makxsc.

Python version
Download the source code: [makxsc.py]

Running MAKXSC

To run the Fortran program, type makxsc and respond to the prompts. (For python just run as you would any self-contained python program depending on your local set-up, eg python3 makxsc.py)

A typical run might be (user responses, <CR> indicates Return/Enter key)

makxsc R-MAKXSC: running MAKXSC v2.00 Input file: aerosol.dat [1] Molecule: aerosol Npts, Wno1, Wno2: 50 800 849 [2] T[K], p[Torr]: (<CR>=296.0, 760.0): 290 700 [3] Output file: aerosol.xsc I-MAKXSC: Data resolution= 1.00000000 [cm-1] STOP R-MAKXSC: Successful completion
The program run almost instantaneously.

Notes

  1. The user supplies data as a file containing just a set of numbers representing the absorption coefficient on a uniform spectral grid (see Example below). The data are read 'free-format' so comma and/or space separated values.

  2. The user supplies the number of points in the input file (50), together with the lower (800) and upper (849) wavenumbers of the data. The spectral grid spacing inferred from these values is printed out when the file is created (line I-MAXXSC ... )

  3. Temperature (290) and pressure (700) info are inserted into the file header. Conventionally, pressure is expressed in Torr (760 Torr = 1000 hPa). By default, the program assumes STP values.
Note that there are a couple of additional fields in the .xsc file header which are set to fixed values by this program: the broadener is always set as 'air' and the reference as '99' (it should be straightforward to edit the code to change these).

Also, apart from the C*20 molecule name, the header contains space for a C*15 'common name' of the molecule, but this program just duplicates the first 15 characters of the molecule name. (aerosol)

Example

In the above example, the input data (aerosol.dat) file was as follows
1.022250E-03, 1.118420E-03, 1.218010E-03, 1.320690E-03, 1.426060E-03, 1.533740E-03, 1.643300E-03, 1.754290E-03, 1.866240E-03, 1.978610E-03, 2.174860E-03, 2.361520E-03, 2.536850E-03, 2.698760E-03, 2.820530E-03, 2.844770E-03, 2.847410E-03, 2.868770E-03, 2.893790E-03, 2.918930E-03, 2.935980E-03, 2.969390E-03, 3.020240E-03, 3.021840E-03, 3.070630E-03, 3.096640E-03, 3.122300E-03, 3.167460E-03, 3.168840E-03, 3.214020E-03, 3.232010E-03, 3.257210E-03, 3.295740E-03, 3.318430E-03, 3.337480E-03, 3.366700E-03, 3.386880E-03, 3.401350E-03, 3.425640E-03, 3.387640E-03, 3.446710E-03, 3.463740E-03, 3.474780E-03, 3.477240E-03, 3.487030E-03, 3.489080E-03, 3.494730E-03, 9.298100E-04, 9.755510E-04, 2.796710E-03
and the program created the following output file (aerosol.xsc) (you might need to stretch your browser window until the 100-character records appear as single lines)
aerosol 800.0000 849.0000 50 290.00 700.0 3.495E-031.000 aerosol air 99 1.022E-03 1.118E-03 1.218E-03 1.321E-03 1.426E-03 1.534E-03 1.643E-03 1.754E-03 1.866E-03 1.979E-03 2.175E-03 2.362E-03 2.537E-03 2.699E-03 2.821E-03 2.845E-03 2.847E-03 2.869E-03 2.894E-03 2.919E-03 2.936E-03 2.969E-03 3.020E-03 3.022E-03 3.071E-03 3.097E-03 3.122E-03 3.167E-03 3.169E-03 3.214E-03 3.232E-03 3.257E-03 3.296E-03 3.318E-03 3.337E-03 3.367E-03 3.387E-03 3.401E-03 3.426E-03 3.388E-03 3.447E-03 3.464E-03 3.475E-03 3.477E-03 3.487E-03 3.489E-03 3.495E-03 9.298E-04 9.756E-04 2.797E-03

Version History

28SEP24
Python version (15MAY24) added
v2.00 (19JUN19)
Converted to F90 and simplified to create standard HITRAN format output.
v1.01 (05AUG15)
Change '$' in WRITE statements to avoid gfortran warnings
v1.00 (22JAN15)
Original code