handleInc_ procedure is not being trapped on error

Open
#812 0 comments 0 reactions 2 assignees View on GitHub

@sdrabenh is already working on this.

Since Aug 30, 2023.

Assessment

This issue has not been assessed yet.

Description

bug

While chasing a replay issue for a user, I was running an ERA5 replay and forgot to add

REPLAY_O3: NO

as did the user. The ERA5 files do not have an O3 analysis. This causes the handleInc_ procedure to throw an error.
The particular code is this:

        if( .not.FOUND .and. L_REPLAY_O3 ) then
           write(STRING,'(A)') "ANA Variable: O3 Not Found!"
           call WRITE_PARALLEL( trim(STRING)   )
           RETURN_(ESMF_FAILURE)
        endif

but if one looks when handleInc_ is called the return code is not checked, making any sort of error handling like this pointless. The error code should be check so the code dies if the user is trying to replay a variable that does not exist in the file. By returning early from handleInc_ clearly a lot of code in handleInc_ is skipped but we run along.

Dominant language
Fortran
Stars
10
Forks
13
Avg merge
17h 35m
Merged PRs (30d)
14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GEOS-ESM/GEOSgcm_GridComp

All issues in GEOS-ESM/GEOSgcm_GridComp

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.