v8.3.1-2.34 Fix the DEBUG build for the ifort_icx target; update .gi… #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run MPAS Standalone (NOAA GSL tests) | |
| on: [push, pull_request, workflow_dispatch] | |
| ############################################################################################# | |
| # Testing script/workflow for ufs-community fork of MPAS-Dev/MPAS-A. | |
| # | |
| # Description | |
| # | |
| # - Clone and build MPAS for baseline generation. | |
| # - Clone and build MPAS for feature branch testing (against baselines). | |
| # - Download any data (MP tables, MPAS ICs/LBCs/etc...). | |
| # - Create/populate MPAS run directories. | |
| # - Run MPAS using baseline codebase/configuration. | |
| # - Run MPAS using feature branch. | |
| # - Compare results. | |
| # - Save output files to GitHub artifact (for comparision w/ inline/standalone results) | |
| # | |
| # Comments: | |
| # - The test build/run configurations matrix is described below. | |
| # - This script uses a matrix run configuration with exclusions to achieve the desired "run list" | |
| # | |
| # <physics> - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git | |
| # <repo> - Baseline codebase repository. | |
| # <branch> - Baseline codebase repository branch. | |
| # | |
| # Tests: | |
| # Baseline Codebase Repository:Branch Physics build type | |
| # 1/7) MPAS-Dev:v8.3.0 mesoscale_reference Release/Debug | |
| # 2/8) MPAS-Dev:v8.3.0 convection_permitting Release/Debug | |
| # 3/9) MPAS-Dev:v8.3.0 mesoscale_reference_noahmp Release/Debug | |
| # 4/10) ufs-community:noaa/develop mesoscale_reference Release/Debug | |
| # 5/11) ufs-community:noaa/develop convection_permitting Release/Debug | |
| # 6/12) ufs-community:noaa/develop mesoscale_reference_noahmp Release/Debug | |
| # | |
| ############################################################################################# | |
| jobs: | |
| run_mpas: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false # Disable fail-fast | |
| matrix: | |
| f-compiler: [gfortran]#,ifx] | |
| physics: [mesoscale_reference, convection_permitting, mesoscale_reference_noahmp] | |
| repo: [ufs-community, MPAS-Dev] | |
| branch: [noaa/develop, v8.3.0] | |
| build-type: [Debug, Release] | |
| exclude: | |
| - repo: MPAS-Dev | |
| branch: noaa/develop | |
| - repo: ufs-community | |
| branch: v8.3.0 | |
| include: | |
| # Set container images for each compiler | |
| - f-compiler: gfortran | |
| bld_target: gfortran | |
| image: dustinswales/ufs-community-mpas-ci:gnu | |
| # - f-compiler: ifx | |
| # image: dustinswales/ufs-community-mpas-ci:oneapi | |
| # bld_target: intel | |
| container: | |
| image: ${{ matrix.image }} | |
| # | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| # Environmental variables | |
| env: | |
| py-version: 3.11 | |
| runner_ROOT: /__w/ | |
| MPAS_ROOT: /__w/MPAS-Model/MPAS-Model | |
| mpas_bl_ROOT: /__w/MPAS-Model-BL | |
| PNETCDF: /opt/pnetcdf | |
| mpas_ics: testing_and_setup/ufs-community/data/ics/mpasdev.gfs.winter | |
| ic_source: gfs | |
| # Workflow steps | |
| steps: | |
| ########################################################################################## | |
| # Step 1: Setup | |
| ########################################################################################## | |
| - name: Setup MPI (GNU) | |
| if: matrix.f-compiler == 'gfortran' | |
| run: | | |
| echo "CC=mpicc" >> $GITHUB_ENV | |
| echo "CXX=mpicxx" >> $GITHUB_ENV | |
| echo "FC=mpif90" >> $GITHUB_ENV | |
| - name: Setup MPI (Intel OneAPI) | |
| if: matrix.f-compiler == 'ifx' | |
| run: | | |
| echo "PATH=/opt/intel/oneapi/mpi/latest/bin:${PATH}" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mpi/latest/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV | |
| echo "CC=mpiicx" >> $GITHUB_ENV | |
| echo "CXX=mpiicpx" >> $GITHUB_ENV | |
| echo "FC=mpiifx" >> $GITHUB_ENV | |
| echo "MPICC=/opt/intel/oneapi/mpi/latest/bin/mpiicx" >> $GITHUB_ENV | |
| - name: Setup PnetCDF | |
| run: | | |
| echo "PNETCDF=/opt/pnetcdf" >> $GITHUB_ENV | |
| - name: Configuration for MPAS-Dev (baseline) tests. | |
| if: contains(matrix.repo, 'MPAS-Dev') | |
| run: | | |
| echo "nml_suffix=ncar" >> $GITHUB_ENV | |
| - name: Configuration for ufs-community (baseline) tests. | |
| if: contains(matrix.repo, 'ufs-community') | |
| run: | | |
| echo "nml_suffix=gsl" >> $GITHUB_ENV | |
| ########################################################################################## | |
| # Step 2a: Clone MPAS and build. (baselines) | |
| ########################################################################################## | |
| - name: Checkout and build MPAS standalone for baseline generation (Debug) | |
| if: contains(matrix.build-type, 'Debug') | |
| run: | | |
| cd ${runner_ROOT} | |
| git clone --recursive --branch ${{matrix.branch}} https://github.com/${{matrix.repo}}/MPAS-Model.git MPAS-Model-BL | |
| cd ${mpas_bl_ROOT} | |
| make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true | |
| - name: Checkout and build MPAS standalone for baseline generation (Release) | |
| if: contains(matrix.build-type, 'Release') | |
| run: | | |
| cd ${runner_ROOT} | |
| git clone --recursive --branch ${{matrix.branch}} https://github.com/${{matrix.repo}}/MPAS-Model.git MPAS-Model-BL | |
| cd ${mpas_bl_ROOT} | |
| make ${{matrix.bld_target}} CORE=atmosphere | |
| ########################################################################################## | |
| # Step 2b: Clone MPAS and build (feature branch) | |
| ########################################################################################## | |
| - name: Checkout MPAS codebase for testing. | |
| uses: actions/checkout@v3 | |
| - name: Initialize any submodules from testing codebase. | |
| run: | | |
| git config --global --add safe.directory ${MPAS_ROOT} | |
| cd ${MPAS_ROOT} | |
| git submodule update --init --recursive | |
| - name: Build MPAS standalone for testing (Debug) | |
| if: contains(matrix.build-type, 'Debug') | |
| run: | | |
| cd ${MPAS_ROOT} | |
| make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true | |
| - name: Build MPAS standalone for testing (Release) | |
| if: contains(matrix.build-type, 'Release') | |
| run: | | |
| cd ${MPAS_ROOT} | |
| make ${{matrix.bld_target}} CORE=atmosphere | |
| ########################################################################################## | |
| # Step 3: Fetch any data/files needed for MPAS runs. | |
| ########################################################################################## | |
| - name: Download MPAS data (grid info, IC and LBC files) | |
| run: | | |
| cd ${MPAS_ROOT} | |
| ./testing_and_setup/ufs-community/data/get_data.sh | |
| ########################################################################################## | |
| # Step 4a: Configure MPAS baseline runs | |
| ########################################################################################## | |
| - name: Create and populate run directory (baselines) | |
| run: | | |
| cd ${runner_ROOT} && mkdir run_bl && cd run_bl | |
| cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/mpasdev.${{matrix.physics}}.${ic_source}.winter/* . | |
| ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . | |
| ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . | |
| ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . | |
| ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . | |
| ln -sf ${mpas_bl_ROOT}/atmosphere_model . | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.init.nc . | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.ugwp_oro_data.nc . | |
| ln -sf namelist.atmosphere.${{env.nml_suffix}} namelist.atmosphere | |
| - name: Link lateral boundary condition file for regional MPAS. | |
| run: | | |
| cd ${runner_ROOT}/run_bl | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.lbc.nc . | |
| - name: Link Thompson MP data tables to run directory | |
| if: contains(matrix.physics, 'convection_permitting') | |
| run: | | |
| cd ${runner_ROOT}/run_bl | |
| cp ${MPAS_ROOT}/testing_and_setup/ufs-community/data/tables/thompson/* . | |
| ########################################################################################## | |
| # Step 4b: Configure MPAS feature runs | |
| ########################################################################################## | |
| - name: Create and populate run directory (feature test) | |
| run: | | |
| cd ${runner_ROOT} && mkdir run_rt && cd run_rt | |
| cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/mpasdev.${{matrix.physics}}.${ic_source}.winter/* . | |
| ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . | |
| ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . | |
| ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . | |
| ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . | |
| ln -sf ${MPAS_ROOT}/atmosphere_model . | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.init.nc . | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.ugwp_oro_data.nc . | |
| ln -sf namelist.atmosphere.gsl namelist.atmosphere | |
| - name: Link lateral boundary condition file for regional MPAS. | |
| run: | | |
| cd ${runner_ROOT}/run_rt | |
| ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.lbc.nc . | |
| - name: Link Thompson MP data tables to run directory | |
| if: contains(matrix.physics, 'convection_permitting') | |
| run: | | |
| cd ${runner_ROOT}/run_rt | |
| cp ${MPAS_ROOT}/testing_and_setup/ufs-community/data/tables/thompson/* . | |
| ########################################################################################## | |
| # Step 5: Run MPAS | |
| ########################################################################################## | |
| - name: Run MPAS (baselines) | |
| run: | | |
| cd ${runner_ROOT}/run_bl | |
| pwd && ls -l | |
| mpiexec --allow-run-as-root -np 1 ./atmosphere_model | |
| pwd && ls -l | |
| - name: Run MPAS (feature branch) | |
| run: | | |
| cd ${runner_ROOT}/run_rt | |
| pwd && ls -l | |
| mpiexec --allow-run-as-root -np 1 ./atmosphere_model | |
| pwd && ls -l | |
| ########################################################################################## | |
| # Step 6: Compare feature branch to baseline branch. | |
| ########################################################################################## | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@v3.2.0 | |
| with: | |
| python-version: ${{env.py-version}} | |
| auto-update-conda: true | |
| auto-activate-base: false | |
| environment-file: testing_and_setup/ufs-community/environment.yml | |
| activate-environment: mpas-ci-env | |
| - name: Run comparison script | |
| id: cmp | |
| run: | | |
| cd ${MPAS_ROOT}/testing_and_setup/ufs-community | |
| ./cmp_rt2bl.py --dir_rt ${runner_ROOT}/run_rt --dir_bl ${runner_ROOT}/run_bl | |
| ########################################################################################## | |
| # Step 7: Save MPAS output and log files as GitHub Artifact. | |
| ########################################################################################## | |
| - name: Create GitHub artifact | |
| run: | | |
| cd ${runner_ROOT} | |
| mkdir artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} | |
| cd artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} | |
| mkdir data_bl && cd data_bl | |
| cp ${runner_ROOT}/run_bl/log.atmosphere.*.out log.atmosphere.BL.out | |
| cp ${runner_ROOT}/run_bl/history.*.nc . | |
| cp ${runner_ROOT}/run_bl/diag.*.nc . | |
| cd .. | |
| mkdir data_rt && cd data_rt | |
| cp ${runner_ROOT}/run_rt/log.atmosphere.*.out log.atmosphere.RT.out | |
| cp ${runner_ROOT}/run_rt/history.*.nc . | |
| cp ${runner_ROOT}/run_rt/diag.*.nc . | |
| - name: Upload log files as GitHub Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mpas-baselines-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} | |
| path: /__w/artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} |