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

First set of changes intended to fix the bug #19

Merged
merged 6 commits into from
Mar 2, 2021

Conversation

ukmo-juan-castillo
Copy link

Bug fix to issue NOAA-EMC#314

@ukmo-juan-castillo
Copy link
Author

These changes have already been tested in the context of issue NOAA-EMC#285 (using a manual merge between branches), and regtests are being run. Comments and possible improvements are welcome.

@ukmo-juan-castillo
Copy link
Author

Regtests behave as expected, changing only ww3_tp2.15, which reads input fields.
matrixDiff.tar.gz

@JessicaMeixner-NOAA
Copy link
Collaborator

Can you please post the matrixCompFull.out or matrixCompSummary.out as well?

@ukmo-juan-castillo
Copy link
Author

No problem:

matrixCompFull.tar.gz

@JessicaMeixner-NOAA
Copy link
Collaborator

Instead of running matrix.comp for each test can you run "all", that way we just have 1 file that reports on every single regression test? That's what I'm used to looking at instead of all of the individual files. The code itself looks fine but I'm not an expert on these routines. My only comment/suggestion would be adding more comments in ww3_prnc with the added texts for why you are adding the other parts. If there are no changes to any of the regression tests, I see no issues with this PR. I'll wait to run the regtests on the NCEP machines when this is pushed back to the NOAA-EMC/ww3 repo.

Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again - not an expert with this code, but it all looks okay as long as there are no changes to any existing regression tests, and fixes the issue you had on the new one being added to me. Thanks for the extra code comments! I'll run regtests when this gets pushed to noaa-emc.

@ukmo-juan-castillo
Copy link
Author

ukmo-juan-castillo commented Feb 22, 2021

I will send the regtests files in a while with the format you wanted.

I wanted just to emphasize that this is a bug that was already present in the code. Why it arose now is because the density is used as a dividing factor in the code, so we generate division by zero errors. Zeroes and interpolation errors were already present for winds, currents, and water levels read from file, only that they did not generate crashes nor unreasonable results. I expect that with this fix the quality of the model output along the coastlines will improve, although not in coupled mode as the interpolation in this case is made via OASIS, or when the input files contain information for the whole grid domain and not only for wet points.

@ukmo-juan-castillo
Copy link
Author

Copy link
Member

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ukmo-juan-castillo - just a comment regarding the test for "zero" fields.

model/ftn/ww3_prnc.ftn Outdated Show resolved Hide resolved
the input is considered, and points that should not be taken into
account in the interpolation are identified by the netcdf fill value; a
subroutine is created to avoid code duplication
@ukmo-juan-castillo
Copy link
Author

As before, the differences are in ww3_tp2.15, but they are expected:

matrix.tar.gz

Copy link
Member

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to handle MDI values looks sensible, Juan. I have one small refactor suggestion though.

model/ftn/ww3_prnc.ftn Outdated Show resolved Hide resolved
@ukmo-juan-castillo ukmo-juan-castillo marked this pull request as ready for review February 26, 2021 08:57
@ukmo-ccbunney ukmo-ccbunney changed the base branch from develop to staging_jan2021 March 2, 2021 09:39
@ukmo-ccbunney ukmo-ccbunney merged commit 8b725a5 into staging_jan2021 Mar 2, 2021
ukmo-ccbunney added a commit that referenced this pull request Mar 19, 2021
* First set of changes intended to fix the bug (#19)

Fixes: NOAA-EMC#314
* Interpolation weights now correctly calculated on points next to land and BC locations.
* Changes to improve the code: the possibility of reading zero values from
the input is considered, and points that should not be taken into
account in the interpolation are identified by the netcdf fill value; a
subroutine is created to avoid code duplication

* Bug fix and small simplification/optimization change (#18)

* Fixes NOAA-EMC#290 (ww3_multi hanging when generating restart with IOSTYP >= 2)
* Also fixes out-of-bounds array access error.
* Includes some MPI optimizations

* Correction to the bug fix in branch bf_multi_hang
to take into account the coupled
    configurations, that are also affected

* Small correction to the multi_hang branch: revert changes to JSEA index
in w3iorsmd

Co-authored-by: Juan Manuel Castillo Sanchez <[email protected]>
Co-authored-by: ukmo-juan.castillo <[email protected]>
@ukmo-ccbunney ukmo-ccbunney deleted the bf_prnc_interp branch June 21, 2021 11:19
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.

3 participants