Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Updated `pyrob` script for Forward Processing (`-F`) collection descriptions
- By default, the collection description is now taken from the `LongName` global
attribute of the netCDF file, with any leading `"GEOS FP "` prefix stripped
- Added `--no-longname` flag to revert to the legacy `Title`-based description
for older FP files that do not carry a useful `LongName` attribute
- The same `--no-longname` escape hatch applies to `--geosit` / `--m21c` runs

### Fixed

- Fix for Open MPI calls in `esma_mpirun` from Open MPI 5 testing
Expand Down
21 changes: 20 additions & 1 deletion GMAO_etc/pyrob
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,25 @@ class Writer(object):
else:
descr = "fix me, please"

if options.geosit:
if options.geosit and not options.no_longname:
if Coll.LongName is not None:
Descr = Coll.LongName.split()[4:]
descr = " ".join(Descr)
if "edge" in descr:
level = "Model-Level Edge"
descr = descr.title()

if options.fp and not options.no_longname:
if Coll.LongName is not None:
# Strip a leading "GEOS FP " prefix (case-insensitive) if present,
# then title-case the remainder for consistent formatting.
ln = Coll.LongName.strip()
for prefix in ("GEOS FP ", "GEOS-FP "):
if ln.lower().startswith(prefix.lower()):
ln = ln[len(prefix):]
break
descr = ln.title()

descr = (
descr.replace("Forecast,", "")
.replace("Assimilation,", "")
Expand Down Expand Up @@ -1235,6 +1246,14 @@ if __name__ == "__main__":
help="Assume Forward Processing file name conventions",
)

parser.add_option(
"--no-longname",
action="store_true",
dest="no_longname",
default=False,
help="Use legacy Title-based collection description instead of LongName global attribute (for older FP/GEOS-IT files)",
)

parser.add_option(
"-D",
"--dyamond",
Expand Down
Loading