Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- CI: added a `workflow_dispatch` trigger and a spack refs note to the GitHub Actions workflow (from `develop`, #496)
- Replaced the `gocart+seasalt+dust+sulfate`, `...+nitrate` and `...+nitrate+carbon-bc` GOCART2G regression cases with a single `gocart` case that runs the production children (DU, SS, SU, NI, CA_oc, CA_bc, CA_br).
- GOCART2G regression configurations no longer connect a data component's `internal` item directly to an import
(MAPL3 requires `export -> import`). Each connected item is now re-exported in the data component's own config
(`src_intent: internal`, `dst_intent: export`, `<self>` -> `<self>`), and the `root.yaml` connection is a plain export -> import.
Expand Down
62 changes: 48 additions & 14 deletions ESMF/GOCART2G_GridComp/CA2G_GridComp/mapl3-porting-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ since all three instances share one code path and only differ by
purely to keep those two cases' scope and published baselines unchanged;
CA coverage lives in `carbon-bc-sa` and in the
`gocart+seasalt+dust+sulfate+nitrate+carbon-bc` case below.
(Superseded: the combined cases were replaced by `gocart`; see step 10.)

### 9. `gocart+seasalt+dust+sulfate+nitrate+carbon-bc` combined-case harness

*Superseded by step 10: this case was removed in favour of `gocart`, and
the instance yamls are now named `CA2G_instance_CA_{oc,bc,br}.yaml`.*

Added (in a follow-up pass) a new combined-case directory,
`regression/gocart+seasalt+dust+sulfate+nitrate+carbon-bc/`, extending
`gocart+seasalt+dust+sulfate+nitrate` by activating all three CA instances
Expand Down Expand Up @@ -371,6 +375,40 @@ production `ACTIVE_INSTANCES: CA: [CA_oc, CA_bc, CA_br]` shape -- unlike
expdir with the restart reads disabled purely to exercise
SetServices/Initialize.

### 10. Combined cases replaced by a single `gocart` case (2026-11-16)

The three combined cases (`gocart+seasalt+dust+sulfate`, `...+nitrate`,
`...+nitrate+carbon-bc`) were replaced by one case, `regression/gocart/`,
which runs GOCART2G with the production set of children: DU, SS, SU, NI,
`CA_oc`, `CA_bc`, `CA_br` (`GOCART2G_GridComp.yaml`:
`CA: [CA_oc, CA_bc, CA_br]`). `CA2G_instance_CA_{oc,br}.yaml` were added
next to `CA2G_instance_CA_bc.yaml`, and `cmpchk.py`, `cases.txt` and
`regression/README.md` were updated.

Validated against MAPL2 captures (`~/input/gocart/C12L181/{before,after}`,
one MAPL2 run per captured gridcomp; `CA.xx` names renamed to `CA_xx`
before comparing). All seven children and `GOCART2G_export` match MAPL2 in
both phases, apart from all-NaN fields (see below). Two things had to be
right in the MAPL2 capture for GOCART2G's `run2` exports to match:

- `TOT{EXT,SCA}COEF{,RH20,RH80}` and `TOTBCKCOEF` are sums of the
children's `*COEF` exports. MAPL2 allocates a child export only if
something requests it, so the capture's `HISTORY.rc` must list the
children's `*EXTCOEF`, `*SCACOEF` and `*BCKCOEF` (with `RH20`/`RH80`);
otherwise MAPL2's totals are 0.
- `PM*` adds the nitrate term only if both `NISMASS` and `NH4SMASS` are
associated, so `HISTORY.rc` must also list `NH4SMASS`.

In `run1`, GOCART2G's `PM*`, `TOT*` and `PSO4*` exports are NaN in MAPL3:
GOCART2G `run1` only calls the children's Run1, and the totals are
computed in `run2`. MAPL2 shows the previous step's values there.

The staged data is in
`~/regression-data/.../GOCART2G_GridComp/gocart/run{1,2}`. Files that are
identical (under `nccmp`) to a standalone case's are relative symlinks to
it, e.g. the DU/SS/SU/NI/`CA_bc` internals; `copy_restarts` follows them
(`cmake -E copy_directory` dereferences symlinks).

## Run-testing update (manual `GEOS.x`, not yet `ctest -L REGRESSION`)

Build/run environment: `module load ifx-stack` (ifx/2025.3,
Expand Down Expand Up @@ -544,20 +582,16 @@ and not in the `ctest` runs.
## Open items (follow-ups, not blocking the code port)

1. **Publish regression baselines.** `carbon-bc-sa/run{1,2}` and
`gocart+seasalt+dust+sulfate+nitrate+carbon-bc/run{1,2}` are registered in
`regression/cases.txt` and verified by hand, but no baseline/restart
data exists for them under
`/ford1/share/gmao_SIteam/regression-data/.../GOCART2G_GridComp/`, so
`ctest -L REGRESSION` reports "skipping" for all four. Publishing the
baselines is what turns the manual verification above into real CI
coverage. (The `carbon-bc-sa` runs above used a partial baseline tree that
is present locally but not published.)
2. **CA left disabled in the two older combined cases.**
`gocart+seasalt+dust+sulfate` and `gocart+seasalt+dust+sulfate+nitrate`
still carry `CA: []`. This is now a deliberate scope/baseline-stability
choice, not a technical blocker: enabling CA there would invalidate
their published baselines. CA coverage lives in `carbon-bc-sa` and
`gocart+seasalt+dust+sulfate+nitrate+carbon-bc`.
`gocart/run{1,2}` are staged in `~/regression-data` and pass there
(step 10), but are not yet published to S3 or
`/ford1/share/gmao_SIteam/regression-data/.../GOCART2G_GridComp/`, which
is what `ctest` reads (`LOCAL_REGRESSION_DATA_DIR`). The old combined
cases' data in `~/regression-data` was removed (backup:
`~/regression-data-backups/gocart-combo-cases-2026-11-16/`); the
published copies should be removed along with publishing `gocart`.
2. ~~**CA left disabled in the two older combined cases.**~~ Resolved: those
cases were replaced by `gocart`, which runs all three CA instances
(step 10).
3. **Dead `SV` export**: `CA_bcSV` etc. are declared and bundled but never
assigned, in MAPL3 *and* MAPL2. Either compute it or remove it from
`CA2G_StateSpecs.rc`. See "Baseline comparison" above.
Expand Down
7 changes: 7 additions & 0 deletions ESMF/GOCART2G_GridComp/NI2G_GridComp/mapl3-porting-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ ungridded dimension -- see "structural difference" above):

## Run-testing update (ctest -L REGRESSION)

*Update (2026-11-16): the `gocart+seasalt+dust+sulfate+nitrate` case below
was replaced by `regression/gocart/` (all GOCART2G children, NI included),
which matches MAPL2 in both phases with data staged in `~/regression-data`.
See `../CA2G_GridComp/mapl3-porting-notes.md`, step 10. The capture's
`HISTORY.rc` must request `NH4SMASS`, or MAPL2's `PM*` lack the nitrate
term.*

Picked up the "next step" from open item 1 below: built GOCART2G
(`DU2G`/`SS2G`/`SU2G`/`NI2G`) with `ifx-stack` against this checkout's
existing MAPL3 build, and added a `gocart+seasalt+dust+sulfate+nitrate`
Expand Down
4 changes: 4 additions & 0 deletions ESMF/GOCART2G_GridComp/SU2G_GridComp/mapl3-porting-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Steps 0-9 done: `sulfate-sa` and `gocart+seasalt+dust+sulfate` reproduce the
MAPL2 baseline bit-for-bit, and GOCART2G's aerosol optics run with SOLAR as
the caller.

*Update (2026-11-16): `gocart+seasalt+dust+sulfate` was replaced by
`regression/gocart/`, which runs all GOCART2G children; see
`../CA2G_GridComp/mapl3-porting-notes.md`, step 10.*

Left after the port (none blocks it):
- Publish the regression data to S3 and the shared
`/ford1/share/gmao_SIteam/regression-data` (step 9).
Expand Down
62 changes: 24 additions & 38 deletions ESMF/GOCART2G_GridComp/regression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ baseline consists of `<XX>_{import,internal,export}.nc`.

`carbon-bc-sa` is the one case where the `DataFor` component is not named
after the child: the child is the CA2G *instance* `CA_bc`, so the restarts
are `DataForCA_internal.nc` and `CA_bc_internal.nc`. Only the black-carbon
instance is exercised; `CA_oc` and `CA_br` are ported and runnable but are
not yet part of the suite.
are `DataForCA_internal.nc` and `CA_bc_internal.nc`. `CA_oc` and `CA_br`
have no standalone case; they run only in `gocart`.

`nitrate-sa` has one more child, `DuSsStub` (`../DuSsStub_GridComp`, built only for this case):

Expand All @@ -117,54 +116,37 @@ Root

NI2G's Initialize reads the `radius` and `fnum` ESMF Info attributes from its `DU` and `SS` imports. Only DU2G's and SS2G's own Initialize set them, and a `configurable_gridcomp` cannot. `DuSsStub` imports `DU` and `SS` from `DataForNI`, sets the attributes as DU2G and SS2G do, and exports them; `root.yaml` connects those exports to `FakeGOCART`.

### `gocart+seasalt+dust+sulfate`
### `gocart`

This case runs the real GOCART2G parent with its DU, SS and SU children:
This case runs the real GOCART2G parent with the production set of
children:

```
Root
├── DataForGOCART2G (run_phases: [run])
└── GOCART2G (libGOCART2G_GridComp.so, run_phases: [RunN])
├── DU
├── SS
└── SU
├── SU
├── CA_oc
├── CA_bc
├── CA_br
└── NI
```

- **Configs:** `GOCART2G_GridComp.yaml`, plus `DU_instance_DU.yaml`,
`SS_instance_SS.yaml` and `SU_instance_SU.yaml`.
`SS_instance_SS.yaml`, `SU_instance_SU.yaml`, `NI_instance_NI.yaml` and
`CA_instance_CA_{oc,bc,br}.yaml`.
- **Imports:** `data-for-gocart2g.yaml` holds the combined imports of all
three aerosols.
- **Restarts:** `DataForGOCART2G_internal.nc`, `DU_internal.nc`,
`SS_internal.nc` and `SU_internal.nc`.
- **Baseline:** `{DU,SS,SU}_{import,internal,export}.nc` and
`GOCART2G_{import,export}.nc`.
children.
- **Restarts:** `DataForGOCART2G_internal.nc` and
`{DU,SS,SU,NI,CA_oc,CA_bc,CA_br}_internal.nc`.
- **Baseline:** `{DU,SS,SU,NI,CA_oc,CA_bc,CA_br}_{import,internal,export}.nc`
and `GOCART2G_{import,export}.nc`.

### `gocart+seasalt+dust+sulfate+nitrate`

The same as `gocart+seasalt+dust+sulfate`, with an NI child added:

- **Configs:** `GOCART2G_GridComp.yaml` lists `NI: [NI]` (an empty list in the case above); `NI_instance_NI.yaml` is added.
- **Imports:** `data-for-gocart2g.yaml` and `root.yaml` add NI's imports, such as the ammonia emissions `EMI_NH3_AG`, `EMI_NH3_BB` and `EMI_NH3_EN`.
- **Restarts:** adds `NI_internal.nc`.
- **Baseline:** adds `NI_{import,internal,export}.nc`.

### `gocart+seasalt+dust+sulfate+nitrate+carbon-bc`

The same as `gocart+seasalt+dust+sulfate+nitrate`, with a CA child added:

- **Configs:** `GOCART2G_GridComp.yaml` lists `CA: [CA_bc]` (an empty list
in the case above); `CA_instance_CA_bc.yaml` is added. Only the
black-carbon instance is active, so the child is `CA_bc` rather than a
bare species name.
- **Imports:** `data-for-gocart2g.yaml` and `root.yaml` add CA's imports,
such as the carbon emissions `BC_BIOMASS`, `BC_BIOFUEL` and
`BC_ANTEBC1`.
- **Restarts:** adds `CA_bc_internal.nc`.
- **Baseline:** adds `CA_bc_{import,internal,export}.nc`.

This is the only case that exercises the parent's carbonaceous connection
block (`GOCART2G_GridCompMod.F90`), including `CA_bc_AERO` and
`CA_bc_AERO_DP`; `carbon-bc-sa` runs against `FakeGOCART` and so does not.
This is the only case that exercises the parent's connection blocks
(`GOCART2G_GridCompMod.F90`), for example `CA_bc_AERO` and `CA_bc_AERO_DP`;
the `*-sa` cases run against `FakeGOCART` and so do not.

## Creating a case from MAPL2 captures

Expand Down Expand Up @@ -228,6 +210,10 @@ follows:
| `<XX>_internal_before_runPhaseN.nc` | `runN/checkpoints/2000-04-14T21:20:00/<XX>_internal.nc` |
| `<XX>_*_after_runPhaseN.nc` | `baseline/` (for `cmpchk.py`) |

MAPL2 names the carbon instances `CA.oc`, `CA.bc` and `CA.br`, in both the
file names and the variable names (`CA.bcphobic`); rename both to `CA_oc`
and so on (`ncrename`).

The ctest baseline in `checkpoints/last/` is not the MAPL2 capture but a
MAPL3 checkpoint from a known-good IntelLLVM run.

Expand Down
8 changes: 2 additions & 6 deletions ESMF/GOCART2G_GridComp/regression/cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ dust-sa/run1
dust-sa/run2
seasalt-sa/run1
seasalt-sa/run2
gocart+seasalt+dust+sulfate/run1
gocart+seasalt+dust+sulfate/run2
gocart+seasalt+dust+sulfate+nitrate/run1
gocart+seasalt+dust+sulfate+nitrate/run2
gocart+seasalt+dust+sulfate+nitrate+carbon-bc/run1
gocart+seasalt+dust+sulfate+nitrate+carbon-bc/run2
sulfate-sa/run1
sulfate-sa/run2
nitrate-sa/run1
nitrate-sa/run2
carbon-bc-sa/run1
carbon-bc-sa/run2
gocart/run1
gocart/run2

This file was deleted.

This file was deleted.

Loading
Loading