Missing lbc_lnk for sshu_a and sshu_b in dynspg_ts
Context
Please provide informations on how to reproduce the bug:
-
Branches impacted: main/all -
Reference configuration/test case (chosen or used as template) : Met Office coupled model (UKESM) -
Computing architecture: Cray cce8.7.7 -
Dependencies: None -
Exposed by preset NAN compiler option (-ei with Cray FORTRAN)
Analysis
dynspg_ts.F90 computes sshu_a and sshu_b in two different locations. These values are not computed across halo/N-fold points. Thus an lbc_lnk call is required to ensure these arrays are a) fully initialised b) up to date in halo/N-fold points.
One instance, around line ~910, after the comment "! Update barotropic trend:" Includes an explicit halo update: CALL lbc_lnk( 'dynspg_ts', zsshu_a, 'U', 1._wp, zsshv_a, 'V', 1._wp )
However another instance around line 610, after the comment "! Sea Surface Height at u-,v-points (vvl case only)" does not. While this is probably not an issue in the normal course of events (since fields calculated based on these values do have halo updates applied to them), it's not a good thing to have partially uninitialised arrays in general, and this is something which shows up and causes issues when debugging code using preset NANs.
Fix
A simple addition of an lbc_lnk for these fields in the appropriate place would suffice (as would simply initialising these arrays to zero, though that would be less preferable).