Skip to content

Reading pre_process.inp fails with malformed file #51

@belericant

Description

@belericant

Describe the bug
Some malformed case.py will be processed into a malformed pre_process.inp file that will fail to be successfully read into the namelist by read in s_read_input_file(). An undescriptive error message and a stack trace are shown upon program abort.

To Reproduce
One example of a malformed file:

  1. Replace model_eqn in case.py with a non-numeric string
  2. Run mfc.sh run path-to-case-py -t pre_process

Expected behavior
A clear error message informing the user of the malformed pre_process.inp file.

Proposed Fix
Check iostat flag and print an useful error message before aborting. E.g.:

if (iostatus /= 0) then
    backspace(1)
    read(1, fmt='(A)') line
    print '(A)', 'Invalid line in pre_process.inp around: '//trim(line)
    print '(A)', 'Exiting ...'
    call s_mpi_abort()
end if

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions