Incorrect variable names in indexed namelists silently ignored

Issue #102 resolved
David Dickinson created an issue

Usually when reading a namelist from a file fortran will abort the run if it encounters an unknown variable name. This is generally helpful as it alerts the user to their error and ensures we don’t run with a different configuration than anticipated.

It seems this does not work as expected for our “indexed” namelists (e.g. species_parameters_1) and we end up effectively just ignoring this. The reason this gets ignored is that we ask for the iostat when reading an indexed namelist – this says that we’re going to check the error code and decide the appropriate action, rather than asking the fortran runtime to handle it. We then just use iostat to set our exists variable – in other words we assume that if there is any error reading the namelist then it just means it didn’t exist.

The exact behaviour of indexed namelists varies between master and next.

Given the change to input handling between master and next and the fact that we’d like to get 8.1 out in the near future I’d propose we consider only fixing this in next.

Comments (4)

  1. Log in to comment