74 |
C |
C |
75 |
_RL recip_deltaT |
_RL recip_deltaT |
76 |
LOGICAL JFNKconverged, krylovConverged |
LOGICAL JFNKconverged, krylovConverged |
77 |
|
LOGICAL writeNow |
78 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
79 |
C |
C |
80 |
C u/vIceRes :: residual of sea-ice momentum equations |
C u/vIceRes :: residual of sea-ice momentum equations |
87 |
C zeta, eta, and DWATN, press |
C zeta, eta, and DWATN, press |
88 |
_RL zetaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL zetaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
89 |
_RL etaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL etaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
90 |
|
_RL etaZPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
91 |
_RL dwatPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL dwatPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
|
_RL pressPre(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
|
92 |
CEOP |
CEOP |
93 |
|
|
94 |
C Initialise |
C Initialise |
151 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
152 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
153 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
154 |
zetaPre(I,J,bi,bj) = zeta(I,J,bi,bj) |
zetaPre(I,J,bi,bj) = zeta(I,J,bi,bj) |
155 |
etaPre(I,J,bi,bj) = eta(I,J,bi,bj) |
etaPre(I,J,bi,bj) = eta(I,J,bi,bj) |
156 |
dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj) |
etaZPre(I,J,bi,bj) = etaZ(I,J,bi,bj) |
157 |
pressPre(I,J,bi,bj) = press(I,J,bi,bj) |
dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj) |
158 |
ENDDO |
ENDDO |
159 |
ENDDO |
ENDDO |
160 |
ENDDO |
ENDDO |
241 |
C or product of matrix (Jacobian) times vector. For iCode = 0, terminate |
C or product of matrix (Jacobian) times vector. For iCode = 0, terminate |
242 |
C iteration |
C iteration |
243 |
IF (iCode.EQ.1) THEN |
IF (iCode.EQ.1) THEN |
244 |
C Call preconditioner |
C Call preconditioner |
245 |
CALL SEAICE_PRECONDITIONER( |
IF ( SOLV_MAX_ITERS .GT. 0 ) |
246 |
|
& CALL SEAICE_PRECONDITIONER( |
247 |
U duIce, dvIce, |
U duIce, dvIce, |
248 |
I zetaPre, etaPre, dwatPre, pressPre, |
I zetaPre, etaPre, etaZpre, dwatPre, |
249 |
I newtonIter, krylovIter, myTime, myIter, myThid ) |
I newtonIter, krylovIter, myTime, myIter, myThid ) |
250 |
ELSEIF (iCode.GE.2) THEN |
ELSEIF (iCode.GE.2) THEN |
251 |
C Compute Jacobian times vector |
C Compute Jacobian times vector |
294 |
C |
C |
295 |
C-- Output diagnostics |
C-- Output diagnostics |
296 |
C |
C |
297 |
|
IF ( SEAICE_monFreq .GT. 0. _d 0 ) THEN |
298 |
C Count iterations |
C Count iterations |
299 |
totalJFNKtimeSteps = totalJFNKtimeSteps + 1 |
totalJFNKtimeSteps = totalJFNKtimeSteps + 1 |
300 |
totalNewtonIters = totalNewtonIters + newtonIter |
totalNewtonIters = totalNewtonIters + newtonIter |
301 |
totalKrylovIters = totalKrylovIters + totalKrylovItersLoc |
totalKrylovIters = totalKrylovIters + totalKrylovItersLoc |
302 |
C Record failure |
C Record failure |
303 |
totalKrylovFails = totalKrylovFails + krylovFails |
totalKrylovFails = totalKrylovFails + krylovFails |
304 |
IF ( newtonIter .EQ. SEAICEnewtonIterMax ) THEN |
IF ( newtonIter .EQ. SEAICEnewtonIterMax ) THEN |
305 |
totalNewtonFails = totalNewtonFails + 1 |
totalNewtonFails = totalNewtonFails + 1 |
306 |
|
ENDIF |
307 |
ENDIF |
ENDIF |
308 |
C Decide whether it is time to dump and reset the counter |
C Decide whether it is time to dump and reset the counter |
309 |
IF ( DIFFERENT_MULTIPLE(SEAICE_monFreq,myTime+deltaTClock, |
writeNow = DIFFERENT_MULTIPLE(SEAICE_monFreq, |
310 |
& deltaTClock) ) THEN |
& myTime+deltaTClock, deltaTClock) |
311 |
|
#ifdef ALLOW_CAL |
312 |
|
IF ( useCAL ) THEN |
313 |
|
CALL CAL_TIME2DUMP( |
314 |
|
I zeroRL, SEAICE_monFreq, deltaTClock, |
315 |
|
U writeNow, |
316 |
|
I myTime+deltaTclock, myIter+1, myThid ) |
317 |
|
ENDIF |
318 |
|
#endif |
319 |
|
IF ( writeNow ) THEN |
320 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
321 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
322 |
&' // =======================================================' |
&' // =======================================================' |
357 |
&' // =======================================================' |
&' // =======================================================' |
358 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
359 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
360 |
WRITE(msgBuf,'(A)') ' // Begin JFNK statistics' |
WRITE(msgBuf,'(A)') ' // End JFNK statistics' |
361 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
362 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
363 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |