RFM Error Handling

19OCT17

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, or abcdef_sub.f90 for RFM v5). These messages are also printed to the
rfm.runlog (rfm.log for RFM v5) 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 (F-DRVXXX for RFM v5) 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 *END record (see Note 2).

  3. Array size errors (not applicable for RFM v5.0)
    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. 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)

  2. A possible run-time error that may arise is running out of cyclic buffer space (not applicable for RFM v5.0)
    
    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, although HITRAN 2012 requires larger values for microwave HNO3 and infrared COF2 (see
    RFM v4.3 Release Notes)

  3. 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: anu.dudhia@physics.ox.ac.uk)