diff --git a/CHANGELOG.md b/CHANGELOG.md index 693d11d1..c2ca4120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/GMAO_etc/pyrob b/GMAO_etc/pyrob index e1c69792..e8a6ae17 100755 --- a/GMAO_etc/pyrob +++ b/GMAO_etc/pyrob @@ -249,7 +249,7 @@ 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) @@ -257,6 +257,17 @@ class Writer(object): 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,", "") @@ -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",