Skip to content

F/sync with upstream#17

Draft
pieterbartsmit wants to merge 144 commits into
sofar-developfrom
f/sync_with_upstream
Draft

F/sync with upstream#17
pieterbartsmit wants to merge 144 commits into
sofar-developfrom
f/sync_with_upstream

Conversation

@pieterbartsmit

@pieterbartsmit pieterbartsmit commented Jun 15, 2026

Copy link
Copy Markdown

** DRAFT **

Purpose

Syncing sofar-develop with the upstream NOAA develop branch.

Some comments on merge

  • I opted for a merge instead of a rebase; the rebase getting very tiresome. I don't think our git-history is particularly important.
  • I manually resolved all the merge conflicts. Most are relatively straightforward.
  • However- we have a bunch of custom code to handle output of a partitioned variable for energy < 0.1 Hz together with normal partitioned variables. It is hard to see if this was handled correctly.

Issues fixed

  • WW3 IO code was refactored to no longer use (ancient) Fortran goto based exceptions. However, some of our custom code still used the old references producing a compile time error.

  • We use W3_WCOR - a wind speed bias correction. This seems to be genuinely broken in the upstream ww3 codebase. There was a syntax error with a superfluous comma if this option was enabled. (update - known bug since March 26 apparently Syntax error in w3iogrmd.F90 with switch WCOR NOAA-EMC/WW3#1585)

  • Fix merge artifacts and copy-paste bugs in custom second-partitioning code

    • PTHP0 was incorrectly reset to UNDEF instead of PTHP02 (w3iogomd.F90)
    • ASCII write for PNR2 was writing PNR instead (w3iogomd.F90)
    • Duplicate USE WMMDATMD/MDSUPA block from merge conflict (wminitmd.F90)
    • Typo in NetCDF standard name: 'diectional' -> 'directional' (w3ounfmetamd.F90)
  • ** Fix PT12 partition loop regression introduced during upstream merge **
    The upstream refactor replaced explicit IFJ range checks with NOGE(IFI)-2,
    which correctly skips the last two scalar-per-point fields (PWST, PNR).
    However our extension of group 4 to 24 fields (PTMETH2 second partitioning
    scheme) caused PT12 (IFJ=23) to be incorrectly excluded from the partition
    loop, as it is now the second-to-last field despite being partitioned (0:1).
    Added explicit ELSE IF branch for IFJ=23 to restore correct behaviour.

Current Status.

  • The code compiles on my local machine using gfortran on my local machine.
  • I have not yet tested running the code.

ukmo-ccbunney and others added 30 commits July 7, 2023 19:54
…efined in w3odatmd (size=15). Also, defined unit numbers for NDS(14) and NDS(15). (NOAA-EMC#1098)
…ST4 code (NOAA-EMC#1124)

Co-authored-by: Fabrice Ardhuin <fabrice.ardhuin@ifremer.fr>
kestonsmith-noaa and others added 30 commits November 13, 2025 11:09
…ility issues with implicit time stepping on unstructured meshes. (NOAA-EMC#1528)
…AUSS_SEIDEL_BLOCK to address reproducibility issues (NOAA-EMC#1524)
…A-EMC#1564)

w3iosfmd, w3profsmd, w3snl1md, w3src4md, w3srcemd, w3triamd and w3uqckmd
…_JACOBI_GAUSS_SEIDEL_BLOCK to enable bit for bit reproducibility across different numbers of MPI processes. (NOAA-EMC#1538)
…tart reproducibility when variable water level is present and the domain has deep bathymetry. (NOAA-EMC#1589)
…evel and deep bathymetry. In subroutine W3ULEV KDCHK computed from bathymetric depth rather than total water level. (NOAA-EMC#1591)
…ream

# Conflicts:
#	.github/workflows/gnu.yml
#	.github/workflows/intel.yml
#	CMakeLists.txt
#	manual/eqs/ICE4.tex
#	manual/eqs/output.tex
#	manual/manual.bib
#	model/ci/spack_gnu.yaml
#	model/ci/spack_intel.yaml
#	model/inp/ww3_shel.inp
#	model/nml/namelists.nml
#	model/nml/ww3_shel.nml
#	model/src/cmake/switches.json
#	model/src/w3adatmd.F90
#	model/src/w3gdatmd.F90
#	model/src/w3gridmd.F90
#	model/src/w3initmd.F90
#	model/src/w3iogomd.F90
#	model/src/w3iogrmd.F90
#	model/src/w3iopomd.F90
#	model/src/w3iosfmd.F90
#	model/src/w3odatmd.F90
#	model/src/w3ounfmetamd.F90
#	model/src/w3partmd.F90
#	model/src/w3sdb1md.F90
#	model/src/w3sic4md.F90
#	model/src/w3snl1md.F90
#	model/src/w3src4md.F90
#	model/src/w3srcemd.F90
#	model/src/w3wavemd.F90
#	model/src/wminitmd.F90
#	model/src/wmiopomd.F90
#	model/src/ww3_multi.F90
#	model/src/ww3_ounf.F90
#	model/src/ww3_outf.F90
#	model/src/ww3_outp.F90
#	model/src/ww3_shel.F90
#	model/src/ww3_trnc.F90
#	model/tools/bash/ww3_shel_inp2nml.sh
#	regtests/bin/matrix.base
#	regtests/bin/matrix_cmake_ncep
#	regtests/bin/run_cmake_test
#	regtests/unittests/CMakeLists.txt
#	regtests/unittests/test_io_points_bin.F90
#	regtests/ww3_tic1.1/info
#	regtests/ww3_tp2.3/input/namelists_GARDEN.nml
#	regtests/ww3_tp2.3/input/ww3_grid.inp
#	regtests/ww3_ufs1.1/input_unstr/namelists_b.nml
…en removed. Our custom code still refered to these in the read statements.

These labels used to be involved in error handling; and on the happy path should not occur. It is not entirely clear how the new version of ww3 handles potential IO errors. It seems they have just stripped all error handling.

Further there was an error in "wcor" (the linear windspeed enhancement) read syntax statement.
… code

- PTHP0 was incorrectly reset to UNDEF instead of PTHP02 (w3iogomd.F90)
- ASCII write for PNR2 was writing PNR instead (w3iogomd.F90)
- Duplicate USE WMMDATMD/MDSUPA block from merge conflict (wminitmd.F90)
- Typo in NetCDF standard name: 'diectional' -> 'directional' (w3ounfmetamd.F90)
The upstream refactor replaced explicit IFJ range checks with NOGE(IFI)-2,
which correctly skips the last two scalar-per-point fields (PWST, PNR).
However our extension of group 4 to 24 fields (PTMETH2 second partitioning
scheme) caused PT12 (IFJ=23) to be incorrectly excluded from the partition
loop, as it is now the second-to-last field despite being partitioned (0:1).
Added explicit ELSE IF branch for IFJ=23 to restore correct behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.