Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SHiELD-wrapper regression tests #2376

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Nov 30, 2023

This PR builds on #2365 and makes the changes necessary to add predictor and nudging regression tests for SHiELD-wrapper-based prognostic runs. In so doing it refactors test_regression.py to parametrize over the wrapper type, and move the base fortran configs into YAML files in their own subdirectory.

Note that unlike in #2350 no changes are required to the time loop of the prognostic run, thanks to ai2cm/SHiELD-wrapper#18, which has now been merged upstream. I updated the SHiELD-wrapper submodule accordingly in this PR.

Significant internal changes:

  • Added a wrapper parameter to file_configs_to_namelist_settings, since one of the namelist parameters used to control the output frequency of physics diagnostics in SHiELD is different than that in FV3GFS.

  • Moved the base fortran config for the FV3GFS prognostic run regression tests into a YAML file in a subdirectory alongside the base fortran config for the SHiELD prognostic run regression tests.

  • Tests added

@spencerkclark spencerkclark marked this pull request as ready for review December 5, 2023 18:08
Base automatically changed from initial-prognostic-run-shield-image to master December 6, 2023 14:26
Copy link
Contributor

@AnnaKwa AnnaKwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spencerkclark spencerkclark enabled auto-merge (squash) December 8, 2023 01:49
@spencerkclark spencerkclark merged commit f852766 into master Dec 8, 2023
12 of 15 checks passed
@spencerkclark spencerkclark deleted the SHiELD-wrapper-regression-tests branch December 8, 2023 02:11
spencerkclark added a commit that referenced this pull request Dec 21, 2023
This PR builds on #2376 and splits out from #2350 what is necessary to
run SHiELD-wrapper-based prognostic simulations through our standard
prognostic run argo workflow. No changes to the frontend API are needed;
the prognostic run workflow is modified to infer which template
(`run-fv3gfs` or `run-shield`) to run based on the input config.

For convenience this also adds a starter base config for SHiELD, which
is based on the configuration used in the PIRE simulations (but for
simplicity with the mixed layer ocean turned off). I have tested the
`prognostic-run` and `restart-prognostic-run` workflows using a
SHiELD-based config offline. I'm not sure if we want to add an
integration test yet or not.

Significant internal changes:
- Refactored the `prognostic-run` workflow to infer whether to use
FV3GFS or SHiELD based on the config.
- Refactored the `restart-prognostic-run` workflow to infer whether to
use FV3GFS or SHiELD based on the config at the provided URL.
- Refactored the directory structure of the base config YAMLs in
`fv3kube` to better accommodate SHiELD configs. No user-facing changes
to the FV3GFS configs are made.

Note this PR makes use of YAML anchors and aliases to reduce the amount
of duplicate configuration code. Some illustration of how these work can
be found
[here](https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/).
Use of this concept was already introduced in
#2103 within the `training.yaml`
template, though this is the first time using it in the prognostic run.

-----

To illustrate the updated workflows I have included some example step
outputs from `argo get` below (we ran the `prognostic-run` workflow for
two segments and then ran one more segment via the
`restart-prognostic-run` workflow).

### prognostic-run

```
STEP                                     TEMPLATE                                PODNAME                                        DURATION  MESSAGE
 ✔ 2023-12-21-baseline-shield-example    prognostic-run
 ├───✔ resolve-output-url                resolve-output-url/resolve-output-url   2023-12-21-baseline-shield-example-681218977   3s
 ├───✔ convert-input-config-to-artifact  convert-input-config-to-artifact        2023-12-21-baseline-shield-example-117187868   3s
 ├───✔ infer-wrapper                     infer-wrapper                           2023-12-21-baseline-shield-example-3326365873  3s
 ├───○ prepare-config-fv3gfs             prepare-config-fv3gfs                                                                            when ''shield.wrapper' == 'fv3gfs.wrapper'' evaluated false
 ├───✔ prepare-config-shield             prepare-config-shield                   2023-12-21-baseline-shield-example-1872594915  3m
 ├───○ run-model-fv3gfs                  run-simulation/run-fv3gfs                                                                        when ''shield.wrapper' == 'fv3gfs.wrapper'' evaluated false
 ├───✔ run-model-shield                  run-simulation/run-shield
 │   ├─┬─✔ choose-node-pool              choose-node-pool                        2023-12-21-baseline-shield-example-3672275837  4s
 │   │ └─✔ create-run                    create-run-shield                       2023-12-21-baseline-shield-example-1572199652  3m
 │   └───✔ run-first-segment             run-all-segments-shield
 │       ├───✔ append-segment            append-segment-shield                   2023-12-21-baseline-shield-example-2948602435  6m
 │       ├───✔ increment-segment         increment-count                         2023-12-21-baseline-shield-example-2887248493  5s
 │       └───✔ run-next-segment          run-all-segments-shield
 │           ├───✔ append-segment        append-segment-shield                   2023-12-21-baseline-shield-example-256387028   5m
 │           ├───✔ increment-segment     increment-count                         2023-12-21-baseline-shield-example-2030482824  3s
 │           └───○ run-next-segment      run-all-segments-shield                                                                          when '2 < 2' evaluated false
 ├───○ online-diags                      prognostic-run-diags/diagnostics                                                                 when 'false == true' evaluated false
 ├───○ online-diags-report               prognostic-run-diags/report-single-run                                                           when 'false == true' evaluated false
 └───○ exit                              exit                                                                                             when 'Skipped == Failed || Succeeded == Failed' evaluated false
```

### restart-prognostic-run

```
STEP                                           TEMPLATE                                PODNAME                                                DURATION  MESSAGE
 ✔ 2023-12-21-restart-baseline-shield-example  restart-prognostic-run
 ├───✔ choose-node-pool                        run-simulation/choose-node-pool         2023-12-21-restart-baseline-shield-example-1554740548  3s
 ├───✔ infer-wrapper                           infer-wrapper                           2023-12-21-restart-baseline-shield-example-3018678792  4s
 ├───○ restart-run-fv3gfs                      run-simulation/run-all-segments                                                                          when ''shield.wrapper' == 'fv3gfs.wrapper'' evaluated false
 └───✔ restart-run-shield                      run-simulation/run-all-segments-shield
     ├───✔ append-segment                      append-segment-shield                   2023-12-21-restart-baseline-shield-example-26558483    5m
     ├───✔ increment-segment                   increment-count                         2023-12-21-restart-baseline-shield-example-4132074205  4s
     └───○ run-next-segment                    run-all-segments-shield                                                                                  when '1 < 1' evaluated false
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants