GEOS-ESM / MAPL

MAPL is a foundation layer of the GEOS architecture, whose original purpose is to supplement the Earth System Modeling Framework (ESMF)
https://geos-esm.github.io/MAPL/
Apache License 2.0
26 stars 17 forks source link

Create new error handling macro for ESMF calls with 2 error codes #1558

Open tclune opened 2 years ago

tclune commented 2 years ago

Several ESMF procedures return 2 (optional) error codes. One for ESMF internal and one for user code that is called within. Usually the former is rc and the latter is userRc. Currently MAPL uses a combination of two macros to check these cases, but it happens just often enough that a new macro that checks both would possibly be useful. The counter argument would be if we were to start returning different messages depending on which failed.

Suggested names for new macro are _VERIFY_ESMF or _VERIFY_USER.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days, it will be closed. You can add the "long term" tag to prevent the Stale bot from closing this issue.

mathomp4 commented 2 years ago

Obviously marking long-term.

Query for @tclune I'm guessing the VERIFY_ESMF_ we have in NUOPC_ErrLog.h is not the same as what this wants?

tclune commented 2 years ago

Correct. Though important to keep in mind these others exist already.

tclune commented 5 months ago

Turns out this macro already exists, but ... recent experience shows that it is important to check the ESMF RC code first. This is because certain failures will leave the user RC unassigned which leads to confusing results.

Not sure what the best solution is, but reversing the checks in this PR. (And exercising in MAPL3)