Skip to content

ccpp-capgen v1: a unified successor to ccpp-prebuild and ccpp-capgen v0 #759

Open
0 of 1 issue completed

Description

@climbfuji

Description

Note. ccpp-capgen v1 was previously called ccpp-capgen-ng. Some of the supporting documents attached below (until 2026-06-28) use this terminology.

ccpp-capgen v1 is a next-generation code generator for the CCPP framework. It is not a criticism of the existing tools — both ccpp-prebuild and ccpp-capgen v0 have served their respective communities well and embody years of careful design. This project attempts to synthesize the strengths of both: the performance of ccpp-prebuild and the metadata richness and feature set of ccpp-capgen v0, while also taking advantage of relaxed code-generator requirements that have emerged over time and lessons learned from operating both tools in development, research, and production. It also aims to resolve several outstanding issues that have been blocking progress toward a long-discussed unification of the two code generators.

Supporting documents — including a redesign analysis, the LLM prompt used to bootstrap development, developer and user documentation, and a migration guide — will be provided as part of the draft pull request.

The code was developed with the assistance of an LLM (Claude, by Anthropic) as a coding partner. Where possible, existing code was reused and repackaged.

Testing

Python docstring tests, unit tests

Significantly expanded test coverage with Python docstring tests and 1500-ish unit tests. Run in CI, all pass.

End-to-end tests

The following tests and features are currently supported by ccpp-capgen v1. They run successfullly in CI and on my development boxes.

  • Former ccpp-capgen v0 tests:
    • advection
    • advection_auto_clone (support legacy constituents auto-cloning from metadata)
    • capgen_ng
    • ddthost
    • nested_suite
    • var_compat
  • Former ccpp-prebuild tests:
    • chunked_data
    • blocked-data not supported in capgen or capgen-ng
    • opt_arg
  • Newly added features/tests:
    • multi-instances
    • multi-instances + constituents
    • suite_allocate (exercises suite-owned variables with various types of runtime-known dimensions)
    • constituents_dim (suite- and host-owned variables with dimensions from constituents objects)

Host model integration

Issues

A list of issues that will be addressed with this issue will be provided in the associated pull request.

Addressing this issue will also address/close the following issues if/when the participating host models switch to capgen-ng:

To check/may not be implemented yet:

Working towards:

Supporting Materials

See doc/ folder in the feature/capgen-v1 - documents evolved over time (commit history).

The documents were produced by Claude during development and most have them have not been formally reviewed. They are shared for transparency and to give context for the design decisions made. They should be treated as starting points rather than authoritative references.

An update of the CCPP technical documentation is made in NCAR/ccpp-doc#81.

Activity

  1. self-assigned this
    on May 13, 2026
  2. moved this to In progress in capgen unificationon May 13, 2026
  3. bbakernoaa commented on May 26, 2026

    @bbakernoaa

    @climbfuji I'm really interested to get this moving forward. How can I help move this forward?

  4. climbfuji commented on May 27, 2026

    @climbfuji
    CollaboratorAuthor

    @climbfuji I'm really interested to get this moving forward. How can I help move this forward?

    @bbakernoaa Thank you very much for your offer to help, very much appreciated. There are many moving pieces. So far, this has been tested with CCPP-SCM and with NEPTUNE (with three compilers, Intel LLVM + GCC + LLVM native). The next tests need to cover UFS and CAM-SIMA. For CAM-SIMA, I'll work with the developers @peverwhee and @nusbaume. For UFS, your help would be appreciated, but we should coordinate with @dustinswales.

    To prepare for UFS and SCM updates, we need to first fix the Metadata vs Fortran inconsistencies in the NCAR CCPP physics. I created pull requests for the UFS weather model, UFSATM, and CCPP physics ufs/dev for that (b4b identical w/ current baseline). It would be great if we could push these pull requests through quickly. When these changes come back to the authoritative NCAR ccpp-physics main branch, we can update the SCM and NEPTUNE branches. The changes will minimize the differences that we need to make when we transition to the new code generator. Maybe you can help with raising the priority for these PRs. I am also tagging @grantfirl and @dustinswales here.

  5. bbakernoaa commented on May 27, 2026

    @bbakernoaa

    @climbfuji I'm really interested to get this moving forward. How can I help move this forward?

    @bbakernoaa Thank you very much for your offer to help, very much appreciated. There are many moving pieces. So far, this has been tested with CCPP-SCM and with NEPTUNE (with three compilers, Intel LLVM + GCC + LLVM native). The next tests need to cover UFS and CAM-SIMA. For CAM-SIMA, I'll work with the developers @peverwhee and @nusbaume. For UFS, your help would be appreciated, but we should coordinate with @dustinswales.

    To prepare for UFS and SCM updates, we need to first fix the Metadata vs Fortran inconsistencies in the NCAR CCPP physics. I created pull requests for the UFS weather model, UFSATM, and CCPP physics ufs/dev for that (b4b identical w/ current baseline). It would be great if we could push these pull requests through quickly. When these changes come back to the authoritative NCAR ccpp-physics main branch, we can update the SCM and NEPTUNE branches. The changes will minimize the differences that we need to make when we transition to the new code generator. Maybe you can help with raising the priority for these PRs. I am also tagging @grantfirl and @dustinswales here.

    @climbfuji Thanks. I would really like to get this moving forward as fast as possible. @dustinswales how can I help?

  6. climbfuji commented on May 27, 2026

    @climbfuji
    CollaboratorAuthor

    @climbfuji I'm really interested to get this moving forward. How can I help move this forward?

    @bbakernoaa Thank you very much for your offer to help, very much appreciated. There are many moving pieces. So far, this has been tested with CCPP-SCM and with NEPTUNE (with three compilers, Intel LLVM + GCC + LLVM native). The next tests need to cover UFS and CAM-SIMA. For CAM-SIMA, I'll work with the developers @peverwhee and @nusbaume. For UFS, your help would be appreciated, but we should coordinate with @dustinswales.
    To prepare for UFS and SCM updates, we need to first fix the Metadata vs Fortran inconsistencies in the NCAR CCPP physics. I created pull requests for the UFS weather model, UFSATM, and CCPP physics ufs/dev for that (b4b identical w/ current baseline). It would be great if we could push these pull requests through quickly. When these changes come back to the authoritative NCAR ccpp-physics main branch, we can update the SCM and NEPTUNE branches. The changes will minimize the differences that we need to make when we transition to the new code generator. Maybe you can help with raising the priority for these PRs. I am also tagging @grantfirl and @dustinswales here.

    @climbfuji Thanks. I would really like to get this moving forward as fast as possible. @dustinswales how can I help?

    Realized that Dustin is out of the office this week. I suggest we work with EPIC to prioritize the metadata-fortran bug fixes this week and early next week start working on dropping capgen-ng in the UFS.

    @ligiabernardet FYI

  7. changed the title [-][PLACEHOLDER] ccpp-capgen-ng: a unified successor to ccpp-prebuild and ccpp-capgen[/-] [+]ccpp-capgen-ng: a unified successor to ccpp-prebuild and ccpp-capgen[/+] on Jun 30, 2026
  8. changed the title [-]ccpp-capgen-ng: a unified successor to ccpp-prebuild and ccpp-capgen[/-] [+]ccpp-capgen v1: a unified successor to ccpp-prebuild and ccpp-capgen v0[/+] on Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions