MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
235 stars 312 forks source link

Improve error message in MPAS I/O layer #1116

Closed mgduda closed 11 months ago

mgduda commented 1 year ago

This PR modifies the mpas_io and mpas_io_streams modules to provide more helpful error messages in cases where errors occur in the PIO or SMIOL libraries. Prior to the changes in this PR, an error in the PIO or SMIOL library would generally result in the following less-than-helpful message in the MPAS log file:

MPAS IO Error: Bad return value from PIO

Now, for example, the error messages give further details about the nature of the error in PIO or SMIOL:

MPAS IO Error: PIO error -62: NetCDF: One or more variable sizes violate format constraints

Also included in this PR are changes to clean up several parts of the mpas_io module, for example, replacing the PIO-specific error code MPAS_IO_ERR_PIO with a more generic name (MPAS_IO_ERR_BACKEND) and adding code to properly set the error code in various places when the SMIOL library is used.

gdicker1 commented 11 months ago

I'm still looking through this PR, but just noticed that this is to the master branch. Is that correct?

mgduda commented 11 months ago

I'm still looking through this PR, but just noticed that this is to the master branch. Is that correct?

Good catch -- it should be a PR to the develop branch. I've just updated the PR.