Commit fc75073
Align merge branch toward dev/ufs-weather-model: fix 3 latent bugs
While minimizing the diff against dev/ufs-weather-model (without changing
answers, breaking exact-restart, or removing CESM-specific code), three
latent bugs were found where the CESM-side code had diverged from the
correct UFS version. Each fix both realigns with UFS and corrects a real
defect; all three are answer-neutral for CESM configs (dormant or no-op on
the active code paths).
1. w3iogrmd.F90: restore the IF(IERR.NE.0) CALL EXTIOF check after the
main mod_def CAPCHNK read. The Functional Charnock cherry-pick (of the
older 14e6bed) had reverted this region to a state lacking the I/O
error check that dev/ufs-weather-model has. No-op on a successful read.
2. wav_shr_mod.F90 (timeInit): read the dummy argument ymd instead of an
uninitialized local 'date'. A dev/unified refactor had added an unset
local integer 'date' and changed tdate=abs(ymd) -> tdate=abs(date) and
if(ymd<0) -> if(date<0), so the routine read an undefined variable.
Only reachable via the optDate alarm path (interval alarms never call
it), so the validated interval-alarm config is unaffected.
3. wav_comp_nuopc.F90 (InitializeRealize): guard the diagnose_mesh size
argument by mesh type. In the unstructured-mesh branch gindex is never
allocated (gindex_sea is used and deallocated), so size(gindex) read an
unallocated array. Use nseal_cpl for the unstructured path, matching
UFS. Only fires for unstructured mesh with dbug_flag>5; structured
grids (e.g. wgx3v7) never reach it.
Verified: full coupled build succeeds; ERS_Ld3.TL319_t232_wg37.GW_JRA
passes exact-restart (COMPARE_base_rest) and reproduces merge_develop
bit-for-bit across WW3, coupler, MOM6, and CICE.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 58482b2 commit fc75073
3 files changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1611 | 1611 | | |
1612 | 1612 | | |
1613 | 1613 | | |
| 1614 | + | |
1614 | 1615 | | |
1615 | 1616 | | |
1616 | 1617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
827 | 831 | | |
828 | 832 | | |
829 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
1302 | | - | |
| 1301 | + | |
1303 | 1302 | | |
1304 | 1303 | | |
1305 | 1304 | | |
| |||
1312 | 1311 | | |
1313 | 1312 | | |
1314 | 1313 | | |
1315 | | - | |
| 1314 | + | |
1316 | 1315 | | |
1317 | | - | |
| 1316 | + | |
1318 | 1317 | | |
1319 | 1318 | | |
1320 | 1319 | | |
| |||
0 commit comments