-
Notifications
You must be signed in to change notification settings - Fork 553
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
Init bugs2 #1142
Init bugs2 #1142
Conversation
@aronroland thank you for submitting this PR! As soon as the testing information from ERDC is added we'll start the tests and review. |
Converting this PR to a draft. Please mark as ready to review with testing information is available. @aronroland @thesser1 |
@aronroland @thesser1 will you help make sure that the description of this PR includes all the updates in this branch or confirm that it's all there already? |
sure ... |
Please see attached results from regtests. Looks like binary differences. |
Thanks for adding the testing @thesser1, I'll start working on it. |
@thesser1 is this ready to be marked ready for review? I did see that some tests had differences in the output of the unstructured grid cases, is this expected with the bug fixes? |
model/src/w3sdb1md.F90
Outdated
THR = DBLE(1.E-15) | ||
IF (SUM(A) .LT. THR) RETURN | ||
IF (EMEAN .LT. TINY(1.d0)) THEN | ||
S = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S
and D
are zeroed above. Why zero again here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this was some leftover i cleaned it now, thanks @ukmo-ccbunney
@thesser1, I'm going to pause looking at this while there are some questions from Jessica and Chris. |
All, I had an issue with my netcdf library when I ran matrix.comp. I just noticed it and reran the comparison, and it increased the number of differences. Sorry for posting before checking. Based on comments above, it looks like there will be a fix and rerun needed, but I wanted to make sure the files posted here reflected all regression issues. I am sending differences to Aron, but I would keep this as draft for the time being. |
Thanks for the update, @thesser1. Please keep us posted |
Hi @JessicaMeixner-NOAA, we experience all HPCF maintenance. I guess it will be next week. Have a good weekend! |
@aronroland thanks for the update! |
@aronroland - I just wanted to check in to see if there were any updates on this PR. |
@aronroland you mentioned this PR needs to go in first - what is the status of this PR? |
I think we need to rerun the regtests based on the latest merge and comment more on the anticipated changes of the results within the regtests. |
@aronroland sounds great! Looking forward to hearing more from you. |
I have merged all updates into init_bugs2. I am rerunning the regression tests. We will still need to clarify when and why out_grd and mod_def files are changing even when lateral boundaries are not included in the regression test setup. I will follow up when I have more information. |
…nit in w3srce before the call it should not alter the results
Hi @ukmo-ccbunney, hi @JessicaMeixner-NOAA , we have run the regression tests and looked at the results. Ty will upload the regtest results and I have hopefully cleaned the code so far. As of the differences to the regression tests. I have looked at those and reach following conclusion ... The non-identical cases essentially consist of two groups. The first group includes the multi-structured part, for which I cannot fully explain the differences. In contrast, for the unstructured part in the multi-structured cases, the differences are attributable to changes made within the source term implementation. Specifically, for the implicit case, the differences stem from how the source terms are called, particularly the modification in w3wave, where the handling of boundary conditions and wetting/drying flags has been introduced at the top level. mww3_test_03/./work_PR3_UQ_MPI_e_c (1 file differs) The next set of differences occurs in the Shinnecock Inlet case (2.17). These differences are expected due to modifications in the code concerning the treatment of TR1 and DB1 for zero-energy conditions. Additionally, for implicit schemes, changes were made in how source terms are applied at the boundary within w3wave. The resulting differences in the outputs are minor. ww3_tp2.17/./work_mc1 (5 files differ) In the case of the Booij laboratory experiment, all changes impact the results. Besides issues with lateral boundary conditions and initialization, both TR1 and DB1 are active, leading to the observed differences. ww3_tp2.19/./work_1A_a (9 files differ) For the global setup, the differences are expected due to changes in DB1 and initialization issues. ww3_tp2.21/./work_mb (7 files differ) In the Limon case, the differences are attributed to DB1 and initialization issues resolved within the implicit scheme. ww3_tp2.6/./work_ST4_ASCII (0 files differ) For the UFS case, the differences arise from DB1 and initialization issues resolved in the implicit scheme. ww3_ufs1.1/./work_unstr_c (6 files differ) |
matrixCompFull.txt |
Thank you @aronroland and @thesser1 - I'll start reviewing now! One quick question: Does this PR close #1017 or any other open issues? |
yes it does solve issue @1071. |
@aronroland I have confirmed I have the same differences as you and done a review of the code. One follow up question: For the UFS case, the differences I'm assuming are actually from the implicit scheme changes versus DB1? Because all of the ufs1.1 cases use DB1 but only the c is the implicit scheme? If we can confirm that, then I don't have to do an extra test. In the meantime I'm waiting for the comparison of this branch versus itself to confirm we maintain b4b with the new changes on the changed tests (Sorry I forgot to put the compare script in the queue earlier today). Should be ready to merge this late tomorrow/early Wednesday. |
@@ -231,12 +232,9 @@ SUBROUTINE W3SDB1 (IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D ) | |||
#endif | |||
! | |||
! 0. Initialzations ------------------------------------------------- / | |||
! Never touch this 4 lines below ... otherwise my exceptionhandling will not work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doing some testing below - and saw this "Never touch these four lines" comment. I'm assuming @aronroland that the exception handling still works.... but just thought I'd draw attention to this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JessicaMeixner-NOAA sorry for my late reply, yes this was a leftover from long ago so I cleaned the code thanks for looking at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JessicaMeixner-NOAA, back to your comment on the UFS and the DB1 issue. I have check more the code and the reason is in this case not DB1 but rather my changes in w3wave, where we changed how the source terms are called in the implicit schemes for the sake of neumann boundary but also wetting and drying. I will expand a bit the text so it becomes more clear to everybody.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for replying @aronroland - and thanks for cleaning this up and all the bug fixes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience as I did one more test and it took a little longer than expected.
I have the same changes as you:
**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR3_UQ_MPI_e_c (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2 (8 files differ)
mww3_test_03/./work_PR1_MPI_d2 (13 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c (11 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c (16 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2 (12 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2 (14 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2 (16 files differ)
mww3_test_09/./work_MPI_ASCII (0 files differ)
ww3_tp2.10/./work_MPI_OMPH (7 files differ)
ww3_tp2.16/./work_MPI_OMPH (4 files differ)
ww3_tp2.17/./work_mc1 (6 files differ)
ww3_tp2.17/./work_mc (6 files differ)
ww3_tp2.17/./work_c (10 files differ)
ww3_tp2.19/./work_1B_a (9 files differ)
ww3_tp2.19/./work_1A_a (9 files differ)
ww3_tp2.19/./work_1C_a (9 files differ)
ww3_tp2.21/./work_b_metis (6 files differ)
ww3_tp2.21/./work_mb (7 files differ)
ww3_tp2.21/./work_b (6 files differ)
ww3_tp2.6/./work_pdlib (14 files differ)
ww3_tp2.6/./work_ST4_ASCII (0 files differ)
ww3_ufs1.1/./work_unstr_c (6 files differ)
ww3_ufs1.3/./work_a (3 files differ)
matrixCompFull.txt
matrixCompSummary.txt
Note, the diff file as @thesser1 pointed out is too large.
I did confirm that the answers are reproducible against itself (ie this pr vs this pr), where we only get the expected diffs:
**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR1_MPI_e (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e_c (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2 (8 files differ)
mww3_test_03/./work_PR1_MPI_d2 (13 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c (12 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c (15 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2 (15 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2 (11 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e_c (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2 (16 files differ)
mww3_test_09/./work_MPI_ASCII (0 files differ)
ww3_tp2.10/./work_MPI_OMPH (7 files differ)
ww3_tp2.16/./work_MPI_OMPH (4 files differ)
ww3_tp2.6/./work_ST4_ASCII (0 files differ)
ww3_ufs1.3/./work_a (3 files differ)
matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt
Thanks for the bug-fixes!!!!!
@JessicaMeixner-NOAA, I hope the text is more clean now and many thanks for the prompt review! Next step is the gse branch. |
Awesome @aronroland , THANK YOU! Let me know if there's anything else I can do to help! |
…ce_refactor * upstream/develop: Addition of Regression Test (ww3_tic1.1/IC4_M10) (NOAA-EMC#1331) IC4M10: New wave damping scheme in sea ice (NOAA-EMC#1293) Fixing uninitialized issues within the implicit scheme (NOAA-EMC#1142) ww3_ufs1.x: fix typo in switch_MPI_OMPH (NOAA-EMC#1323) README.md: update with link to doxygen documentation (NOAA-EMC#1316)
Pull Request Summary
Solves uninitialized variables issues and improves/fixes issues with the Neuman boundary condition.
Description
This pull request, solves uninitialized variable issues for TR0 and other bugs connected to initialization issues. Moreover, adding Neumann-type boundary conditions in the RD framework can be accomplished by calculating the solution at the boundary, without modifying the scheme itself. Specifically, a zero-gradient Neumann condition is applied at the boundary. However, this approach becomes less straightforward when dealing with positive source term contributions or phenomena like refraction and frequency shifting. In such scenarios, the Neumann boundary condition, characterized by a zero gradient, is not sufficiently defined. This is because the waves at the boundary may grow, change direction, or modulate, leading to a net influx of energy into the domain. To resolve this, we have developed a solution that involves bypassing the calculation of spectral propagation at Neumann boundary points and excluding the computation of positive source terms.
Please also include the following information:
The code changes are trivial.
It was a bug.
Answers may change for the regtest, where the certain settings are used.
Issue(s) addressed
none issue was raised yet.
Commit Message
Fixing uninitialized issues within the implicit scheme
Check list
Testing
I have checked on certain setups by SHOM (with Heloise Michaud), that this fixes the issues she has found.
Will be done by ERDC.
Mostly none ...
Will be done by ERDC