PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
PHYEX INTEGRATOR DOCUMENTATION

About this section

This document is intended for integrators who are in charge of assembling contributions received through pull requests.

Branches and norms

Regarding array-syntax, the applicable norm depends on the branch:

  • The master branch is written using array-syntax with mnh_expand directives
  • The arome branch is written using DO loops
  • mesonh specific branches are written using array-syntax

Pull requests can be received on all these kind of branches and must be merged into the master branch with according norm.

Normal workflow for a contribution developed in AROME and HARMONIE-AROME

The pull request comes directly from a developer. It must be based on the arome branch. When the interfaces with the rest of the model are modified, a pull request is also sent to the IAL repository (modifications of the CALL statements).

Details for point 6:

  • The PHYEX administrator
    • validates the contribution (see below)
    • integrates the modifications in the master branch (written with the array-syntax and mnh_expand directives); the arome branch is then updated automatically (see below)
    • regularly, tags a new (minor) version of the master branch
  • Then, a new commit is added on the IAL working branch (on which the IAL pull request is based) to reference the new PHYEX commit (arome branch) in the bundle/bundle.yml file of IAL
  • The IAL integrator integrates the IAL pull request

PHYEX - IAL compatibility

Because the interfaces between the physics and the rest of the model can change, the IAL version to use with PHYEX must be referenced in the 'src/phyex/ial_version.json' file (repository, commit and cycle of IAL, used by the phyex-check_ial tool). On the IAL side, the PHYEX version is referenced in the bundle/bundle.yml file.

In addition, if some files must be excluded from the IAL compilation, they must be listed in the 'src/phyex/gmkpack_ignored_files' file.

Normal workflow for a contribution developed in MESONH

The developer sends its pull request on the Méso-NH repository (the physics source code is embedded in the model source code).

Integration details:

  • The Meso-NH integrator extracts, from the different pull requests, what concern the PHYEX repository and send a pull request on PHYEX based on a mesonh specific branch
  • The PHYEX administrator:
    • validates (see below) the contribution
    • integrates the contribution in the mesonh branch and merges it in the master branch
    • regularly, he tags a new (minor) version of the master branch
    • when asked by the Meso-NH integrator, he builds a new mesonh specific branch (see below)
    • when a mesonh specific branch is used in an official release, the mesonh specific branch is tagged accordingly

The Meso-NH version used to test PHYEX is described in the 'src/phyex/mesonh_version.json' file.

Normal workflow for another contribution

Pull requests must be based on the master branch.

The PHYEX administrator:

  • validates (see below) the contribution
  • integrates the contribution in the master branch
  • regularly, he tags a new (minor) version of the master branch

Releases

A release is a tag vX.Y.Z of the master branch, X.Y.Z being the version stored in the src/phyex/VERSION file. The push of such a tag triggers the "Release" GitHub workflow (.github/workflows/release.yaml), which:

  • builds the pyphyex wheels for Linux (x86_64 and aarch64) in manylinux containers (.github/scripts/build_wheel.sh) and tests them;
  • builds the source distribution (sdist);
  • builds the release note with the phyex-changelog tool (see the Tools documentation): the commits since the previous release tag, sorted by category according to the titles of their pull requests;
  • publishes the wheels and the sdist on PyPI (the PYPI_API_TOKEN secret of the repository must contain a PyPI API token allowed to upload the pyphyex package); then, creates the GitHub release of the tag (https://github.com/UMR-CNRM/PHYEX/releases), with the release note as description and the wheels and the sdist attached.

The workflow can also be run manually, on any branch (Actions tab, "Release" workflow, "Run workflow" button): everything is built as for a release, without checking the version and without publishing; the release note then lists the commits since the last release tag. This is useful to check that a release would succeed before tagging.

Tests

The source code must follow the coding norms and the strict mnh_expand directives (described in the Coding Norms documentation). They are checked by the phyex-check_norms tool (also run by the "tests" GitHub workflow).

In addition to the scientific validation, the following tests must give the same results (with bit-reproducibility) in each of the model (arome, mesonh, lmdz and testprogs):

  • compilation transforming the mnh_expand directives in DO loop
  • compilation keeping the array-syntax
  • execution with a different number of processors

When possible, the new version of PHYEX must reproduce the old results (scientific modifications must be activated with namelist keys).

These tests are performed by the phyex-check_<model> tools; the reference commits for the test cases of each model are given in the 'testing' entry of the src/phyex/<model>_version.json files. The phyex-check_commit tool performs all the checks (coding norms, consistency, documentation generation, python wheel creation and test cases of the different models) and the clone_and_test.sh script can run them automatically (e.g. by cron) on the last commit of a branch, the result being attached to the commit on GitHub. These tools are described in the Tools documentation.

Code preparation

The source code stored in the master branches must be usable by all the models. But these models can have contradictory constraints. To bypass this difficulty, the source code is preprocessed before being included in the compilation environment of each model.

This preprocessing step can be done on the fly (in this case the preprocessing tools must be available aside of the compilation tools, it is the case of the CMake build system of PHYEX, see the PHYEX_TRANSFORMATION option in the Offline documentation), or the result of the preprocessing can be stored in the PHYEX package (in this case, the preprocessing is done once and can be used by several users). This second possibility is useful to historize the source code really used during the model compilation and enables contributions to the PHYEX package without the need of the preprocessing tools.

The preprocessed versions of the source code are put in model specific branches:

  • the arome branch is updated automatically, at each new commit on the master branch, by the arome_branch GitHub workflow (each commit of the master branch is transformed and committed on the arome branch)
  • the mesonh_<commit> branches, where <commit> is the commit hash used as a basis, are built by the PHYEX administrator with the phyex-prep_code tool

The preprocessing tools are described in the Tools documentation.