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

initialization of mpi_send and recv is hardwired regardless of grid or decomposition type in w3initmd #945

Closed
DeniseWorthen opened this issue Mar 13, 2023 · 0 comments · Fixed by #949
Labels
bug Something isn't working

Comments

@DeniseWorthen
Copy link
Contributor

DeniseWorthen commented Mar 13, 2023

Describe the bug

This line

WW3/model/src/w3initmd.F90

Lines 2192 to 2193 in ea0de58

IF ((FLOUT(1) .OR. FLOUT(7)).and.(.not. LPDLIB .or. &
(GTYPE .ne. UNGTYPE).or. .TRUE.)) THEN

hardwires setting up all the mpi_send and recv inits for flout (1) or (7) regardless of domain decomposition or grid type. However, the domain decomposition case does make use of these and instead uses do_output_exchanges.

To Reproduce
Steps to reproduce the behavior.

Expected behavior

Since the domain decomposition case does not use these mpi calls, the code should only check for whether lpdlib is true or false. However, in the current code removing the .true. results in a out-of bounds reference when using domain-decomposition at

IF ( FLGRDALL( 2, 1) ) THEN
IH = IH + 1
HS(1:NSEA) = ARRtotal(IH,:)
END IF

because the hs does not point to the "extended output arrays" on NAPFLD. This is because the call to w3xdma within the send/recv initialization block is bypassed when removing the .true..

The failure occurs at the model startup time, although I'm not clear why it occurs when no output is being created.

The following change in pdlib_field_vec resolves the issue and allows the .true. to be removed from w3initmd. Initial testing is that it is B4B w/ the current code. There may be a different or more preferred way to fix and I'm open to suggestions.

diff --git a/model/src/pdlib_field_vec.F90 b/model/src/pdlib_field_vec.F90
index 95c817d9..ce7a42e3 100644
--- a/model/src/pdlib_field_vec.F90
+++ b/model/src/pdlib_field_vec.F90
@@ -1325,7 +1325,7 @@ CONTAINS
         END DO
       END IF
       IF ( IAPROC .EQ. NAPFLD ) THEN
-        !              CALL W3XDMA ( IMOD, NDSE, NDST, FLGRDALL )
+        IF (.not. WADATS(IMOD)%AINIT2) CALL W3XDMA ( IMOD, NDSE, NDST, FLGRDALL )
         CALL W3XETA ( IMOD, NDSE, NDST )
         IH     = 0
         IF ( FLGRDALL( 2, 1) ) THEN

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@DeniseWorthen DeniseWorthen added the bug Something isn't working label Mar 13, 2023
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.

1 participant