ESCOMP / ESCOMP/CTSM

ncd_io should abort if variable not read, unless caller requests otherwise

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

**Bill Sacks < sacks@ucar.edu > - 2017-02-13 14:35:32 -0700**
**Bugzilla Id:** [2423](http://bugz.cgd.ucar.edu/show_bug.cgi?id=2423)
**Bugzilla CC:** andre@ucar.edu, rfisher@ucar.edu,

Motivated by bug 2422:

It seems fragile that ncd_io - as well as the restartvar routine that's built on top of it - returns a readvar flag that the caller is expected to check. Typically, I'd think that we want to abort if trying to read a variable if it isn't found, so this should be the default behavior.

Callers could then indicate that they want to continue despite the variable not being found, e.g., by:

(1) Providing an optional argument, allow_not_found - if present and true, then it's okay if the variable isn't found; this is indicated by the readvar argument

OR

(2) Making readvar an optional argument. If it's absent (which would be the typical case), then abort if the variable isn't found. If it's present, then use the current behavior of setting readvar rather than aborting if the variable isn't found.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.