GEOS-ESM / GOCART

GOCART Aerosol model including process library and framework interfaces (MAPL, NUOPC, and CCPP)
Apache License 2.0
15 stars 14 forks source link

Fixes #202. Add * to Long Name for CA Gridded Component #205

Closed mathomp4 closed 1 year ago

mathomp4 commented 1 year ago

Closes #202

With MAPL 2.34 now in GEOSgcm main, I feel confident about making this PR. To wit, this PR uses the updated *-expansion in MAPL's ACG to expand out the Long Name in the State Specs much like it does in the short name. Note that this is a bit different than might be expected[^compname].

Note I also changed the Internal state *-variables here:

 *phobic | kg kg-1 | xyz  | C    | MAPL_RestartOptional | T          | DYNAMICS:TURBULENCE:MOIST | Carbonaceous Aerosol Mixing Ratio
 *philic | kg kg-1 | xyz  | C    | MAPL_RestartOptional | T          | DYNAMICS:TURBULENCE:MOIST | Carbonaceous Aerosol Mixing Ratio

to:

*phobic | kg kg-1 | xyz  | C    | MAPL_RestartOptional | T          | DYNAMICS:TURBULENCE:MOIST | * Hydrophobic Aerosol Mixing Ratio
*philic | kg kg-1 | xyz  | C    | MAPL_RestartOptional | T          | DYNAMICS:TURBULENCE:MOIST | * Hydrophilic Aerosol Mixing Ratio

because these are also added to Export (the T column). Thus, history output will have the right name. But because these are Internal state variables and changing could trigger a "non-zero-diff" in checkpoints. Now, It would only be the long_name attribute and not the actual data, but I wanted to be conservative.

I also took the time to update the components.yaml to match GEOSgcm main so it uses MAPL 2.34 as well.

[^compname]: In #202 (or rather the chain leading to it, see https://github.com/GEOS-ESM/MAPL/issues/1877), @amdasilva said:

image

For the short name the “*” is replaced with the name of the component, thus BCEXTTAU, BRCEXTTAU, etc. A similar device was supposed to have been implemented for the long name but apparently it has not. In this case, we should have something like this:

Which would expand to “BC Extinction AOT”, “BRC Extinction AOT”, etc… Expanding BC to “Black Carbon” cannot be easily done with the ACG without introducing cumbersome syntax. Having ncks perform attribute renaming at the script level may be easier to implement.

It turns out technically we cannot do this. When you use MAPL 2.34 with this PR, you get out:
```
BCEM001:long_name = "CA.bc Aerosol Emission (Bin 001)" ;
```
for, say, `BCEM001`. Note this does *NOT* say `"BC Aerosol Emission (Bin 001)"`. The reason is that this variable internally is `CA.bcEM001` and not `BCEM001` because the component is `CA.bc`; it's called `BCEM001` only because of aliasing in `HISTORY.rc`:
```
'CA.bcEM'        , 'CA.bc'     , 'BCEM001;BCEM002' ,
```
But, as far as the ACG is concerned, this is `CA.bc` and it has no way to know that someone renamed it in `HISTORY.rc`.

I believe GEOS will need a postprocessing step with something like `ncatted` to convert `CA.bc` to either `BC` or `Black Carbon`.
github-actions[bot] commented 1 year ago

Label error. Requires at least 1 of: 0 diff, 0 diff trivial, Non 0-diff, 0 diff structural, 0-diff trivial, Not 0-diff, 0-diff, automatic, 0-diff uncoupled. Found: