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

w3iors NSEAL vs NSEA in non-MPI portions of read/write #940

Closed
JessicaMeixner-NOAA opened this issue Mar 10, 2023 · 8 comments · Fixed by #954
Closed

w3iors NSEAL vs NSEA in non-MPI portions of read/write #940

JessicaMeixner-NOAA opened this issue Mar 10, 2023 · 8 comments · Fixed by #954
Assignees
Labels
bug Something isn't working

Comments

@JessicaMeixner-NOAA
Copy link
Collaborator

JessicaMeixner-NOAA commented Mar 10, 2023

Describe the bug
Not 100% sure this is a bug, but this should be investigated. While working on #829

I found that in the non-MPI sections of the read/write of the restart we are using:

DO JSEA=1, NSEAL

In the following lines of code:
https://github.com/NOAA-EMC/WW3/blob/develop/model/src/w3iorsmd.F90#L631
and
https://github.com/NOAA-EMC/WW3/blob/develop/model/src/w3iorsmd.F90#L788

In standalone mode, perhaps we've already defined NSEAL=NSEA and this is fine, but I found I had to set NSEAL=NSEA when trying to read/write this from ww3_gint.

To test if this is a bug or not, my plan is to:

  • run the regression tests with these NSEAL->NSEA and see if they work
  • See if there are differences, and make sure to test a non-mpi case for a restart run and make sure everything is working as expected.
@MatthewMasarik-NOAA
Copy link
Collaborator

This does sound like a good thing to investigate. Good find @JessicaMeixner-NOAA

@JessicaMeixner-NOAA
Copy link
Collaborator Author

All regression tests except the usual passed. Next step is running a restart case for non-mpi with the develop and this branch and see how that goes.

@ukmo-ccbunney
Copy link
Collaborator

ukmo-ccbunney commented Mar 21, 2023

So - my opinion on this is that it aught to be changed to NSEA.

Using NSEAL makes the assumption that setting NSEAL = NSEA is always handled by whatever code is calling this.
In the wave model, this is always the case (handled via w3parall.f90:SET_UP_NSEAL_NSEALM), but as in this case it is not always the wave model calling this module so we should not make assumptions. NSEA will always be defined, but AFAIK NSEAL is only ever valid in an MPI case so we should no expect it to be defined by the calling routine in SHRD mode.

Assuming that changing it does not impact the results (I can't see why), then I advocate defensive programming and changing it to NSEA.

There might be other places in the code where this assumption on NSEAL being defined is also made...

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@ukmo-ccbunney okay -- I will proceed with this code-fix. Should have a PR up soon... that's a good question about other places in the code about the assumption on NSEAL. Should we make a new issue for that?

@MatthewMasarik-NOAA
Copy link
Collaborator

I find @ukmo-ccbunney suggestion compelling.

@ukmo-ccbunney
Copy link
Collaborator

@ukmo-ccbunney okay -- I will proceed with this code-fix. Should have a PR up soon... that's a good question about other places in the code about the assumption on NSEAL. Should we make a new issue for that?

Perhaps not a bad idea so it is logged and someone can then put some time aside to look through the code.

@ukmo-ccbunney
Copy link
Collaborator

I'm running regression tests now.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

New issue: #956 for general case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants