From 782d1a67ec54dc62d88464123e893e0cb3dd64d7 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Wed, 13 Mar 2024 15:37:43 +0000 Subject: [PATCH 01/41] Update continuous_integration.yml --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 4652b5d4b5..50798e6a9c 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -27,7 +27,7 @@ # Workflow for continuous integration tests name: CI -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: # This workflow contains a single job called "test" From d0d86f0da7e47e8f5ac32ccc714567781dcb8148 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:07:01 +0100 Subject: [PATCH 02/41] Update CI to Ubuntu 22.04 --- .github/workflows/continuous_integration.yml | 78 +++++--------------- 1 file changed, 17 insertions(+), 61 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 50798e6a9c..2577fce00d 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -33,13 +33,13 @@ jobs: # This workflow contains a single job called "test" test: # The type of runner that the job will run on - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - fortran-compiler: [gfortran, gfortran-8, gfortran-7, ifort] + compiler: [gfortran-10, gfortran-11, gfortran-12, ifort] env: - F90: ${{ matrix.fortran-compiler }} - FC: ${{ matrix.fortran-compiler }} + F90: ${{ matrix.compiler }} + FC: ${{ matrix.compiler }} F90FLAGS: "-O3 -ffree-line-length-none -fcheck=bounds -finit-real=nan" ATOL: 0.0 RTOL: 0.0 @@ -57,11 +57,11 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.11 - name: Setup conda uses: s-weigand/setup-conda@v1 with: - python-version: 3.7 + python-version: 3.11 - name: Install python packages run: conda install --yes cartopy matplotlib netcdf4 # Update system packages @@ -74,17 +74,11 @@ jobs: # FORTRAN compilers ############################################################################### # - # Install gfortran compiler - # - - name: Install gfortran compiler - if: contains(matrix.fortran-compiler, 'gfortran') - run: sudo apt-get install ${{ matrix.fortran-compiler }} - # # Intel compilers # - name: cache-intel-compilers id: cache-intel-compilers - if: contains(matrix.fortran-compiler, 'ifort') + if: contains(matrix.compiler, 'ifort') uses: actions/cache@v2 with: path: /opt/intel @@ -94,7 +88,7 @@ jobs: # List of packages from Docler file at # https://github.com/intel/oneapi-containers/blob/master/images/docker/hpckit-devel-ubuntu18.04/Dockerfile - name: Install Intel compilers and libraries - if: contains(matrix.fortran-compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true' + if: contains(matrix.compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true' run: | wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB @@ -103,43 +97,16 @@ jobs: sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac - # - # Nvidia compilers - # - - name: cache-nvidia-compilers - id: cache-nvidia-compilers - if: contains(matrix.fortran-compiler, 'nvfortran') - uses: actions/cache@v2 - with: - path: /opt/nvidia/hpc_sdk/ - key: nvhpc-${{ runner.os }}-2020-20.7 - - - name: Nvidia setup compilers - if: contains(matrix.fortran-compiler, 'nvfortran') && steps.cache-nvidia-compilers.outputs.cache-hit != 'true' - env: - NVCOMPILERS: /opt/nvidia/hpc_sdk - run: | - wget -q https://developer.download.nvidia.com/hpc-sdk/nvhpc-20-7_20.7_amd64.deb https://developer.download.nvidia.com/hpc-sdk/nvhpc-2020_20.7_amd64.deb - sudo apt-get install ./nvhpc-20-7_20.7_amd64.deb ./nvhpc-2020_20.7_amd64.deb ############################################################################### # Compiler-specific environment ############################################################################### - # Environments for ifort and nvidia compilers + # Environment for Intel compilers - name: Environment for ifort compiler - if: contains(matrix.fortran-compiler, 'ifort') + if: contains(matrix.compiler, 'ifort') run: | echo "CC=icx" > $GITHUB_ENV echo "FC=ifort" > $GITHUB_ENV echo "F90FLAGS=-O3 -heap-arrays" > $GITHUB_ENV - - name: Environment for nvfortran compiler - env: - NVCOMPILERS: /opt/nvidia/hpc_sdk - if: contains(matrix.fortran-compiler, 'nvfortran') - run: | - echo "CC=nvc" > $GITHUB_ENV - echo "FC=nvfortran" > $GITHUB_ENV - echo "F90FLAGS=-Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk" > $GITHUB_ENV - echo "${NVCOMPILERS}/Linux_x86_64/20.7/compilers/bin" >> $GITHUB_PATH ############################################################################### # NetCDF C and FORTRAN libraries ############################################################################### @@ -153,7 +120,7 @@ jobs: uses: actions/cache@v2 with: path: /home/runner/netcdf-fortran - key: netcdf-fortran-4.4.4a-${{ runner.os }}-${{ matrix.fortran-compiler }}-v02 + key: netcdf-fortran-4.4.4a-${{ runner.os }}-${{ matrix.compiler }}-v02 # Build NetCDF FORTRAN library for current compiler - name: Build NetCDF FORTRAN library @@ -216,26 +183,18 @@ jobs: # doing it this way the output is easier to interpret. ############################################################################### # 1. Basic test - - name: Basic test + - name: Basic test, UM global snapshot run: | source /opt/intel/oneapi/setvars.sh || true cd driver/run ./cosp2_test cosp2_input_nl.txt - # 2. UM global snapshot - - name: UM global snapshot - run: | - source /opt/intel/oneapi/setvars.sh || true - cd driver/run ./cosp2_test cosp2_input_nl.um_global.txt - # 3. UM global snapshot. Diagnostics on model levels. + # 2. UM global snapshot. Diagnostics on model levels. - name: UM global snapshot. Diagnostics on model levels. + if: contains(matrix.compiler, gfortran) run: | - if [[ "${F90}" = 'gfortran' ]]; then - cd driver/run - ./cosp2_test cosp2_input_nl.um_global_model_levels.txt cosp2_output_nl.um_global_model_levels.txt - else - echo "Test is only run for gfortran compiler." - fi + cd driver/run + ./cosp2_test cosp2_input_nl.um_global_model_levels.txt cosp2_output_nl.um_global_model_levels.txt ############################################################################### # Compare results against known good outputs. As above, # we split it in as many steps as tests. @@ -272,15 +231,12 @@ jobs: fi # 3. UM global snapshot. Diagnostics on model levels. Only gfortran. - name: UM global on model levels against known good output (KGO) + if: contains(matrix.compiler, gfortran) run: | cd driver KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global_model_levels.nc - if [[ "${F90}" = 'gfortran' ]]; then python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} - else - echo "Test only run for gfortran compiler." - fi ############################################################################### # Produce plots when it fails during global snapshot tests, # and create a tarball with outputs. From 9ed8f039a5de798e5ea1c3039e7385e8291224e5 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:08:21 +0100 Subject: [PATCH 03/41] YML syntax --- .github/workflows/continuous_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 2577fce00d..579d5a4027 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -191,7 +191,7 @@ jobs: ./cosp2_test cosp2_input_nl.um_global.txt # 2. UM global snapshot. Diagnostics on model levels. - name: UM global snapshot. Diagnostics on model levels. - if: contains(matrix.compiler, gfortran) + if: contains(matrix.compiler, 'gfortran') run: | cd driver/run ./cosp2_test cosp2_input_nl.um_global_model_levels.txt cosp2_output_nl.um_global_model_levels.txt @@ -231,7 +231,7 @@ jobs: fi # 3. UM global snapshot. Diagnostics on model levels. Only gfortran. - name: UM global on model levels against known good output (KGO) - if: contains(matrix.compiler, gfortran) + if: contains(matrix.compiler, 'gfortran') run: | cd driver KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc From e35007a028d95dcd918d9e087cfeb261d00ff6e1 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:15:54 +0100 Subject: [PATCH 04/41] Use Ubuntu netcdf Fortran library for gfortran --- .github/workflows/continuous_integration.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 579d5a4027..6ba24d1f80 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -35,6 +35,7 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: compiler: [gfortran-10, gfortran-11, gfortran-12, ifort] env: @@ -114,9 +115,14 @@ jobs: - name: Install NetCDF library run: sudo apt-get install libnetcdf-dev + - name: Install NetCDF Fortran library + if: contains(matrix.compiler, 'gfortran') + run: sudo apt-get install libnetcdff-dev + # Cache netcdf FORTRAN library - name: cache-netcdf-fortran id: cache-netcdf-fortran + if: contains(matrix.compiler, 'ifort') uses: actions/cache@v2 with: path: /home/runner/netcdf-fortran @@ -124,6 +130,7 @@ jobs: # Build NetCDF FORTRAN library for current compiler - name: Build NetCDF FORTRAN library + if: contains(matrix.compiler, 'ifort') env: FCFLAGS: -fPIC if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true' From 82d0a76fa8d5810e1280461cb17f380ff95614b9 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:17:43 +0100 Subject: [PATCH 05/41] YML syntax --- .github/workflows/continuous_integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 6ba24d1f80..ce1bb2b781 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -130,10 +130,9 @@ jobs: # Build NetCDF FORTRAN library for current compiler - name: Build NetCDF FORTRAN library - if: contains(matrix.compiler, 'ifort') + if: contains(matrix.compiler, 'ifort') && steps.cache-netcdf-fortran.outputs.cache-hit != 'true' env: FCFLAGS: -fPIC - if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true' run: | source /opt/intel/oneapi/setvars.sh || true ${F90} --version From 2ef935a5f8a14cfef562728c087ff086e29b02b2 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:25:02 +0100 Subject: [PATCH 06/41] netcdf fortran homes --- .github/workflows/continuous_integration.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index ce1bb2b781..731e40235c 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -45,8 +45,6 @@ jobs: ATOL: 0.0 RTOL: 0.0 KGO_VERSION: v002 - NFHOME: /home/runner/netcdf-fortran - LD_LIBRARY_PATH: /home/runner/netcdf-fortran/lib # Sequence of tasks that will be executed as part of the job steps: # Checks-out repository under $GITHUB_WORKSPACE @@ -101,13 +99,19 @@ jobs: ############################################################################### # Compiler-specific environment ############################################################################### - # Environment for Intel compilers + - name: Environment for ifort compiler + if: contains(matrix.compiler, 'gfortran') + run: echo "NFHOME=/usr/include" > $GITHUB_ENV + - name: Environment for ifort compiler if: contains(matrix.compiler, 'ifort') run: | echo "CC=icx" > $GITHUB_ENV echo "FC=ifort" > $GITHUB_ENV echo "F90FLAGS=-O3 -heap-arrays" > $GITHUB_ENV + echo "NFHOME=/home/runner/netcdf-fortran" > $GITHUB_ENV + echo "LD_LIBRARY_PATH=/home/runner/netcdf-fortran/lib" > $GITHUB_ENV + ############################################################################### # NetCDF C and FORTRAN libraries ############################################################################### From 4c466669762bb6d83819b46883ef6a14619f1909 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 17:30:51 +0100 Subject: [PATCH 07/41] Add dependabot --- .github/dependabot.yml | 8 ++++++++ .github/workflows/continuous_integration.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..739870bd4e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + target-branch: "master" diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 731e40235c..81163698bf 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -99,7 +99,7 @@ jobs: ############################################################################### # Compiler-specific environment ############################################################################### - - name: Environment for ifort compiler + - name: Environment for Gfortran compiler if: contains(matrix.compiler, 'gfortran') run: echo "NFHOME=/usr/include" > $GITHUB_ENV From 9ee097f0e8cd46833fbebb4ceaddf0b274d244f8 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:12:45 +0100 Subject: [PATCH 08/41] Not understanding this... --- .github/workflows/continuous_integration.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 81163698bf..dec08007c2 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -40,18 +40,18 @@ jobs: compiler: [gfortran-10, gfortran-11, gfortran-12, ifort] env: F90: ${{ matrix.compiler }} - FC: ${{ matrix.compiler }} + FC: ${{ matrix.compiler }} F90FLAGS: "-O3 -ffree-line-length-none -fcheck=bounds -finit-real=nan" ATOL: 0.0 RTOL: 0.0 KGO_VERSION: v002 # Sequence of tasks that will be executed as part of the job steps: - # Checks-out repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v2 ############################################################################### # Initial steps ############################################################################### + # Checks-out repository under $GITHUB_WORKSPACE + - uses: actions/checkout@v2 # Set up Python and install dependencies - name: Set up Python uses: actions/setup-python@v2 @@ -63,12 +63,6 @@ jobs: python-version: 3.11 - name: Install python packages run: conda install --yes cartopy matplotlib netcdf4 - # Update system packages - - name: Update system packages - run: sudo apt-get update - # Non compiler-specific environment - - name: Non compiler-specific environment - run: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib ############################################################################### # FORTRAN compilers ############################################################################### @@ -117,7 +111,9 @@ jobs: ############################################################################### # NetCDF C library - name: Install NetCDF library - run: sudo apt-get install libnetcdf-dev + run: | + sudo apt-get update + sudo apt-get install libnetcdf-dev - name: Install NetCDF Fortran library if: contains(matrix.compiler, 'gfortran') @@ -139,6 +135,8 @@ jobs: FCFLAGS: -fPIC run: | source /opt/intel/oneapi/setvars.sh || true + which ifort + which ifx ${F90} --version git clone https://github.com/Unidata/netcdf-fortran.git --branch v4.4.4 cd netcdf-fortran From a2d85e23ae5dd5d07a497a7239bd98e3b56ab6c6 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:23:43 +0100 Subject: [PATCH 09/41] Another place --- build/Makefile.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Makefile.conf b/build/Makefile.conf index 7c6e79379b..508f04a27a 100644 --- a/build/Makefile.conf +++ b/build/Makefile.conf @@ -1,6 +1,6 @@ #F90 = gfortran #F90FLAGS = -O3 -ffree-line-length-none -fcheck=bounds -finit-real=nan -F90_LIB = /home/runner/netcdf-fortran -NC_INC = -I$(F90_LIB)/include -NC_LIB = -L$(F90_LIB)/lib +F90_LIB = ${NFHOME} +NC_INC = -I$(NFHOME)/include +NC_LIB = -L$(NFHOME)/lib From 587dea2def5650a089f9350a4957f693249286f0 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:27:52 +0100 Subject: [PATCH 10/41] Iteration --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index dec08007c2..8f5deb9fb1 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -95,7 +95,7 @@ jobs: ############################################################################### - name: Environment for Gfortran compiler if: contains(matrix.compiler, 'gfortran') - run: echo "NFHOME=/usr/include" > $GITHUB_ENV + run: echo "NFHOME=/usr" > $GITHUB_ENV - name: Environment for ifort compiler if: contains(matrix.compiler, 'ifort') From e039ab5cd1735c558bc2eea6a3025acf8e64a10a Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:41:13 +0100 Subject: [PATCH 11/41] Containerized CI --- .github/workflows/containerized-ci.yml | 148 +++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 .github/workflows/containerized-ci.yml diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml new file mode 100644 index 0000000000..b58eacf581 --- /dev/null +++ b/.github/workflows/containerized-ci.yml @@ -0,0 +1,148 @@ +name: Continuous integration in containers +on: [push, pull_request, workflow_dispatch] + +jobs: + Containerized-CI: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [ifort, ifx, nvfortran] + include: + # Set flags for Intel Fortran Compiler Classic + - compiler: ifort + fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 + # Set flags for Intel Fortran Compiler + - compiler: ifx + fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 + # Set flags for NVIDIA Fortran compiler + - compiler: nvfortran + fcflags: -Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk + # Set container images + - compiler: ifort + image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi + - compiler: ifx + image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi + - compiler: nvfortran + image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:nvhpc + container: + image: ${{ matrix.image }} + env: + F90: ${{ matrix.compiler }} + FC: ${{ matrix.compiler }} + F90FLAGS: ${{ fcflags }} + # Make variables: + NFHOME: /opt/netcdf-fortran + ATOL: 0.0 + RTOL: 0.0 + KGO_VERSION: v002 + + steps: + ############################################################################### + # Build COSP and retrieve input and test files + ############################################################################### + # Build COSP2 driver. Intel Fortran stores automatic arrays in the stack + # by default, whereas GNU Fortran stores them in the heap. This can cause + # segmentation faults with ifort, especially in memory-intensive applications + # like COSP. We tell ifort to use heap arrays. + - name: Build driver + run: | + source /opt/intel/oneapi/setvars.sh || true + ${F90} --version + cd build + make -j driver + # Retrieve and expand large data files + - name: Retrieve data files + run: | + GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU' + OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz + wget --no-check-certificate $GDFILE -O $OUTPATH + gunzip ${OUTPATH} + cd driver/data/inputs/UKMO + md5sum -c cosp_input.um_global.nc.md5 + cd ${GITHUB_WORKSPACE} + GDFILE='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.gz + wget --no-check-certificate $GDFILE -O $OUTPATH + gunzip ${OUTPATH} + cd driver/data/outputs/UKMO + md5sum -c cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.md5 + cd ${GITHUB_WORKSPACE} + GDFILE='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' + OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.gz + wget --no-check-certificate $GDFILE -O $OUTPATH + gunzip ${OUTPATH} + cd driver/data/outputs/UKMO + md5sum -c cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.md5 + cd ${GITHUB_WORKSPACE} + GDFILE='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.gz + wget --no-check-certificate $GDFILE -O $OUTPATH + gunzip ${OUTPATH} + cd driver/data/outputs/UKMO + md5sum -c cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.md5 + ############################################################################### + # Run COSP2 tests. We could run both tests in one step, but + # doing it this way the output is easier to interpret. + ############################################################################### + # 1. Basic test + - name: Basic test, UM global snapshot + run: | + cd driver/run + ./cosp2_test cosp2_input_nl.txt + ./cosp2_test cosp2_input_nl.um_global.txt + ############################################################################### + # Compare results against known good outputs. As above, + # we split it in as many steps as tests. + ############################################################################### + # 1. Basic test + - name: Basic against known good output (KGO) + run: | + cd driver + KGO=data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc + TST=data/outputs/UKMO/cosp2_output_um.nc + python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} + # 2. UM global snapshot. The approach used for the basic test would needed + # large tolerances for the ifort compiler. We keep tolerances small for ifort, + # and then we test against the output table. + - name: UM global against known good output (KGO) + run: | + cd driver + KGO=data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc + TST=data/outputs/UKMO/cosp2_output.um_global.nc + ATOL=1.0e-20 + RTOL=0.0006 + OUTTST=data/outputs/UKMO/cosp2_output.um_global.out + OUTKGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.${KGO_VERSION}.out + python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} \ + --noerror=True --stats_file=${OUTTST} + diff ${OUTKGO} ${OUTTST} + ############################################################################### + # Produce plots when it fails during global snapshot tests, + # and create a tarball with outputs. + ############################################################################### + - name: Produce plots and create tarball + if: failure() + run: | + TST_MLEV=data/outputs/UKMO/cosp2_output.um_global_model_levels.nc + cd driver + if [[ -e data/outputs/UKMO/cosp2_output.um_global.nc ]]; then + python plot_test_outputs.py + fi + if [[ -e data/outputs/UKMO/cosp2_output.um_global_model_levels.nc ]]; then + python plot_test_outputs.py --tst_file=$TST_MLEV + fi + cd data/outputs/UKMO + tar --ignore-failed-read -czf outputs.UKMO.tgz cosp2_output.um_global.nc \ + cosp2_output_um.nc cosp2_output.um_global_model_levels.nc *.png \ + cosp2_output.um_global.out + ls -lh + ############################################################################### + # Make output files available if any test fails + ############################################################################### + - name: Upload output file if test fails + if: failure() + uses: actions/upload-artifact@v1.0.0 + with: + name: outputs.UKMO.tgz + path: driver/data/outputs/UKMO/outputs.UKMO.tgz From d38c1fe2d1e5278ca078a2208dca750325dda285 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:43:25 +0100 Subject: [PATCH 12/41] YML syntax --- .github/workflows/containerized-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index b58eacf581..42a245f98e 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -30,7 +30,7 @@ jobs: env: F90: ${{ matrix.compiler }} FC: ${{ matrix.compiler }} - F90FLAGS: ${{ fcflags }} + F90FLAGS: ${{ matrix.fcflags }} # Make variables: NFHOME: /opt/netcdf-fortran ATOL: 0.0 From b9d4352c6208ce101a1b38a9078e122139fb8344 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:48:05 +0100 Subject: [PATCH 13/41] Don't source a file --- .github/workflows/containerized-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 42a245f98e..1adfd2f815 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -47,7 +47,6 @@ jobs: # like COSP. We tell ifort to use heap arrays. - name: Build driver run: | - source /opt/intel/oneapi/setvars.sh || true ${F90} --version cd build make -j driver From 1a1657f3e54e0c436c83687f4768277f9addb58c Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:53:42 +0100 Subject: [PATCH 14/41] Gotta check out the code... --- .github/workflows/containerized-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 1adfd2f815..c258facc75 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -38,6 +38,11 @@ jobs: KGO_VERSION: v002 steps: + # + # Checks-out repository under $GITHUB_WORKSPACE + # + - uses: actions/checkout@v4 + ############################################################################### # Build COSP and retrieve input and test files ############################################################################### From 16c045f3d1d24ed55ec01dd3ef7bf3308b48bbc8 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Wed, 13 Mar 2024 23:58:48 +0100 Subject: [PATCH 15/41] Can we install aot-get in a container? --- .github/workflows/containerized-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index c258facc75..5fe278fe39 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -42,7 +42,7 @@ jobs: # Checks-out repository under $GITHUB_WORKSPACE # - uses: actions/checkout@v4 - + ############################################################################### # Build COSP and retrieve input and test files ############################################################################### @@ -58,6 +58,7 @@ jobs: # Retrieve and expand large data files - name: Retrieve data files run: | + sudo apt-get install wget GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU' OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz wget --no-check-certificate $GDFILE -O $OUTPATH From 3912acd6221c449cec27225c220eece72843402b Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Thu, 14 Mar 2024 12:16:42 +0100 Subject: [PATCH 16/41] Remove Intel compiler and related complications from default CI --- .github/workflows/continuous_integration.yml | 109 ++----------------- 1 file changed, 7 insertions(+), 102 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 8f5deb9fb1..ba161c239a 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -37,11 +37,12 @@ jobs: strategy: fail-fast: false matrix: - compiler: [gfortran-10, gfortran-11, gfortran-12, ifort] + compiler: [gfortran-10, gfortran-11, gfortran-12] env: F90: ${{ matrix.compiler }} FC: ${{ matrix.compiler }} F90FLAGS: "-O3 -ffree-line-length-none -fcheck=bounds -finit-real=nan" + NFHOME: /usr ATOL: 0.0 RTOL: 0.0 KGO_VERSION: v002 @@ -63,96 +64,18 @@ jobs: python-version: 3.11 - name: Install python packages run: conda install --yes cartopy matplotlib netcdf4 - ############################################################################### - # FORTRAN compilers - ############################################################################### - # - # Intel compilers - # - - name: cache-intel-compilers - id: cache-intel-compilers - if: contains(matrix.compiler, 'ifort') - uses: actions/cache@v2 - with: - path: /opt/intel - key: intel-${{ runner.os }}-compilers-b - - # https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html - # List of packages from Docler file at - # https://github.com/intel/oneapi-containers/blob/master/images/docker/hpckit-devel-ubuntu18.04/Dockerfile - - name: Install Intel compilers and libraries - if: contains(matrix.compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true' - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" - sudo apt-get update - sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars - sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac - - ############################################################################### - # Compiler-specific environment - ############################################################################### - - name: Environment for Gfortran compiler - if: contains(matrix.compiler, 'gfortran') - run: echo "NFHOME=/usr" > $GITHUB_ENV - - - name: Environment for ifort compiler - if: contains(matrix.compiler, 'ifort') - run: | - echo "CC=icx" > $GITHUB_ENV - echo "FC=ifort" > $GITHUB_ENV - echo "F90FLAGS=-O3 -heap-arrays" > $GITHUB_ENV - echo "NFHOME=/home/runner/netcdf-fortran" > $GITHUB_ENV - echo "LD_LIBRARY_PATH=/home/runner/netcdf-fortran/lib" > $GITHUB_ENV - - ############################################################################### # NetCDF C and FORTRAN libraries - ############################################################################### - # NetCDF C library - name: Install NetCDF library run: | sudo apt-get update - sudo apt-get install libnetcdf-dev - - - name: Install NetCDF Fortran library - if: contains(matrix.compiler, 'gfortran') - run: sudo apt-get install libnetcdff-dev - - # Cache netcdf FORTRAN library - - name: cache-netcdf-fortran - id: cache-netcdf-fortran - if: contains(matrix.compiler, 'ifort') - uses: actions/cache@v2 - with: - path: /home/runner/netcdf-fortran - key: netcdf-fortran-4.4.4a-${{ runner.os }}-${{ matrix.compiler }}-v02 + sudo apt-get install libnetcdff-dev - # Build NetCDF FORTRAN library for current compiler - - name: Build NetCDF FORTRAN library - if: contains(matrix.compiler, 'ifort') && steps.cache-netcdf-fortran.outputs.cache-hit != 'true' - env: - FCFLAGS: -fPIC - run: | - source /opt/intel/oneapi/setvars.sh || true - which ifort - which ifx - ${F90} --version - git clone https://github.com/Unidata/netcdf-fortran.git --branch v4.4.4 - cd netcdf-fortran - ./configure --prefix=${NFHOME} - make -j - sudo make install ############################################################################### # Build COSP and retrieve input and test files ############################################################################### - # Build COSP2 driver. Intel Fortran stores automatic arrays in the stack - # by default, whereas GNU Fortran stores them in the heap. This can cause - # segmentation faults with ifort, especially in memory-intensive applications - # like COSP. We tell ifort to use heap arrays. + # Build COSP2 driver. - name: Build driver run: | - source /opt/intel/oneapi/setvars.sh || true ${F90} --version cd build make -j driver @@ -199,7 +122,6 @@ jobs: ./cosp2_test cosp2_input_nl.um_global.txt # 2. UM global snapshot. Diagnostics on model levels. - name: UM global snapshot. Diagnostics on model levels. - if: contains(matrix.compiler, 'gfortran') run: | cd driver/run ./cosp2_test cosp2_input_nl.um_global_model_levels.txt cosp2_output_nl.um_global_model_levels.txt @@ -210,36 +132,19 @@ jobs: # 1. Basic test - name: Basic against known good output (KGO) run: | - if [[ "${F90}" != 'gfortran' ]]; then - ATOL=1.0e-20 - RTOL=0.0006 - fi cd driver KGO=data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output_um.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} - # 2. UM global snapshot. The approach used for the basic test would needed - # large tolerances for the ifort compiler. We keep tolerances small for ifort, - # and then we test against the output table. + # 2. UM global snapshot. - name: UM global against known good output (KGO) run: | cd driver KGO=data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global.nc - if [[ "${F90}" = 'gfortran' ]]; then - python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} - else - ATOL=1.0e-20 - RTOL=0.0006 - OUTTST=data/outputs/UKMO/cosp2_output.um_global.out - OUTKGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.${KGO_VERSION}.out - python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} \ - --noerror=True --stats_file=${OUTTST} - diff ${OUTKGO} ${OUTTST} - fi - # 3. UM global snapshot. Diagnostics on model levels. Only gfortran. + python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} + # 3. UM global snapshot. Diagnostics on model levels. - name: UM global on model levels against known good output (KGO) - if: contains(matrix.compiler, 'gfortran') run: | cd driver KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc From 4e22632248d62db50563eafed471293268f58ea1 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 17:45:17 +0000 Subject: [PATCH 17/41] Test curl --- .github/workflows/containerized-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 5fe278fe39..d248151eab 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -58,31 +58,30 @@ jobs: # Retrieve and expand large data files - name: Retrieve data files run: | - sudo apt-get install wget GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU' OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + curl -sSfL -o $OUTPATH $GDFILE gunzip ${OUTPATH} cd driver/data/inputs/UKMO md5sum -c cosp_input.um_global.nc.md5 cd ${GITHUB_WORKSPACE} GDFILE='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + curl -sSfL -o $OUTPATH $GDFILE gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} GDFILE='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + curl -sSfL -o $OUTPATH $GDFILE gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} GDFILE='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + curl -sSfL -o $OUTPATH $GDFILE gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.md5 From 29c3ec86825be74ebfc983780d49edcaa0ea31c1 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 17:51:56 +0000 Subject: [PATCH 18/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index d248151eab..a56a792708 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ifort, ifx, nvfortran] + compiler: [ifort, ifx] include: # Set flags for Intel Fortran Compiler Classic - compiler: ifort From 44ead0e8940b864e1ed94d28213c4ad64bbed430 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 18:03:06 +0000 Subject: [PATCH 19/41] No nvfortran (temporarily) --- .github/workflows/containerized-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index a56a792708..08cb216ba7 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -23,8 +23,6 @@ jobs: image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi - compiler: ifx image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi - - compiler: nvfortran - image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:nvhpc container: image: ${{ matrix.image }} env: From 3216b27f6b439385acbcecb907185691e799cbf2 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 18:08:03 +0000 Subject: [PATCH 20/41] No nvfortran flags. --- .github/workflows/containerized-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 08cb216ba7..8e0653c2da 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -15,9 +15,6 @@ jobs: # Set flags for Intel Fortran Compiler - compiler: ifx fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 - # Set flags for NVIDIA Fortran compiler - - compiler: nvfortran - fcflags: -Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk # Set container images - compiler: ifort image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi From 23aa9693790a86c212e193219072b18fc754b140 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 19:28:55 +0000 Subject: [PATCH 21/41] Only ifort --- .github/workflows/containerized-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 8e0653c2da..1790bc1d6d 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -7,19 +7,19 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ifort, ifx] + compiler: [ifort] include: # Set flags for Intel Fortran Compiler Classic - compiler: ifort fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 - # Set flags for Intel Fortran Compiler - - compiler: ifx - fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 + # # Set flags for Intel Fortran Compiler + # - compiler: ifx + # fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 # Set container images - compiler: ifort image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi - - compiler: ifx - image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi + # - compiler: ifx + # image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi container: image: ${{ matrix.image }} env: From 094461795a5d65ef7aa7dee8c1a96b126dc15fe1 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 20:47:41 +0000 Subject: [PATCH 22/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 39 ++++++++++++++++---------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 1790bc1d6d..695d2feca2 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -51,7 +51,7 @@ jobs: cd build make -j driver # Retrieve and expand large data files - - name: Retrieve data files + - name: Retrieve input files run: | GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU' OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz @@ -59,27 +59,36 @@ jobs: gunzip ${OUTPATH} cd driver/data/inputs/UKMO md5sum -c cosp_input.um_global.nc.md5 + - name: Retrieve KGOs + run: | + if [[ "${F90}" = 'gfortran' ]]; then + GDFILE1='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' + GDFILE2='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' + GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' + fi + if [[ "${F90}" = 'ifort' ]]; then + GDFILE1='https://drive.google.com/file/d/1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T/view?usp=sharing' + GDFILE2='https://drive.google.com/file/d/1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP/view?usp=drive_link' + GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' + fi cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDFILE1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' - OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE + OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDFILE2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.$F90.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDFILE3 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.md5 ############################################################################### # Run COSP2 tests. We could run both tests in one step, but # doing it this way the output is easier to interpret. @@ -98,7 +107,7 @@ jobs: - name: Basic against known good output (KGO) run: | cd driver - KGO=data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc + KGO=data/outputs/UKMO/cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output_um.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} # 2. UM global snapshot. The approach used for the basic test would needed @@ -107,7 +116,7 @@ jobs: - name: UM global against known good output (KGO) run: | cd driver - KGO=data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc + KGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global.nc ATOL=1.0e-20 RTOL=0.0006 From 8a16cd2cd94bda26d041c1bad0ab6eef3e34eff1 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Thu, 14 Mar 2024 21:00:58 +0000 Subject: [PATCH 23/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 695d2feca2..35333a82a4 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -67,8 +67,8 @@ jobs: GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' fi if [[ "${F90}" = 'ifort' ]]; then - GDFILE1='https://drive.google.com/file/d/1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T/view?usp=sharing' - GDFILE2='https://drive.google.com/file/d/1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP/view?usp=drive_link' + GDFILE1='https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T' + GDFILE2='https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP' GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' fi cd ${GITHUB_WORKSPACE} From 68a8b6be28118259bc70632bea19d6b37bce8349 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 09:40:25 +0000 Subject: [PATCH 24/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 45 +++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 35333a82a4..097678bddc 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -12,6 +12,9 @@ jobs: # Set flags for Intel Fortran Compiler Classic - compiler: ifort fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 + gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T + gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP + gdkgo3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 # # Set flags for Intel Fortran Compiler # - compiler: ifx # fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 @@ -28,10 +31,13 @@ jobs: F90FLAGS: ${{ matrix.fcflags }} # Make variables: NFHOME: /opt/netcdf-fortran + # KGO tests variables ATOL: 0.0 RTOL: 0.0 KGO_VERSION: v002 - + GDKGO1: ${{ matrix.gdkgo1 }} + GDKGO2: ${{ matrix.gdkgo2 }} + GDKGO3: ${{ matrix.gdkgo3 }} steps: # # Checks-out repository under $GITHUB_WORKSPACE @@ -59,33 +65,27 @@ jobs: gunzip ${OUTPATH} cd driver/data/inputs/UKMO md5sum -c cosp_input.um_global.nc.md5 - - name: Retrieve KGOs + - name: Retrieve KGOs for basic test run: | - if [[ "${F90}" = 'gfortran' ]]; then - GDFILE1='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' - GDFILE2='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' - GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' - fi - if [[ "${F90}" = 'ifort' ]]; then - GDFILE1='https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T' - GDFILE2='https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP' - GDFILE3='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' - fi cd ${GITHUB_WORKSPACE} OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE1 + curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 + - name: Retrieve KGOs for global test + run: | cd ${GITHUB_WORKSPACE} OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE2 + curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 + - name: Retrieve KGOs for model levels outputs test + run: | cd ${GITHUB_WORKSPACE} OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.$F90.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDFILE3 + curl -sSfL -o $OUTPATH $GDKGO3 gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.md5 @@ -118,13 +118,14 @@ jobs: cd driver KGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global.nc - ATOL=1.0e-20 - RTOL=0.0006 - OUTTST=data/outputs/UKMO/cosp2_output.um_global.out - OUTKGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.${KGO_VERSION}.out - python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} \ - --noerror=True --stats_file=${OUTTST} - diff ${OUTKGO} ${OUTTST} + python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} + # ATOL=1.0e-20 + # RTOL=0.0006 + # OUTTST=data/outputs/UKMO/cosp2_output.um_global.out + # OUTKGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.${KGO_VERSION}.out + # python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} \ + # --noerror=True --stats_file=${OUTTST} + # diff ${OUTKGO} ${OUTTST} ############################################################################### # Produce plots when it fails during global snapshot tests, # and create a tarball with outputs. From 0657cd826f527a534fe9585d6fd134dd383cb240 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 09:48:22 +0000 Subject: [PATCH 25/41] ifort v002 md5 files --- .../outputs/UKMO/cosp2_output.um_global.ifort.kgo.v002.nc.md5 | 1 + driver/data/outputs/UKMO/cosp2_output_um.ifort.kgo.v002.nc.md5 | 1 + 2 files changed, 2 insertions(+) create mode 100644 driver/data/outputs/UKMO/cosp2_output.um_global.ifort.kgo.v002.nc.md5 create mode 100644 driver/data/outputs/UKMO/cosp2_output_um.ifort.kgo.v002.nc.md5 diff --git a/driver/data/outputs/UKMO/cosp2_output.um_global.ifort.kgo.v002.nc.md5 b/driver/data/outputs/UKMO/cosp2_output.um_global.ifort.kgo.v002.nc.md5 new file mode 100644 index 0000000000..9a8c3d0ee0 --- /dev/null +++ b/driver/data/outputs/UKMO/cosp2_output.um_global.ifort.kgo.v002.nc.md5 @@ -0,0 +1 @@ +c8c21f8d4cf8de96e7e2db0bc93d0f3e cosp2_output.um_global.ifort.kgo.v002.nc diff --git a/driver/data/outputs/UKMO/cosp2_output_um.ifort.kgo.v002.nc.md5 b/driver/data/outputs/UKMO/cosp2_output_um.ifort.kgo.v002.nc.md5 new file mode 100644 index 0000000000..b997cc786f --- /dev/null +++ b/driver/data/outputs/UKMO/cosp2_output_um.ifort.kgo.v002.nc.md5 @@ -0,0 +1 @@ +fb0ba88dc9df95bf67d06442c3a85394 cosp2_output_um.ifort.kgo.v002.nc From fa810cd0935c820d1bd8f0b80a5ff3e5c2dc2de0 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 10:54:58 +0000 Subject: [PATCH 26/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 097678bddc..8af1a82f8a 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -14,7 +14,6 @@ jobs: fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP - gdkgo3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 # # Set flags for Intel Fortran Compiler # - compiler: ifx # fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 @@ -37,7 +36,6 @@ jobs: KGO_VERSION: v002 GDKGO1: ${{ matrix.gdkgo1 }} GDKGO2: ${{ matrix.gdkgo2 }} - GDKGO3: ${{ matrix.gdkgo3 }} steps: # # Checks-out repository under $GITHUB_WORKSPACE @@ -68,7 +66,7 @@ jobs: - name: Retrieve KGOs for basic test run: | cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz + OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO @@ -76,25 +74,15 @@ jobs: - name: Retrieve KGOs for global test run: | cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 - - name: Retrieve KGOs for model levels outputs test - run: | - cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.$F90.kgo.$KGO_VERSION.nc.gz - curl -sSfL -o $OUTPATH $GDKGO3 - gunzip ${OUTPATH} - cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.md5 ############################################################################### - # Run COSP2 tests. We could run both tests in one step, but - # doing it this way the output is easier to interpret. + # Run COSP2 tests. Basic test and UM global snapshot ############################################################################### - # 1. Basic test - - name: Basic test, UM global snapshot + - name: Basic test and UM global snapshot run: | cd driver/run ./cosp2_test cosp2_input_nl.txt From f21e3cb01460af4ff89701e92eddcc86bca42d48 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 11:13:33 +0000 Subject: [PATCH 27/41] Update containerized-ci.yml --- .github/workflows/containerized-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 8af1a82f8a..b076d7f7e1 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -70,7 +70,7 @@ jobs: curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 - name: Retrieve KGOs for global test run: | cd ${GITHUB_WORKSPACE} @@ -78,7 +78,7 @@ jobs: curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 ############################################################################### # Run COSP2 tests. Basic test and UM global snapshot ############################################################################### From 18bf6593575f07c83128fcca236e05027852d26e Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 11:22:51 +0000 Subject: [PATCH 28/41] Produce ifx KGOs --- .github/workflows/containerized-ci.yml | 31 ++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index b076d7f7e1..fe48c959b1 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -7,21 +7,23 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ifort] + compiler: [ifx] include: # Set flags for Intel Fortran Compiler Classic - - compiler: ifort - fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 + # - compiler: ifort + # fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 + # gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T + # gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP + # Set flags for Intel Fortran Compiler + - compiler: ifx + fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP - # # Set flags for Intel Fortran Compiler - # - compiler: ifx - # fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 # Set container images - - compiler: ifort - image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi - # - compiler: ifx + # - compiler: ifort # image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi + - compiler: ifx + image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi container: image: ${{ matrix.image }} env: @@ -98,22 +100,13 @@ jobs: KGO=data/outputs/UKMO/cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output_um.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} - # 2. UM global snapshot. The approach used for the basic test would needed - # large tolerances for the ifort compiler. We keep tolerances small for ifort, - # and then we test against the output table. + # 2. UM global snapshot. - name: UM global against known good output (KGO) run: | cd driver KGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} - # ATOL=1.0e-20 - # RTOL=0.0006 - # OUTTST=data/outputs/UKMO/cosp2_output.um_global.out - # OUTKGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.${KGO_VERSION}.out - # python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} \ - # --noerror=True --stats_file=${OUTTST} - # diff ${OUTKGO} ${OUTTST} ############################################################################### # Produce plots when it fails during global snapshot tests, # and create a tarball with outputs. From dc1d0aa4d88794e48fd287327ce1a8f1a3f6789a Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 11:28:06 +0000 Subject: [PATCH 29/41] Produce ifx KGOs --- .github/workflows/containerized-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index fe48c959b1..7d3f72fc38 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -72,7 +72,7 @@ jobs: curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 + # md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 - name: Retrieve KGOs for global test run: | cd ${GITHUB_WORKSPACE} @@ -80,7 +80,7 @@ jobs: curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 + # md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 ############################################################################### # Run COSP2 tests. Basic test and UM global snapshot ############################################################################### From 462433eb19de8a783d7873ed60e50d24741b327b Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 14:48:19 +0000 Subject: [PATCH 30/41] ifx v002 KGOs md5 files --- .../data/outputs/UKMO/cosp2_output.um_global.ifx.kgo.v002.nc.md5 | 1 + driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v002.nc.md5 | 1 + 2 files changed, 2 insertions(+) create mode 100644 driver/data/outputs/UKMO/cosp2_output.um_global.ifx.kgo.v002.nc.md5 create mode 100644 driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v002.nc.md5 diff --git a/driver/data/outputs/UKMO/cosp2_output.um_global.ifx.kgo.v002.nc.md5 b/driver/data/outputs/UKMO/cosp2_output.um_global.ifx.kgo.v002.nc.md5 new file mode 100644 index 0000000000..c7de89c4fd --- /dev/null +++ b/driver/data/outputs/UKMO/cosp2_output.um_global.ifx.kgo.v002.nc.md5 @@ -0,0 +1 @@ +bed330b229dbdd674a11e0f8c65f011f cosp2_output.um_global.ifx.kgo.v002.nc diff --git a/driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v002.nc.md5 b/driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v002.nc.md5 new file mode 100644 index 0000000000..60366f0b0e --- /dev/null +++ b/driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v002.nc.md5 @@ -0,0 +1 @@ +23b30d93bafd5942c7b70f034885eeec cosp2_output_um.ifx.kgo.v002.nc From 219766b83aacc4813005f40f2ea781aed5aede53 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 14:53:36 +0000 Subject: [PATCH 31/41] ifx KGOs urls --- .github/workflows/containerized-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index 7d3f72fc38..af576197f6 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -17,8 +17,8 @@ jobs: # Set flags for Intel Fortran Compiler - compiler: ifx fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 - gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T - gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP + gdkgo1: https://docs.google.com/uc?export=download&id=19N7wXou-2Zv0oVAnwn4Ucs8Ghr-C0SMt + gdkgo2: https://docs.google.com/uc?export=download&id=1EUO6C_v0rq0NMXkLGqZDKX99kknnMRQN # Set container images # - compiler: ifort # image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi From 43a0c29ac3f215a12c5297f6b4d64acc9179dc89 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 15:05:00 +0000 Subject: [PATCH 32/41] Update actions versions in gfortran CI tests --- .github/workflows/continuous_integration.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index ba161c239a..986ed65012 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -26,12 +26,12 @@ # THE POSSIBILITY OF SUCH DAMAGE. # Workflow for continuous integration tests -name: CI +name: Continuous integration gfortran compilers on: [push, pull_request, workflow_dispatch] jobs: - # This workflow contains a single job called "test" - test: + # This workflow contains a single job called "ci_gfortran" + ci_gfortran: # The type of runner that the job will run on runs-on: ubuntu-22.04 strategy: @@ -52,10 +52,10 @@ jobs: # Initial steps ############################################################################### # Checks-out repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Set up Python and install dependencies - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.11 - name: Setup conda From 5dafead780500f84f95623d06ab7a713ead31464 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 15:45:42 +0000 Subject: [PATCH 33/41] Download files using same logic in both CI workflows. --- .github/workflows/continuous_integration.yml | 34 ++++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 986ed65012..505caa6890 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -46,6 +46,9 @@ jobs: ATOL: 0.0 RTOL: 0.0 KGO_VERSION: v002 + GDKGO1: https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq + GDKGO2: https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar + GDKGO3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 # Sequence of tasks that will be executed as part of the job steps: ############################################################################### @@ -80,35 +83,38 @@ jobs: cd build make -j driver # Retrieve and expand large data files - - name: Retrieve data files + - name: Retrieve input files run: | GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU' OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + curl -sSfL -o $OUTPATH $GDFILE gunzip ${OUTPATH} cd driver/data/inputs/UKMO md5sum -c cosp_input.um_global.nc.md5 + - name: Retrieve KGOs for basic test + run: | cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar' - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 + - name: Retrieve KGOs for global test + run: | cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq' - OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} + - name: Retrieve KGOs for global test with outputs on model levels + run: | cd ${GITHUB_WORKSPACE} - GDFILE='https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2' - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.gz - wget --no-check-certificate $GDFILE -O $OUTPATH + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.gz + curl -sSfL -o $OUTPATH $GDKGO3 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} ############################################################################### # Run COSP2 tests. We could run both tests in one step, but # doing it this way the output is easier to interpret. From 2960f60d8fc30f4350f6294823b3368448e3fd52 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 15:59:21 +0000 Subject: [PATCH 34/41] Same short name for all gfortran compilers --- .github/workflows/continuous_integration.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 505caa6890..4d38b21fec 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -49,6 +49,7 @@ jobs: GDKGO1: https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq GDKGO2: https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar GDKGO3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 + F90_SHORT_NAME: gfortran # Sequence of tasks that will be executed as part of the job steps: ############################################################################### @@ -94,27 +95,28 @@ jobs: - name: Retrieve KGOs for basic test run: | cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz + OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.gz curl -sSfL -o $OUTPATH $GDKGO1 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5 + md5sum -c cosp2_output_um.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.md5 - name: Retrieve KGOs for global test run: | cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.gz curl -sSfL -o $OUTPATH $GDKGO2 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} + md5sum -c cosp2_output.um_global.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.md5 + cd ${GITHUB_WORKSPACE} - name: Retrieve KGOs for global test with outputs on model levels run: | cd ${GITHUB_WORKSPACE} - OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.gz + OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.gz curl -sSfL -o $OUTPATH $GDKGO3 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global_model_levels.${F90}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} + md5sum -c cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} ############################################################################### # Run COSP2 tests. We could run both tests in one step, but # doing it this way the output is easier to interpret. @@ -139,21 +141,21 @@ jobs: - name: Basic against known good output (KGO) run: | cd driver - KGO=data/outputs/UKMO/cosp2_output_um.gfortran.kgo.$KGO_VERSION.nc + KGO=data/outputs/UKMO/cosp2_output_um.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output_um.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} # 2. UM global snapshot. - name: UM global against known good output (KGO) run: | cd driver - KGO=data/outputs/UKMO/cosp2_output.um_global.gfortran.kgo.$KGO_VERSION.nc + KGO=data/outputs/UKMO/cosp2_output.um_global.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} # 3. UM global snapshot. Diagnostics on model levels. - name: UM global on model levels against known good output (KGO) run: | cd driver - KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.gfortran.kgo.$KGO_VERSION.nc + KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc TST=data/outputs/UKMO/cosp2_output.um_global_model_levels.nc python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} ############################################################################### From a89bd460fcaee9d3173ff841b5fee39a39398ada Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 16:13:00 +0000 Subject: [PATCH 35/41] Fix typo. --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 4d38b21fec..63714b7308 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -116,7 +116,7 @@ jobs: curl -sSfL -o $OUTPATH $GDKGO3 gunzip ${OUTPATH} cd driver/data/outputs/UKMO - md5sum -c cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.md5 cd ${GITHUB_WORKSPACE} + md5sum -c cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.md5 ############################################################################### # Run COSP2 tests. We could run both tests in one step, but # doing it this way the output is easier to interpret. From 235d5483100d30aa53f8c55d71c9a5e8149da51c Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 16:28:23 +0000 Subject: [PATCH 36/41] Update actions versions. --- .github/workflows/continuous_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 63714b7308..4ab55253a7 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -59,11 +59,11 @@ jobs: - uses: actions/checkout@v4 # Set up Python and install dependencies - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: Setup conda - uses: s-weigand/setup-conda@v1 + uses: s-weigand/setup-conda@v1.2.1 with: python-version: 3.11 - name: Install python packages From b876e61fa54d08368b7716aa4fd4c83d341d3107 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 16:40:04 +0000 Subject: [PATCH 37/41] Use conda-incubator/setup-miniconda --- .github/workflows/continuous_integration.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 4ab55253a7..88e4b158bf 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -38,6 +38,7 @@ jobs: fail-fast: false matrix: compiler: [gfortran-10, gfortran-11, gfortran-12] + python-version: 3.11 env: F90: ${{ matrix.compiler }} FC: ${{ matrix.compiler }} @@ -61,11 +62,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: ${{ matrix.python-version }} - name: Setup conda - uses: s-weigand/setup-conda@v1.2.1 + # uses: s-weigand/setup-conda@v1.2.1 + # with: + # python-version: 3.11 + uses: conda-incubator/setup-miniconda@v3.0.3 with: - python-version: 3.11 + auto-update-conda: true + python-version: ${{ matrix.python-version }} - name: Install python packages run: conda install --yes cartopy matplotlib netcdf4 # NetCDF C and FORTRAN libraries From be9fa4d818602c3a300fa5b484d342277498c2a3 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 16:46:23 +0000 Subject: [PATCH 38/41] Fix typo. --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 88e4b158bf..3f84627b6f 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -38,7 +38,7 @@ jobs: fail-fast: false matrix: compiler: [gfortran-10, gfortran-11, gfortran-12] - python-version: 3.11 + python-version: [3.11] env: F90: ${{ matrix.compiler }} FC: ${{ matrix.compiler }} From 964573508ba50e63391c518146f9a7b7562bbaf5 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 19:07:46 +0000 Subject: [PATCH 39/41] Create environment.yml --- build/environment.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 build/environment.yml diff --git a/build/environment.yml b/build/environment.yml new file mode 100644 index 0000000000..276287783e --- /dev/null +++ b/build/environment.yml @@ -0,0 +1,8 @@ +name: ci-env +channels: + - conda-forge + - defaults +dependencies: + - cartopy + - matplotlib + - netcdf4 From b897ded9c1e0290a5dbbe415bd4e228e0504e18d Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 19:11:27 +0000 Subject: [PATCH 40/41] Use conda-incubator/setup-miniconda --- .github/workflows/continuous_integration.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 3f84627b6f..1f028fcbe2 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -39,6 +39,9 @@ jobs: matrix: compiler: [gfortran-10, gfortran-11, gfortran-12] python-version: [3.11] + defaults: + run: + shell: bash -el {0} env: F90: ${{ matrix.compiler }} FC: ${{ matrix.compiler }} @@ -58,21 +61,15 @@ jobs: ############################################################################### # Checks-out repository under $GITHUB_WORKSPACE - uses: actions/checkout@v4 - # Set up Python and install dependencies - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Setup conda - # uses: s-weigand/setup-conda@v1.2.1 - # with: - # python-version: 3.11 + # Set up conda environment + - name: Setup conda environment uses: conda-incubator/setup-miniconda@v3.0.3 with: auto-update-conda: true + activate-environment: ci-env + environment-file: build/environment.yml python-version: ${{ matrix.python-version }} - - name: Install python packages - run: conda install --yes cartopy matplotlib netcdf4 + auto-activate-base: false # NetCDF C and FORTRAN libraries - name: Install NetCDF library run: | From 6b554431064a235b3f685ef4ab278a45617b9593 Mon Sep 17 00:00:00 2001 From: alejandrobodas Date: Fri, 15 Mar 2024 19:19:30 +0000 Subject: [PATCH 41/41] Activate both tests --- .github/workflows/containerized-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index af576197f6..afdfe6bc16 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -7,21 +7,21 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ifx] + compiler: [ifort, ifx] include: - # Set flags for Intel Fortran Compiler Classic - # - compiler: ifort - # fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 - # gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T - # gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP - # Set flags for Intel Fortran Compiler + # Flags and KGOs for Intel Fortran Compiler Classic + - compiler: ifort + fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 + gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T + gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP + # Flags and KGOs for Intel Fortran Compiler - compiler: ifx fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 gdkgo1: https://docs.google.com/uc?export=download&id=19N7wXou-2Zv0oVAnwn4Ucs8Ghr-C0SMt gdkgo2: https://docs.google.com/uc?export=download&id=1EUO6C_v0rq0NMXkLGqZDKX99kknnMRQN # Set container images - # - compiler: ifort - # image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi + - compiler: ifort + image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi - compiler: ifx image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi container: