RFM Error Handling

03OCT05

Error Handling

The RFM should trap all error conditions (apart from numerical overflows) and terminate with an error message printed to the terminal of the form
F-ABCDEF: .... 
where ABCDEF is the FORTRAN module in which the error occurred (i.e. file abcdef.for). These messages are also printed to the
rfm.runlog file (unless writing to the runlog file itself caused the error).

Common Errors

Usually, errors will be for one of 3 reasons:
  1. I/O Errors on input/output files
    The IOSTAT Status code will also be printed. This is the integer status variable associated with FORTRAN I/O operations. Unfortunately, the values are compiler-dependent (see for example
    GNU Fortran Run-Time Library Errors). Check the end of the rfm.runlog file to see the name of the file that the RFM was attempting to access.

  2. Driver Table errors
    due to incorrectly formatted Driver Table. These often (but not always) begin with F-INPXXX where XXX is the name of the Driver Table section. Check the end of the rfm.runlog file to find the last section being read. If it's an error associated with the last section in your driver table which, to you, looks to be perfectly OK the chances are it's because you've forgotten to insert a <CR> character after the following *END record (see Note 2).

  3. Array size errors
    where the declared array space (see Memory Size) is insufficient for the task. The appropriate array size parameter, with a name beginning MAX... can usually be found in the include file rfmsiz.inc. Once adjusted, the RFM has to be recompiled.
Most of these failures will occur before the Wide Mesh Calculation starts. The most likely exception is running out of diskspace, which may result in an I/O error at any point during the run.

Other Errors

  1. A problem sometimes encountered when first using the RFM is with reading the HITRAN binary file. This is usually because the RECLEN parameter is either incorrectly set for the RFM, or was incorrectly set for HITBIN when generating the binary file.

  2. With Linux, a problem may arise when reading ASCII files for the first time due to unreadable linefeed or carriage-return characters. These give IOSTAT=112 using the gnu "g77" compiler, or IOSTAT=173 using the Fujitsu "f95" compiler. These characters can be removed using
    perl -pe "s/\r//" infile.asc > outfile.asc
    
    (If you have it, the command dos2unix does the same thing)

  3. A possible run-time error that may arise is running out of cyclic buffer space.
    
    F-REACYC: Cyclic line buffer full (MAXCYC too small)
    
    MAXCYC, in rfmsiz.inc, dimensions arrays which store all the local HITRAN lines required for the finemesh calculation so the RFM cannot tell in advance how large this needs to be - for standard HITRAN a size MAXCYC=10000 seems adequate.

  4. It is also possible that the program terminates with an error message printed to the terminal of the form:
    F-ABCDEF: Logical Error
    
    These are logic checks within the code, eg checking for running off the end of a DO loop when it isn't supposed to happen. If you get one of those it means that there's a bug in the code, so please inform me (email: dudhia@atm.ox.ac.uk)