Skip to content

Commit 6e433a6

Browse files
Bugfix in compare_to_kgo (#112)
* Update continuous_integration.yml * Update cosp_config.F90 * Update continuous_integration.yml * Update continuous_integration.yml * Update containerized-ci.yml * Update to KGOs v005 for containerized-ci. * v005 KGO for containerized-ci. * md5 sums for v005 ifort and ifx KGOs. * gfortran KGOs v004. * Undo version upgrade of KGOs in CI tests. * Undo changes in CI workflows. * Add extra bin to force error. * Trap failure in summary_stats. * Trap error in difference and y tick labels. * Always test against KGOs. * Always test against KGOs. * Undo extra ice cloud bin. * Retain original formatting.
1 parent 6137d98 commit 6e433a6

11 files changed

+18
-4
lines changed

.github/workflows/containerized-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ jobs:
117117
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL} --stats_file=${STATS}
118118
# 2. UM global snapshot.
119119
- name: UM global against known good output (KGO)
120+
if: always()
120121
run: |
121122
cd driver
122123
KGO=data/outputs/UKMO/cosp2_output.um_global.${{ matrix.compiler }}.kgo.$KGO_VERSION.nc

.github/workflows/continuous_integration.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,20 @@ jobs:
151151
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
152152
# 2. UM global snapshot.
153153
- name: UM global against known good output (KGO)
154+
if: always()
154155
run: |
155156
cd driver
156157
KGO=data/outputs/UKMO/cosp2_output.um_global.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc
157158
TST=data/outputs/UKMO/cosp2_output.um_global.nc
158159
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
159160
# 3. UM global snapshot. Diagnostics on model levels.
160161
- name: UM global on model levels against known good output (KGO)
162+
if: always()
161163
run: |
162164
cd driver
163165
KGO=data/outputs/UKMO/cosp2_output.um_global_model_levels.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc
164166
TST=data/outputs/UKMO/cosp2_output.um_global_model_levels.nc
165-
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
167+
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
166168
###############################################################################
167169
# Produce plots when it fails during global snapshot tests,
168170
# and create a tarball with outputs.

driver/compare_to_kgo.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ def calculate_stats(tst, kgo, atol=0.0, rtol=None):
7070
"""
7171
summary_stats = {'N':0, 'AvgDiff':0.0, 'MinDiff':0.0, 'MaxDiff':0.0, 'StDev':0.0}
7272
# All differences
73-
d = tst - kgo
73+
try:
74+
d = tst - kgo
75+
except:
76+
print("Error: arrays have different shapes.")
77+
d = kgo
7478
# Mask for differences larger than absolute tolerance
7579
maskAllDiff = (np.absolute(d) > atol)
7680
NallDiff = maskAllDiff.sum()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
71cb2284eb577bc2facec5f28520fdef cosp2_output.um_global.gfortran.kgo.v004.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7ffad70c1e7107371c9a65b7d9c3d37e cosp2_output.um_global.ifort.kgo.v005.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
922e12f2615cdd2fbe3c70cf051e7764 cosp2_output.um_global.ifx.kgo.v005.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
82d35194587672384d5a5d1ad0a84fb2 cosp2_output.um_global_model_levels.gfortran.kgo.v004.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
886365174837f02220e17ec64b601cce cosp2_output_um.gfortran.kgo.v004.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
57bef996ced3ee9553fd5cceb20c8c21 cosp2_output_um.ifort.kgo.v005.nc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
acca99a51056885026fb2fd9f23ca295 cosp2_output_um.ifx.kgo.v005.nc

0 commit comments

Comments
 (0)