Skip to content

Commit

Permalink
Initialize NNZ in mod_def
Browse files Browse the repository at this point in the history
* Note NNZ is not defined when W3DIMUG was originally called to allocate
the size of JAA. However, JAA had another allocation call after NNZ was
defined in a specific routine.  This routine is not called if its not
PDLIB so the deallocate of JAA for PDLIB was also removed.
* NNZ is removed from the list of inputs for W3DIMUG since its no longer
needed there.
  • Loading branch information
JessicaMeixner-NOAA committed Dec 12, 2023
1 parent fb1bd76 commit 6df2232
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions model/src/w3gdatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@ SUBROUTINE W3GNTX ( IMOD, NDSE, NDST )
!/
END SUBROUTINE W3GNTX
!/ ------------------------------------------------------------------- /
SUBROUTINE W3DIMUG ( IMOD, MTRI, MX, COUNTOTA, NNZ, NDSE, NDST )
SUBROUTINE W3DIMUG ( IMOD, MTRI, MX, COUNTOTA, NDSE, NDST )
!/
!/ +-----------------------------------+
!/ | WAVEWATCH-III NOAA/NCEP |
Expand Down Expand Up @@ -3157,7 +3157,7 @@ SUBROUTINE W3DIMUG ( IMOD, MTRI, MX, COUNTOTA, NNZ, NDSE, NDST )
!/ ------------------------------------------------------------------- /
!/ Parameter list
!/
INTEGER, INTENT(IN) :: IMOD, MTRI, MX, COUNTOTA, NNZ, NDSE, NDST
INTEGER, INTENT(IN) :: IMOD, MTRI, MX, COUNTOTA, NDSE, NDST
INTEGER :: IAPROC = 1
!/
!/ ------------------------------------------------------------------- /
Expand Down Expand Up @@ -3209,7 +3209,6 @@ SUBROUTINE W3DIMUG ( IMOD, MTRI, MX, COUNTOTA, NNZ, NDSE, NDST )
GRIDS(IMOD)%IE_CELL(COUNTOTA), &
GRIDS(IMOD)%POS_CELL(COUNTOTA), &
GRIDS(IMOD)%IAA(NX+1), &
GRIDS(IMOD)%JAA(NNZ), &
GRIDS(IMOD)%POSI(3,COUNTOTA), &
GRIDS(IMOD)%I_DIAG(NX), &
GRIDS(IMOD)%JA_IE(3,3,MTRI), &
Expand Down
2 changes: 1 addition & 1 deletion model/src/w3iogrmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT &
B_JGS_NLEVEL, &
B_JGS_SOURCE_NONLINEAR
IF (.NOT. GUGINIT) THEN
CALL W3DIMUG ( IGRD, NTRI, NX, COUNTOT, NNZ, NDSE, NDST )
CALL W3DIMUG ( IGRD, NTRI, NX, COUNTOT, NDSE, NDST )
END IF
call print_memcheck(memunit, 'memcheck_____:'//' WIOGR SECTION 5')

Expand Down
1 change: 0 additions & 1 deletion model/src/w3profsmd_pdlib.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7361,7 +7361,6 @@ SUBROUTINE DEALLOCATE_PDLIB_GLOBAL(IMOD)
GRIDS(IMOD)%IE_CELL, &
GRIDS(IMOD)%POS_CELL, &
GRIDS(IMOD)%IAA, &
GRIDS(IMOD)%JAA, &
GRIDS(IMOD)%POSI, &
GRIDS(IMOD)%I_DIAG, &
GRIDS(IMOD)%JA_IE, &
Expand Down
10 changes: 4 additions & 6 deletions model/src/w3triamd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ SUBROUTINE READMSH(NDS,FNAME)
!count points connections to allocate array in W3DIMUG
!
CALL COUNT(TRIGPTMP2)
CALL W3DIMUG ( 1, NTRI, NX, COUNTOT, NNZ, NDSE, NDST )
CALL W3DIMUG ( 1, NTRI, NX, COUNTOT, NDSE, NDST )
!
! fills arrays
!
Expand All @@ -362,11 +362,9 @@ SUBROUTINE READMSH(NDS,FNAME)
CALL COORDMAX

#ifdef W3_PDLIB
IF(.false.) THEN
#endif
CALL AREA_SI(1)
#ifdef W3_PDLIB
ENDIF
NNZ=0 ! initialize value written to mod_def
#else
CALL AREA_SI(1)
#endif
!
CLOSE(NDS)
Expand Down

0 comments on commit 6df2232

Please sign in to comment.