RFM v5 Bugs

This is a list of bugs detected for RFM v5.0.

Report any bugs to anu.dudhia@physics.ox.ac.uk

Bug-Finder Hall of Fame (excluding myself since I have an unfair advantage)

  1. Li Xiaoying (RADI, China) (9)
  2. Zongxm (IAP, China) (6)
  3. David Moore (U.Leicester) (3)
  4. Alice Simmonds (AOPP, Oxford) (1)
  5. Jonathan Mitchell (UCLA) (1)
  6. Monica Flores (GWU) (1)
  7. Stefan Uttenthaler (U.Vienna) (1)
  8. Benjamin Esse (U.Manchester) (1)
  9. Alyn Lambert (JPL) (1)
  10. Robin Lacey (U.Bristol) (1)
  11. Olivier Auriacombe (RAL) (1)
  12. Lucy Ventress (AOPP, Oxford) (1)
Where the bug can be corrected by simply downloading a modified subroutine (or subroutines) and recompiling, the necessary modules are listed as Patch.

#44 Reported: 8FEB24 (Alice Simmonds, AOPP, Oxford)
Affects: v5.00–v5.20
Symptom: Zero output spectra, or fail with error message:
F-ATMAUX: Setting DSHATM large
(and probably some other unpredictable results as well)
Cause: When an input profile from an .atm contains a "NaN" value these are simply read in as normal with Fortran and it is not until the values are accessed that various errors can occur. The input was not being checked.
Patch: nxtprf_sub.f90
Fix: RFM v5.21
 

#43 Reported: 17DEC23 (Zongxm, IAP, China)
Affects: v5.03–v5.20
Symptom: Crashes with Fortran runtime error eg (gfortran)
At line 58 of file reacyc_sub.f90
Fortran runtime error: Index '0' of dimension 1 of array 'cyc' below lower bound of 1
Cause: Where an output spectral interval (set in *SPC section) starts close to the upper boundary of a 1 cm-1 widemesh interval, eg 700.999, the program rounds to the nearest multiple of the output grid which may mean no output grid points are located within the first widemesh interval. The code then also skipped the initialisation of the cyclic buffer (CYC structure) storing HITRAN line data which should have set the first index to 1. Now fixed so that initialised on first call rather than first widemesh interval.
Patch: rfmspc_sub.f90, spcfin_sub.f90
Fix: RFM v5.21
 

#42 Reported: 01NOV23 (Li Xiaoying, RADI, China)
Affects: v5.00–v5.20
Symptom: Surface Jacobians (SFCTEM or SFCEMS in *JAC section) combined with FOV convolution (FOV Flag) lead to failure with message
F-IDXPTH: Logical error
Cause: [This probably only makes any sense to me, but ...] With the FOV convolution, the RFM adds new 'tangent paths' and flags the nominal path for no explicit calculation (just used for storing the result when applying the FOV convolution). Adding surface Jacobians also creates new 'tangent paths', holding the result of the original paths with the pertubed surface parameter. However, this was also duplicating the nominal path, and flagging it for an explicit calculation, which led to indexing problems.
Patch: jacpth_sub.f90
Fix: RFM v5.21
 

#41 Reported: 24AUG23
Affects: v5.00–v5.20
Symptom: Occasionally fails with error message eg
Attempt to fetch from allocatable variable EXTATM when it is not allocated
if using 'aerosol' as an absorber.
Cause: Array EXTATM which holds aerosol extinction profile was not explicitly initialised, but simply set equal to another array of the required size. Mostly this seems acceptable since Fortran2003 but, sometimes, apparently not (it's hard to reproduce). Anyway, it is now explicitly initialised.
Patch: atmini_sub.f90
Fix: RFM v5.21
 

#40 Reported: 27JUN23
Affects: v5.00–v5.20
Symptom: Fails with error message eg
F-CHKABS: No spectroscopic data for he for spectral range
if using absorbers with spectroscopic data only specified only in .cia files (ie Collision Induced Absorption cross-sections).
Cause: Routine chkabs.for which checks that a source of spectroscopic data has been identified for all absorbers fails to check .cia files as a possible source.
Patch: chkabs_sub.f90
Fix: RFM v5.21
 

#39 Reported: 19MAY23
Affects: v5.00–v5.20
Symptom: Program can hang or crash if used with LUTs (LUT flag) but without any HITRAN line data files specified in the *HIT section.
Cause: Program may decide that LUTs cover all required data (so HITRAN file not required) but then subsequently assumes that a HITRAN file has always been opened and attempts to access it.
Patch: inihfl_sub.f90
Fix: RFM v5.21
 

#38 Reported: 10MAR23
Affects: v5.00–v5.12
Symptom: With ZEN flag and SFC flag, RFM stops with message
STOP F-IDXPTH: Logical error
Or, depending on how you compiled it, may fail with an array-bound error.
Cause: Zenith-viewing option didn't allow for surface level being changed, so radiative transfer part of calculation always included lowest atmospheric level.
Patch: sfclev_sub.f90
Fix: RFM v5.21
 

#37 Reported: 13JAN23
Affects: v5.00–v5.12
Symptom: With ILS flag and GRD flag, RFM stops with message
'F-ILSGRD: Logical error#5
Cause: Code is intended to anticipate array-bound error on next cycle of DO loop and stop, however if this condition occurs on the last cycle then it should be OK, so loop should be left to finish.
Patch: ilsgrd_sub.f90
Fix: RFM v5.13
 

#36 Reported: 23MAY22 (Stefan Uttenthaler, U.Vienna)
Affects: v5.03–v5.12
Symptom: With OBS flag RFM simply exits with error message if unrecognised keyword used in *OBS section of driver file.
Cause: RFM subroutine DRVOBS exits (correctly) with fatal error flag if it encounters an unrecognised keyword, but doesn't provide any accompanying error message.
Patch: drvobs_sub.f90
Fix: RFM v5.13
 

#35 Reported: 22APR22 (Benjamin Esse, U.Manchester)
Affects: v5.03–v5.12
Symptom: Incorrect path scaling in .pth file output (PTH Flag) with plane parallel or homogeneous path cases
Cause: RFM v5.03 was changed to have path scale factors moved into a separate variable, which wasn't transferred through to the .pth file output
Patch: pthwrt_sub.f90
Fix: RFM v5.13
 

#34 Reported: 18APR22
Affects: v5.00–v5.12
Symptom: Array bound error in ILSGRD when combining AVG (or ILS) flag with Look-Up Table on an irregular grid
Cause: Possible for points contributing to convolved output to all lie beyond upper limit of irregular grid.
Patch: [none]
Fix: RFM v5.13
 

#33 Reported: 18APR22
Affects: v5.00–v5.12
Symptom: Array bound error in IDXLFL when combining REX and LUT flags
Cause: Rayleigh extinction adds 'air' as an extra absorber, but this is after the driver section reading the LUTs assigns an error which depends on the number of absorbers, so a subsequent function IDXLFL attempts to access non-existent array element.
Patch: None — several changes required
Fix: RFM v5.13
 

#32 Reported: 28MAR22 (Li Xiaoying, RADI, China)
Affects: v5.00–v5.12
Symptom: Occasional incorrect spectra in limb-viewing mode combined with (FOV flag)
Reason: Probably due to questionably usage of a Fortran pointer array while the target array is re-sized.
Patch: chkfov_sub.f90
Fix: RFM v5.13
 

#31 Reported: 04MAR22 (Alyn Lambert, JPL, USA)
Affects: v5.00–v5.12
Symptom: Incorrect Cooling Rate spectra (COO flag) when calculated in combination with AVG or (less plausibly) ILS flags
Reason: Spectral averaging module omits Cooling rate spectra
Patch: spcils_sub.f90
Fix: RFM v5.13
 

#30 Reported: 23APR21 (Li Xiaoying, RADI, China)
Affects: v5.00–v5.10
Symptom: Combination of NAD and OBS flags has no atmospheric contribution
Reason: Bug in setting vertical start and end levels for radiative transfer integration.
Patch: obschk_sub.f90
Fix: RFM v5.11
 

#29 Reported: 23APR21 (Li Xiaoying, RADI, China)
Affects: v5.00–v5.10
Symptom: Incorrect results for limb-viewing calculation with very thin sub-layer, most likely to occur in near-vertical viewing.
Reason: Each atmospheric layer is split into sub-layers for the ray-tracing and calculation of Curtis-Godson integrals. Occasionally this can lead to a very thin sub-layer (< 1 metre path length) in which case code switches to use a different expression. A bug meant that this thin layer was then assigned the same absorber amount as a 1 km path.
Patch: raysum_sub.f90
Fix: RFM v5.11
 
#28 Reported: 29MAR21 (Robin Lacey, U.Bristol)
Affects: v5.00–v5.10
Symptom: Unpredictable or NaN results if surface level is redefined (eg using parameter HGTSFC in *SFC section) to match an existing profile level
Reason: Code always inserting extra level, which in this case results in a profile layer of zero thickness.
Patch: sfclev_sub.f90
Fix: RFM v5.11
 
#27 Reported: 25MAR21
Affects: v5.00–v5.10
Symptom: Attempting to define 2D calculation (GRA Flag) on pressure grid rather than altitude grid results in error message
STOP F-PRFGRA: Logical error
Reason: Code doesn't expect horizontal variation in altitude profile.
Patch: atmgrd_sub.f90
Fix: RFM v5.11
 
#26 Reported: 06MAR20 (David Moore, U.Leicester)
Affects: v5.00–v5.03
Symptom: When three (or more) user-defined .xsc molecule names are used (i.e. in addition the the standard internal list) RFM fails with runtime error caused by attempting to allocate an already-allocated array MOLNEW.
Reason: Bug in code checking allocation status of MOLNEW.
Patch: molidx_sub.f90
Fix: RFM v5.03, RFM v5.10
 
#25 Reported: 19FEB20 (Li Xiaoying, RADI, China)
Affects: v5.00–v5.03
Symptom: With a combination of TRA and FOV flags the RFM produces transmittance spectra which are 1 + correct value (ie transmittance values in the range 1–2)
Reason: Transmittance spectra are routinely initialised to a value 1. However when performing the FOV convolution the transmittance should have been set to zero before summing the weighted transmittances of the various pencil beam transmittances representing the FOV.
Patch: spcfov_sub.f90
Fix: RFM v5.03, RFM v5.10
 
#24Reported: 18FEB20
Affects: v5.00–v5.03
Symptom: Using .xsc files, RFM may fail with message
STOP 'F-TRIANG: logical error#1'
Reason: Under very peculiar circumstances (eg just three p,T tabulations all with same T values, in a particular order) the perimeter-finding part of the triangulation only finds 2 perimeter points.
Patch: triang_sub.f90
Fix: RFM v5.03, RFM v5.10
 
#23 Reported: 20SEP19
Affects: v5.00–v5.03
Symptom: Incorrect Aerosol Jacobian spectra
Reason: Aerosol perturbed by 1% (as with VMRs) rather than fixed Δextinction
Patch: ptbatm_sub.f90
Fix: RFM v5.03
 
#22 Reported: 01JUL19
Affects: v5.00–v5.02
Symptom: RFM fails to interpret 'hdo' and 'ch3d' in the *GAS section of the driver table.
Reason: Error in internal translation of, eg 'hdo' to 'h2o(4)'.
Patch: chkgas_sub.f90, gaschk_sub.f90
Fix: RFM v5.03
 
#21Reported: 06JUN19 (David Moore, U.Leicester)
Affects: v5.00–v5.02
Symptom: Using irregular grid (*GRD) with convolved output (*ILS) can create distorted output spectra, with 'flat' second part.
Reason: Where the .grd file is on a different basic resolution to the RFM internal grid, e.g. 0.001 cm-1 for the nadir-viewing IASI compared with the 0.0005 cm-1 RFM default fine grid, the irregular grid points were treated as if they were on the 0.0005 fine grid. The code has now been amended so that in this situation the RFM fine grid is adjusted (with a warning to the log file) to match the irreg.grd.
Patch: spcful_sub.f90
Fix: RFM v5.03
 
#20 Reported: 04APR19
Affects: v5.00–v5.02
Symptom: Using horizontal gradients (GRA flag), surface-grazing rays, coupled with FOV convolution) lead to fatal error message, e.g.
F-CHKLIM: Tangent Height=1.50 [km] >= Top of Atmosphere=0.00E+00 [km]
Reason: 2D ray-tracing module raygra_sub.f90 treating any ray starting at surface as intersecting surface, even though already established as a true limb path. This also has the secondary effect of resetting the height of the atmosphere to surface altitude.
Patch: raygra_sub.f90
Fix: RFM v5.03
 
#19 Reported: 28MAR19
Affects: v5.00–v5.02
Symptom: Using Look-up tables (LUT flag) up to their wavenumber boundaries, coupled with any spectral convolution ILS or AVG flags) causes a fatal error in the REALUT subroutine e.g.,
F-REALUT: Input failure on TAB file. IOSTAT= 5001
(or, with IFORT, may just cause the program to hang indefinitely)
Reason: LUTs are only accepted if they lie entirely within the chosen output spectral range, defined in the *SPC section. However, if any spectral convolution is applied, this caused the RFM to try and read beyond the end of the LUT file rather than simply assume zero absorption.
Patch: lutcom_dat.f90, luttab_sub.f90, realut_sub.f90
Fix: RFM v5.03
 
#18 Reported: 12MAR19
Affects: v5.00–v5.02
Symptom: Using *PHY section to adjust GRAVTY or WGTAIR not having the desired effect
Reason: Profiles of density and refractivity are established (using GRAVTY and WGTAIR) immediately after the *ATM section contents are read (using subroutine atmaux_sub.f90) and not subsequently recalculated when these parameters are modified by the later *PHY section.
Patch: drvphy_sub.f90
Fix: RFM v5.03
 
#17 Reported: 27FEB19 (Zongxm, IAP, China)
Affects: v5.00–v5.02
Symptom: Fatal array bound error in subroutine spcgrd_sub when using sparse irregular output spectral grid.
Reason: For an irregular output grid, for each widemesh (1cm-1) interval the RFM determines the lower and upper spectral grid points within the interval. However, for a sparse grid, it is possible that there are no points within the interval, so the interval should be skipped. The RFM did not allow for this.
Patch: rfmspc_sub.f90, spcgrd_sub.f90,
Fix: RFM v5.03
 
#16 Reported: 06FEB19 (Zongxm, IAP, China)
Affects: v5.00, v5.01 and v5.02 pre-release versions up to 04FEB19
Symptom: Anomalous results using cross-section molecules (eg CFC-12)
Reason: The RFM uses triangulation in the (p,T) domain to perform the interpolation of .xsc data to path conditions. However there was an error in limiting the number of triangles created, so that the interpolation was unreliable (the difference only really shows up in calculation Jacobian spectra).
Patch: xsccom_dat.f90, reaxsc_sub.f90, triang_sub.f90, triint_sub.f90, spcxsc_sub.f90
Fix: RFM v5.03
 
#15 Reported: 30JAN19 (Zongxm, IAP, China)
Affects: v5.02 pre-release versions from 02NOV18
Symptom: Unpredictable results using H2O continuum
Reason: Implementation of new MT_CKD v3.2 subroutine leads to incorrect indexing of internal path segments
Patch: ctmh2o_sub.f90
Fix: RFM v5.02
 
#14 Reported: 30JAN19 (Zongxm, IAP, China)
Affects: v5.00, v5.01, v5.02 pre-release versions
Symptom: Creating (incorrect) 'off-diagonal' Jacobian spectral files even when JTP Flag enabled.
Reason: Output routine continues to assume all Jacobian combinations are used
Patch: spcout_sub.f90
Fix: RFM v5.02
 
#13 Reported: 13JAN19 (Zongxm, IAP, China)
Affects: v5.00, v5.01
Symptom: Fatal error indexing array in intrinsic MATMUL function if using LOS Flag with 3 or more tangent heights.
Reason: Error assigning array indices to highest/lowest tangent heights when determining gradients from quadratic fit.
Patch: spclos_sub.f90
Fix: RFM v5.02
 
#12 Reported: 30NOV18
Affects: v5.00, v5.01
Symptom: RFM produces irregular-style output (ie two column format) when combining irregular grid (GRD Flag) with convolution (ILS or AVG Flags).
Reason: Internal spectral grid flagged as irregular for calculations but, after convolution, should then have been reset to regular before output.
Patch: spcils_sub.f90
Fix: RFM v5.02
 
#11 Reported: 21NOV18
Affects: v5.00, v5.01
Symptom: Error reading .grd irregular grid file when using combination of GRD and ILS flags AND the *GRD section is specified before the *ILS section in the driver table.
Reason: Until the width of the ILS function is known, the RFM assumes a ±1 cm-1 margin for the ILS convolution when test-loading the irregular grid data. However if the actual grid data is smaller than this, it attempts to read beyond the end of the irregular grid file.
Patch: reagrd_sub.f90
Fix: RFM v5.02
 
#10 Reported: 12OCT18
Affects: v5.00, v5.01
Symptom: Overflow characters in output filenames where viewing geometry information should be inserted, eg
rad_*****.asc
Reason: Mismatch between 5 character format field and 6 characters required to hold negative numbers, eg elevation angle -80.0, which becomes '-80000'
Patch: hgtstr_fnc.f90
Fix: RFM v5.02
 
#9 Reported: 28JUN18 (Olivier Auriacombe, RAL)
Affects: v5.00, v5.01
Symptom: Fatal error message
F-ATMPRF: Atmospheric profile levels not yet established
If using HOM flag in combination with atmospheric parameters in *ATM specified by PARAM=VALUE pairs rather than by .atm files.
Reason: Code branch for PARAM=VALUE inputs missed the profile initialisation step used for the file inputs. Now added
Patch: atmpar_sub.f90, atmcom_dat.f90
Fix: RFM v5.02
 
#8 Reported: 23MAY18 (Lucy Ventress, AOPP, Oxford)
Affects: v5.00
Symptom: Fatal error message
F-SHPGAS: Two different line shapes specified for gas= co2
If using MIX flag in combination with CHI shape specified for CO2 in *SHP section (although OK if CHI shape specified by CHI flag, which is the simpler/recommended method)
Reason: Code for handling different lineshapes assumes CO2 lineshapes already specified by MIX (line-mixing) flag so regards Chi-factor as a conflict. In fact the Chi-shape can be used with or without line-mixing.
Patch: shpgas_sub.f90
Fix: RFM v5.01
 
#7 Reported: 23MAY18 (Li Xiaoying, RADI, China)
Affects: v5.00
Symptom: Array bound error if using FOV + JAC flag, and tangent paths above the perturbed region
Reason: Coding error in handling assignment of tangent rays with FOV and Jacobian combination.
Patch: None - Requires a bit of a rewrite of several modules.
Fix: RFM v5.01
 
#6 Reported: 05MAY18
Affects: v5.00
Symptom: Array bound error if using spectral upper range 980cm-1 with O3 as an absorber
Reason: There is an ozone line in HITRAN2012 (and 2016) at exactly 1006cm-1 which the RFM attempts to include within the ±25cm-1 range of the upper limit of 980cm-1 (which means any line within the 1005–1006cm-1 interval) , which causes the array bound error. Subroutine SPCWID now altered so that any line exactly at the upper limit is not included in the interval.
Patch: spcwid_sub.f90
Fix: RFM v5.01
 
#5 Reported: 04MAY18 (Li Xiaoying, RADI, China)
Affects: v5.00
Symptom: Array bound error reading HITRAN .par file directly (as opposed to reading converted binary version)
Reason: HITRAN uses '0' in the isotope field to indicated isotope#10, but the subroutine REAPAR was reading this as 0, which then translates to an invalid array element in the list of isotopic weights.
Patch: reapar_sub.f90
Fix: RFM v5.01
 
#4Reported: 04MAY18 (Li Xiaoying, RADI, China)
Affects: v5.00
Symptom: Error with FOV flag if the RFM is compiled with
ifort -traceback -check all
Reason: The function FOVFIL reads in the FOV altitudes directly into part of a structure (=derived data type) FOV%ALT. I assume this is not strictly allowed, and reading the data into a local array first seems to fix the problem (no other compilers, switches seem to register this as problematic). I assume there will be other similar occurrences elsewhere in the code if this particular compilation option is used ...
Patch: fovfil_sub.f90
Fix: RFM v5.01
 
#3 Reported: 03MAY18 (Li Xiaoying, RADI, China)
Affects: v5.00
Symptom: Either crashes or multiple warnings in log file when running with HITRAN2016 data.
Reason: The function VALISO tries issue warning of an unrecognised isotope but local array noting previous warnings (to avoid repetition) was not SAVEd between calls. (This also highlights an additional problem that the RFM is not yet up-to-date with all the new molecules & isotopologues introduced with HITRAN 2016)
Patch: valiso_fnc.f90
Fix: RFM v5.01
 
#2 Reported: 02MAY18
Affects: v5.00
Symptom: Incorrect calculation for plane-parallel atmospheres (NAD or ZEN flag) with viewing direction specified by elevation angle *ELE section)
Reason: The subroutine VRTPTH assumed all scaling for plane-parallel atmospheres was using sec(zenith) (*SEC section)
Patch: vrtpth_sub.f90
Fix: RFM v5.01
 
#1 Reported: 02MAY18
Affects: v5.00
Symptom: Array bound errors when calculating more than one spectral range with FOV flag
Reason: The subroutine SPCFOV, which performs the FOV convolution, re-sizes the data structures used to contain tangent paths required to store FOV paths so they cannot be reused for subsequent spectral ranges
Patch: jacpth_sub.f90, jacfov_sub.f90, spcfov_sub.f90
(jacfov_sub.f90 is a new module so you will need to compile it first before running the v5.00 makefile)
Fix: RFM v5.01