Skip to content

Commit

Permalink
Merge pull request #100 from CFMIP/kgo_v004
Browse files Browse the repository at this point in the history
Update intel KGOs to v004.
  • Loading branch information
alejandrobodas authored Sep 17, 2024
2 parents 241f1b7 + f08ad7a commit 3fefa6c
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 17 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/containerized-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ jobs:
# 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=1eyRCT9e7j7SKsKhbfJBuwBoN5DlsrW7L
gdkgo2: https://docs.google.com/uc?export=download&id=1uTffyCdWLPvRHDkVtZZiBfc3spbk4_Tf
gdkgo1: https://docs.google.com/uc?export=download&id=1dva4lq4ZXciTiuOvGgA8OUJKihbGQ90K
gdkgo2: https://docs.google.com/uc?export=download&id=1ns0OtWU5jVnu1IEBfBN-tlTkq2PTrcvC
# 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=1VrPkQmDpt6otch-tsaka-62tiMDuJNz_
gdkgo2: https://docs.google.com/uc?export=download&id=1m6JdHlSAMmK8zT-X3pfxSORPJURiITkQ
gdkgo1: https://docs.google.com/uc?export=download&id=1WzFsoqi0EZfsyyh203QXmUQTIh5tBm9b
gdkgo2: https://docs.google.com/uc?export=download&id=1ezYqG-jfZ6i9bRgKOWUyBiQlMhtncpKj
# 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
# Common variables
- kgo_version: v003
- kgo_version: v004
defaults:
run:
shell: bash -el {0}
container:
image: ${{ matrix.image }}
env:
Expand All @@ -45,6 +48,15 @@ jobs:
# Checks-out repository under $GITHUB_WORKSPACE
#
- uses: actions/checkout@v4
# Set up conda environment
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3.0.4
with:
auto-update-conda: true
activate-environment: ci-env
environment-file: build/environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

###############################################################################
# Build COSP and retrieve input and test files
Expand Down Expand Up @@ -99,35 +111,32 @@ jobs:
- name: Basic against known good output (KGO)
run: |
cd driver
KGO=data/outputs/UKMO/cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc
KGO=data/outputs/UKMO/cosp2_output_um.${{ matrix.compiler }}.kgo.$KGO_VERSION.nc
TST=data/outputs/UKMO/cosp2_output_um.nc
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
STATS=data/outputs/UKMO/cosp2_output_um.${{ matrix.compiler }}.out
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} --stats_file=${STATS}
# 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
KGO=data/outputs/UKMO/cosp2_output.um_global.${{ matrix.compiler }}.kgo.$KGO_VERSION.nc
TST=data/outputs/UKMO/cosp2_output.um_global.nc
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
STATS=data/outputs/UKMO/cosp2_output.um_global.${{ matrix.compiler }}.out
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} --stats_file=${STATS}
###############################################################################
# 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.${{ matrix.compiler }}.UKMO.tgz cosp2_output.um_global.nc \
cosp2_output_um.nc cosp2_output.um_global_model_levels.nc *.png \
cosp2_output.um_global.out
cosp2_output_um.nc *.png cosp2_output*.${{ matrix.compiler }}.out
ls -lh
###############################################################################
# Make output files available if any test fails
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ driver/run/cosp2_test
driver/data/inputs/UKMO/*_global.nc
driver/data/outputs/UKMO/*kgo.v*.nc
driver/data/outputs/UKMO/*.nc
driver/data/outputs/UKMO/*.png
!driver/data/outputs/cosp2_output_um.gfortran.kgo.nc
driver/data/outputs/UKMO/*md5
driver/data/outputs/UKMO/*.out
!driver/data/outputs/UKMO/*.out
1 change: 1 addition & 0 deletions driver/compare_to_kgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def print_stats_table(summary_stats, print_all=False, stats_file=None):
if errored:
print(red_colour + "===== ERROR: some of the differences are larger "
"than the tolerances." + std_colour)
print_stats_table(summary_stats, print_all=args.allvar)
print_stats_table(summary_stats, print_all=args.allvar,
stats_file=args.stats_file)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d22e708b28bab19dae4c769fe7d33e40 cosp2_output.um_global.ifort.kgo.v004.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
========================================== Summary statistics ==========================================
Variable N AvgDiff MinDiff MaxDiff StDev
dbze94 6 9.3337e-08 7.0183e-08 1.1649e-07 2.3154e-08
==========================================================================================================
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aa0b47fa93e5d96d2a225a2f50348d30 cosp2_output.um_global.ifx.kgo.v004.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0e75e4adac759d797d1264d76490fa9d cosp2_output_um.ifort.kgo.v004.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d88395d3962b9c25a15d94b13f6db42d cosp2_output_um.ifx.kgo.v004.nc
4 changes: 4 additions & 0 deletions driver/data/outputs/UKMO/cosp2_output_um.ifx.kgo.v004.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
========================================== Summary statistics ==========================================
Variable N AvgDiff MinDiff MaxDiff StDev
dbze94 9526 -8.6491e-08 -7.3010e-04 1.9553e-04 1.1886e-05
==========================================================================================================

0 comments on commit 3fefa6c

Please sign in to comment.