From 6df22328cbb24e49aa651f3775688cded68de9e3 Mon Sep 17 00:00:00 2001 From: JessicaMeixner-NOAA Date: Tue, 12 Dec 2023 10:23:37 -0600 Subject: [PATCH] Initialize NNZ in mod_def * 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. --- model/src/w3gdatmd.F90 | 5 ++--- model/src/w3iogrmd.F90 | 2 +- model/src/w3profsmd_pdlib.F90 | 1 - model/src/w3triamd.F90 | 10 ++++------ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/model/src/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index 7bc5e2f30..697a92440 100644 --- a/model/src/w3gdatmd.F90 +++ b/model/src/w3gdatmd.F90 @@ -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 | @@ -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 !/ !/ ------------------------------------------------------------------- / @@ -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), & diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index 4f211402d..209db7513 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -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') diff --git a/model/src/w3profsmd_pdlib.F90 b/model/src/w3profsmd_pdlib.F90 index 6759fb53e..c8e0ee348 100644 --- a/model/src/w3profsmd_pdlib.F90 +++ b/model/src/w3profsmd_pdlib.F90 @@ -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, & diff --git a/model/src/w3triamd.F90 b/model/src/w3triamd.F90 index 9fac503b6..28c3a1128 100644 --- a/model/src/w3triamd.F90 +++ b/model/src/w3triamd.F90 @@ -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 ! @@ -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)