RFM Installation

29AUG17

System Requirements

It should be possible to install the RFM on any machine with a Fortran compiler, although the examples here are restricted to Unix/Linux systems.

The RFM v4.3 is written in FORTRAN77 but does include a few non-standard, although commonly accepted, extensions such as INCLUDE, IMPLICIT NONE, DO WHILE, ENDDO. Later Fortran languages/compilers all included F77 as a subset, so really any fortran compiler should work.

The memory requirement is largely dependent on the array sizes required. See RFM Memory Size for details.

RFM v5.0 is written in FORTRAN95 and any generic Fortran compiler should work (gfortran, ifort). Since it uses the dynamic array allocation available in F90/F95, the memory requirements are set during run time.

Unpacking the RFM tar file

The source code is distributed as a compressed (with gzip) tar file. To unpack the code, place the tar file (eg named rfm_v4.36.tar.gz) into an empty directory and type
tar -xzf rfm_v4.36.tar.gz
For RFM v4.3 this will expand to produce a single program module (rfm.for) plus about 340 subroutines (*.for) and include files (*.inc).

For RFM v5.0 this expands to produce a single program module (rfm.f90) plus around 340 *.f90 files containing either subroutines or data modules, plus one makefile.

Compiling the F77 RFM (v4.3)

In most situations, all that is then needed to compile the RFM is to change to the directory containing the source code and then type

f77 *.for -o rfm
(or g77, gfortran, ifort ..., whichever command invokes your local Fortran compiler)
This will create an executable called rfm

If you have the ifort compiler, the following switch should give improved performance

ifort -O3 -o rfm *.for

ifort also has optimizations for specific CPU types - see /proc/cpuinfo to determine which could apply.

11FEB09: Martin Kaufmann (FZ Juelich) has investigated using RFM v4.25 with different compilers: [Report]

Compiling the F90 RFM (v5)

The F90 compilation is a bit more complicated than F77 since it requires the creation of intermediate *.mod files (basically containing information on interfaces between different modules) and so requires compiling in a particular order to ensure that the *.mod files of eg called subroutines exist.

You could just use the sledge-hammer approach (and I have a certain sympathy with that) and just repeatedly type something like

gfortran *.f90 -o rfm
which will initially create a large number of warnings about missing modules but, after about 8 or 9 goes, will eventually be satisfied that everything is in order and create an executable called rfm

A more sophisticated approach is to use the makefile provided in the delivery and just type

make

However the provided makefile uses a specific compiler (gfortran) and compilation switches (-fbounds-check -Wall), and you'll probably have your own preferences, in which case edit the relevant lines in the makefile

# 'makefile' for RFM created by IDL program make.pro
# To create/update RFM executable: just type 'make'
# To clean up (by deleting all .o,.mod files): type 'make clean'

# Edit next 2 lines to change compiler and options
F90 = gfortran
FLAGS = -fbounds-check -Wall

# change anything beyond this point and you're on your own!
...
The IDL program used to generate the makefile relies on a very specific code structure within each module so is unlikely to be of much use to anyone else, but if you're interested it's:
make.pro

Making Local Modifications

There is a CHARACTER*11 field VERSN (set as the first executable statement in the main program module rfm.for) (C*11 VIDHDR in rfm.f90) which is written as part of the
output file headers. To allow traceability between spectra generated by different versions of the RFM code, any local modifications to the RFM code should be reflected in this field. E.g., to represent a local Oxford modification 13 to the standard version '4.35', a suggested change is:
VERSN = '4.35_OXF_13'

RECLEN

There is a single compiler-dependent part of the source code which is the RECL parameter in the FORTRAN OPEN statement required when opening the (direct access) HITRAN binary file. This will either be 22 or 88 depending on whether the compiler defines RECL as 4-byte words, or just bytes. For most standard FORTRAN compilers 88 is required, but the ifort compiler requires 22.

From RFM v4.3 onwards, the program will test this itself, starting with the value defined in file reclen.inc and, if that fails, trying the alternative. See the rfm.runlog file for which it ended up using. Unless you regularly switch compilers, it will be more efficient to set reclen.inc to use this value to start with.

RFM v5.0 avoids the problem by utilising the F90 extension of the INQUIRE function (in opnhit.f90) to determine the required record length.

Queries & Bug Reports

A list of all reported bugs (and fixes) is maintained on www.atm.ox.ac.uk/RFM/rfm_bugs.html, and the descriptions of each Driver Table Section and Flag also include any related bugs.

Any queries or reports on possible new bugs should be addressed to:

A.Dudhia
AOPP, Clarendon Laboratory
Parks Rd, Oxford OX1 3PU
England
email: anu.dudhia@physics.ox.ac.uk