Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate ww3_bounc geographic distances with haversines and utilize verbose=2 output #1392

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

dahonegger
Copy link

Pull Request Summary

Bug fix for #1344

Description

When assigning NetCDF spectra to input boundary nodes, ww3_bounc uses an iterative method to identify the two nearest neighbor spectra in spec.list. Custom diagnostic output in ww3_bounc reveals that points even one kilometer apart can be calculated as having a separation distance of zero. Moreover, some input point - boundary point pairs result in a returned distance of NaN. As a result, assignment of spectra to boundary nodes is sensitive to the ordering of the boundary nodes and to the ordering of the provided spectra in a manner that is not explicit in the code.

This fix replaces usage of DIST_SPHERE in ww3_bounc with a new function, DIST_HAVERSINE, that is more robust when distances are on the order of 1 km or less. Both DIST_SPHERE and DIST_HAVERSINE are defined in w3servmd.

This fix additionally includes the option for more detailed diagnostic output from ww3_bounc that is triggered with the VERBOSE=2 namelist value in ww3_bounc.nml.

There are expected changes to regression tests tp2.8 and tp2.17 owing to modifications to the weight assignments of the linearly interpolated boundary spectra.

Issue(s) addressed

Commit Message

Calculate ww3_bounc geographic distances with haversines and utilize verbose=2 output

Check list

Testing

mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (4 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e_c                     (1 files differ)
mww3_test_03/./work_PR2_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (3 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (6 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (6 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (5 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e                     (1 files differ)
mww3_test_09/./work_MPI_ASCII                     (0 files differ)
ww3_tp2.17/./work_ma                     (1 files differ)
ww3_tp2.17/./work_mc1                     (1 files differ)
ww3_tp2.17/./work_mb                     (1 files differ)
ww3_tp2.17/./work_mc                     (1 files differ)
ww3_tp2.17/./work_ma1                     (1 files differ)
ww3_tp2.17/./work_a                     (1 files differ)
ww3_tp2.17/./work_c                     (1 files differ)
ww3_tp2.17/./work_b                     (1 files differ)
ww3_tp2.6/./work_ST4_ASCII                     (0 files differ)
ww3_tp2.8/./work_PR3_UQ                     (4 files differ)
  • How were these changes tested? Via matrix
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) Tests that use ww3_bounc with FLAGLL=.true. cover the changes, but the newly utilized VERBOSE=2 value in ww3_bounc.nml is not tested.
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)? Yes, on an ERDC HPC with Intel
  • Please indicate the expected changes in the regression test output, (Note the list of known non-identical tests.) Expected changes to the regression tests include: modifications to the weight assignments of the linearly interpolated boundary spectra.
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):

matrixCompSummary.txt
matrixDiff.txt
matrixCompFull.txt

dahonegger and others added 3 commits February 21, 2025 11:04
… this method in ww3_bounc to more robustly calculate distances between geographic locations. This commit also adds VERBOSE=2 diagnostic output. VERBOSE=2 was previously unused.
@MatthewMasarik-NOAA
Copy link
Collaborator

Thank you for submitting this fix @dahonegger. We will start looking at it and I'll reply back tomorrow with the CM assigned and the timeline.

@mickaelaccensi
Copy link
Collaborator

Thank you David for this improvement !

@MatthewMasarik-NOAA
Copy link
Collaborator

MatthewMasarik-NOAA commented Mar 14, 2025

@dahonegger I spoke with @JessicaMeixner-NOAA offline and we will be assigning a CM on Monday when @sbanihash is back from leave. We will be back in touch then. Thank you again for this submission.

@sbanihash
Copy link
Collaborator

Thank you @dahonegger for your work on this fix. I would like to request @kestonsmith-noaa to take a look at this PR and review the changes. Either @JessicaMeixner-NOAA or I would also take a look as a second reviewer as well.

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.

Non-unique nearest point calculation in ww3_bounc
5 participants