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

About this section

This section is intended for developers who want to contribute to the PHYEX package. Developer who is interested in plugging the physics in a new model can refer to the Plugging documentation. The topics covered are as follows:

  • Package organisation
  • Versions
  • Contribution workflow for AROME and HARMONIE-AROME developers
  • Contribution workflow for Méso-NH developers
  • Contribution workflow for other developers
  • Code documentation

Package organisation

The package contains two kinds of branches:

  • generic branches which contain codes for all the models and applications (eg: master branch)
  • model specific branches which are derived from the master branch (arome branch, mesonh_<commit_hash> branches)

For model specific branches, only the source code adapted for a given model is present (one directory per parametrisation and an aux directory). They are intended to be included directly in the compilation system of the hosting model.

The master branch contains the following directories and files:

  • src/phyex: the FORTRAN source code (aux, conv, micro, turb directories for the parametrisations, progs and support directories for the offline test programs), its CMake build system (CMakeLists.txt and cmake directory), the version number (VERSION file) and the description of the model versions used to test PHYEX (<model>_version.json files)
  • src/pyphyex: the python package (python binding and 1D model, see the phyex1d documentation)
  • CMakeLists.txt and cmake: CMake build system of the whole package (with its dependencies), see the Offline documentation
  • pyproject.toml: build of the python package
  • arch: architecture files (compilation environments)
  • tools: python package (pyphyextools) containing the tools to prepare the source code and to check the contributions (see the Tools documentation), and the configuration of the IAL test cases (tools/conf_tests)
  • clone_and_test.sh: script for the automatic tests (see the Tools documentation)
  • docs: this documentation

The model specific branches are:

  • arome: source code for the AROME and HARMONIE-AROME models, automatically updated (by the arome_branch GitHub workflow) at each new commit on the master branch
  • mesonh_<commit_hash>: source code for the Méso-NH model, built from a given commit of the master branch

In addition, the testprogs_data, testprogs_data2 and testprogs_data3 branches contain modified source code used to generate the input data of the test programs (more on this topic in the Offline documentation).

Versions

Versions of the master branch are tagged with tags named "vX.Y.Z" (for example "v1.0.0"). The commit of the arome branch corresponding to this version is tagged "vX.Y.Z_arome" (for example "v1.0.0\_arome"). The version number is only stored in the src/phyex/VERSION file (used by CMake, the python package and the python tools): it must be updated before tagging a new version. The "consistency" GitHub workflow (or the phyex-check_consistency tool) checks that it is the version of the last release tag.

Contribution workflow for AROME and HARMONIE-AROME developers

AROME and HARMONIE-AROME are built as a bundle: the model is built with source codes coming from various repositories. The PHYEX source code is no longer included in the IAL repository: the bundle description (bundle/bundle.yml file of IAL) references the version (commit of the arome branch) of PHYEX to use.

The AROME and HARMONIE-AROME developers only see the code of the arome branch. This code is ready for inclusion (array-syntax already transformed into DO loops for instance): developers do not need to manipulate code transformation tools.

Workflow details (getting the source code in blue, pull request in red, integration in green):

  • 1 and 2: the AROME or HARMONIE-AROME developer forks the IAL and PHYEX repositories (the work on PHYEX is based on the arome branch)
  • 3: the developer compiles, executes, modifies the source code in its environment (the bundle description of its IAL working branch references its PHYEX fork and working branch)
  • 4: the developer sends a pull request to the arome branch of the PHYEX repository
  • 5: if the interfaces between PHYEX and the rest of the model are modified, the developer also sends a pull request to the IAL repository (with the modifications of the CALL statements)
  • 6: the pull request is first integrated in PHYEX by the PHYEX administrator (who reports the modifications in the master branch, the arome branch being updated automatically, see the Integrator documentation). Then, a new commit is added on the IAL working branch to reference the new PHYEX commit (arome branch) in the bundle/bundle.yml file of IAL, and the IAL integrator integrates the IAL pull request.

Contribution workflow for Méso-NH developers

The physics source code is embedded in the Méso-NH source code.

The physics source code comes directly from a mesonh specific branch (these branches are named mesonh_<commit_hash>) which contain code ready for use in the Méso-NH model (array-syntax...).

Pull requests concerning the physics continue to follow the same path as before (ie pull requests are submitted to the Meso-NH repository). The Meso-NH integrator will submit a pull request to the PHYEX repository with only the relevant files.

Contribution workflow for other developers

Other developers must work with source code coming directly from the master branch. They issue pull requests directly on this branch as usual with git repositories.

Before submitting a pull request, the contribution can be checked with the tools described in the Tools documentation (phyex-check_norms for the coding norms, phyex-check_testprogs for the bit-reproducibility of the test programs, phyex-check_commit for all the checks).

The title of a pull request must start with 'bugfix: ', 'feature: ' or 'bugfix+feature: ', in any case (this is checked automatically). This prefix is used by the phyex-changelog tool to sort the modifications by category. The description is pre-filled by a template (.github/pull_request_template.md) asking for a description of the modifications and of their impact on the results; the coding norms, the compilation and the execution of the tests must be OK.

Code documentation

The code must contain comments. The documentation rules to follow are described in the CodingNorms document.