diff --git a/model/src/PDLIB/yowpdlibmain.F90 b/model/src/PDLIB/yowpdlibmain.F90 index cc72b97fd..f7a08dc98 100644 --- a/model/src/PDLIB/yowpdlibmain.F90 +++ b/model/src/PDLIB/yowpdlibmain.F90 @@ -495,10 +495,9 @@ subroutine runParmetis(MNP) ncon = 1 ! wgtflag: 0: none (vwgt and adjwgt are NULL); 1: edges (vwgt is NULL); 2: vertices (adjwgt is NULL); 3: both vertices & edges; -#ifdef WEIGHTS - wgtflag = 2 INQUIRE ( FILE='weights.ww3', EXIST = lexist ) IF (lexist) THEN + wgtflag = 2 OPEN(100001,FILE='weights.ww3',FORM='FORMATTED',status='unknown') allocate(iweights(np_global)); iweights = 0 do i = 1, np_global @@ -508,9 +507,6 @@ subroutine runParmetis(MNP) ELSE wgtflag = 0 ENDIF -#else - wgtflag = 0 -#endif ! Create weights allocate(vwgt(np*ncon), stat=stat) diff --git a/model/src/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index bde5bf999..d8ffc53f8 100644 --- a/model/src/w3gdatmd.F90 +++ b/model/src/w3gdatmd.F90 @@ -1046,6 +1046,7 @@ MODULE W3GDATMD LOGICAL :: DO_CHANGE_WLV REAL(8) :: SOLVERTHR_STP REAL(8) :: CRIT_DEP_STP + LOGICAL :: LWEIGHTS LOGICAL :: B_JGS_TERMINATE_MAXITER LOGICAL :: B_JGS_TERMINATE_DIFFERENCE LOGICAL :: B_JGS_TERMINATE_NORM @@ -1405,6 +1406,7 @@ MODULE W3GDATMD LOGICAL, POINTER :: DO_CHANGE_WLV REAL(8), POINTER :: SOLVERTHR_STP REAL(8), POINTER :: CRIT_DEP_STP + LOGICAL, POINTER :: LWEIGHTS LOGICAL, POINTER :: B_JGS_TERMINATE_MAXITER LOGICAL, POINTER :: B_JGS_TERMINATE_DIFFERENCE LOGICAL, POINTER :: B_JGS_TERMINATE_NORM @@ -2843,6 +2845,7 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST ) DO_CHANGE_WLV => MPARS(IMOD)%SCHMS%DO_CHANGE_WLV SOLVERTHR_STP => MPARS(IMOD)%SCHMS%SOLVERTHR_STP CRIT_DEP_STP => MPARS(IMOD)%SCHMS%CRIT_DEP_STP + LWEIGHTS => MPARS(IMOD)%SCHMS%LWEIGHTS B_JGS_TERMINATE_MAXITER => MPARS(IMOD)%SCHMS%B_JGS_TERMINATE_MAXITER B_JGS_TERMINATE_DIFFERENCE => MPARS(IMOD)%SCHMS%B_JGS_TERMINATE_DIFFERENCE B_JGS_TERMINATE_NORM => MPARS(IMOD)%SCHMS%B_JGS_TERMINATE_NORM diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 977a203ae..41800c994 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -907,6 +907,7 @@ MODULE W3GRIDMD #ifdef W3_PR3 REAL :: WDTHCG, WDTHTH #endif + LOGICAL :: LUSEWEIGHTS LOGICAL :: JGS_TERMINATE_MAXITER LOGICAL :: JGS_TERMINATE_DIFFERENCE LOGICAL :: JGS_TERMINATE_NORM @@ -1088,6 +1089,7 @@ MODULE W3GRIDMD IMPFSN, IMPTOTAL, EXPTOTAL, & IMPREFRACTION, IMPFREQSHIFT, & IMPSOURCE, & + LUSEWEIGHTS, & JGS_TERMINATE_MAXITER, & JGS_TERMINATE_DIFFERENCE, & JGS_TERMINATE_NORM, & @@ -2444,6 +2446,7 @@ SUBROUTINE W3GRID() SETUP_APPLY_WLV = .TRUE. SOLVERTHR_SETUP=1E-6 CRIT_DEP_SETUP=0.1 + LUSEWEIGHTS = .FALSE. JGS_TERMINATE_MAXITER = .TRUE. JGS_TERMINATE_DIFFERENCE = .TRUE. JGS_TERMINATE_NORM = .FALSE. @@ -2460,6 +2463,7 @@ SUBROUTINE W3GRID() ! read data from the unstructured devoted namelist CALL READNL ( NDSS, 'UNST', STATUS ) + LWEIGHTS = LUSEWEIGHTS B_JGS_USE_JACOBI = JGS_USE_JACOBI B_JGS_TERMINATE_MAXITER = JGS_TERMINATE_MAXITER B_JGS_TERMINATE_DIFFERENCE = JGS_TERMINATE_DIFFERENCE @@ -3321,7 +3325,7 @@ SUBROUTINE W3GRID() WRITE (NDSO,2956) UGBCCFL, UGOBCAUTO, UGOBCDEPTH,TRIM(UGOBCFILE), & EXPFSN, EXPFSPSI, EXPFSFCT, IMPFSN, EXPTOTAL,& IMPTOTAL, IMPREFRACTION, IMPFREQSHIFT, & - IMPSOURCE, SETUP_APPLY_WLV, & + IMPSOURCE, SETUP_APPLY_WLV, LUSEWEIGHTS, & JGS_TERMINATE_MAXITER, & JGS_TERMINATE_DIFFERENCE, & JGS_TERMINATE_NORM, & @@ -6648,6 +6652,7 @@ SUBROUTINE W3GRID() ', IMPTOTAL=',L3,',IMPREFRACTION=', L3, & ', IMPFREQSHIFT=', L3,', IMPSOURCE=', L3, & ', SETUP_APPLY_WLV=', L3, & + ', LUSEWEIGHTS=', L3 & ', JGS_TERMINATE_MAXITER=', L3, & ', JGS_TERMINATE_DIFFERENCE=', L3, & ', JGS_TERMINATE_NORM=', L3, & diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index ce4403ba3..03903ccaa 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -785,6 +785,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & NTRI,COUNTOT, COUNTRI, NNZ, & + LWEIGHTS, & B_JGS_TERMINATE_MAXITER, & B_JGS_TERMINATE_DIFFERENCE, & B_JGS_TERMINATE_NORM, & @@ -803,6 +804,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & NTRI,COUNTOT, COUNTRI, NNZ, & + LWEIGHTS, & B_JGS_TERMINATE_MAXITER, & B_JGS_TERMINATE_DIFFERENCE, & B_JGS_TERMINATE_NORM, & @@ -819,6 +821,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & NTRI,COUNTOT, COUNTRI, NNZ, & + LWEIGHTS, & B_JGS_TERMINATE_MAXITER, & B_JGS_TERMINATE_DIFFERENCE, & B_JGS_TERMINATE_NORM, & @@ -984,6 +987,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & NTRI,COUNTOT, COUNTRI, NNZ, & + LWEIGHTS, & B_JGS_TERMINATE_MAXITER, & B_JGS_TERMINATE_DIFFERENCE, & B_JGS_TERMINATE_NORM, & diff --git a/model/src/w3profsmd_pdlib.F90 b/model/src/w3profsmd_pdlib.F90 index 6759fb53e..76fc01b11 100644 --- a/model/src/w3profsmd_pdlib.F90 +++ b/model/src/w3profsmd_pdlib.F90 @@ -5568,9 +5568,7 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL REAL*8 :: eVA, eVO, CG2, NEWDAC, NEWAC, OLDAC, MAXDAC REAL :: CG1(0:NK+1), WN1(0:NK+1) LOGICAL :: LCONVERGED(NSEAL), lexist, LLWS(NSPEC) -#ifdef WEIGHTS INTEGER :: ipiter(nseal), ipitergl(np_global), ipiterout(np_global) -#endif #ifdef W3_DEBUGSRC REAL :: IntDiff, eVA_w3srce, eVAsolve, SumACout REAL :: SumVAin, SumVAout, SumVAw3srce, SumVS, SumVD, VS_w3srce @@ -5744,7 +5742,7 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL nbIter=0 do ip = 1, np Lconverged(ip) = .false. -#ifdef WEIGHTS +#ifdef W3_WEIGHTS ipiter(ip) = 0 #endif enddo @@ -5780,9 +5778,7 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL ACLOC = VA(:,JSEA) IF (.NOT. LCONVERGED(IP)) THEN -#ifdef WEIGHTS ipiter(ip) = ipiter(ip) + 1 -#endif #ifdef W3_DEBUGFREQSHIFT WRITE(740+IAPROC,*) 'Begin loop' WRITE(740+IAPROC,*) 'IP/IP_glob/ISEA/JSEA=', IP, IP_glob, ISEA, JSEA @@ -6292,7 +6288,6 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL ENDIF ! FLSOU END DO ! JSEA -#ifdef WEIGHTS INQUIRE ( FILE='weights.ww3', EXIST = lexist ) if (.not. lexist) then ipitergl = 0 @@ -6302,14 +6297,13 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL END DO call mpi_reduce(ipitergl,ipiterout,NP_GLOBAL,MPI_INT,MPI_SUM,0,MPI_COMM_WCMP,ierr) if (myrank == 0) tHEN - OPEN(100001,FILE='weights.ww3',FORM='FORMATTED',STATUS='unknown') + OPEN(10001,FILE='weights.ww3',FORM='FORMATTED',STATUS='unknown') do ip = 1, np_global - write(100001,*) ipiterout(ip) + write(10001,*) ipiterout(ip) enddo - CLOSE(100001) + CLOSE(10001) endif endif -#endif ! call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION LOOP 7') !