/[MITgcm]/MITgcm/pkg/seaice/seaice_jfnk.F
ViewVC logotype

Diff of /MITgcm/pkg/seaice/seaice_jfnk.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by mlosch, Wed Nov 7 09:56:23 2012 UTC revision 1.9 by mlosch, Mon Nov 12 09:46:38 2012 UTC
# Line 74  C     parameters to compute convergence Line 74  C     parameters to compute convergence
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
# Line 86  C     precomputed (= constant per Newton Line 87  C     precomputed (= constant per Newton
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)
92        _RL pressPre(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL pressPre(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
93  CEOP  CEOP
# Line 152  C     constant for the preconditioner Line 154  C     constant for the preconditioner
154            DO i=1-Olx,sNx+Olx            DO i=1-Olx,sNx+Olx
155              zetaPre(I,J,bi,bj) =  zeta(I,J,bi,bj)              zetaPre(I,J,bi,bj) =  zeta(I,J,bi,bj)
156               etaPre(I,J,bi,bj) =   eta(I,J,bi,bj)               etaPre(I,J,bi,bj) =   eta(I,J,bi,bj)
157                etaZPre(I,J,bi,bj) =  etaZ(I,J,bi,bj)
158              dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj)              dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj)
159             pressPre(I,J,bi,bj) = press(I,J,bi,bj)             pressPre(I,J,bi,bj) = press(I,J,bi,bj)
160            ENDDO            ENDDO
# Line 240  C     FGMRES returns iCode either asking Line 243  C     FGMRES returns iCode either asking
243  C     or product of matrix (Jacobian) times vector. For iCode = 0, terminate  C     or product of matrix (Jacobian) times vector. For iCode = 0, terminate
244  C     iteration  C     iteration
245           IF (iCode.EQ.1) THEN           IF (iCode.EQ.1) THEN
246  C     Call preconditioner  C     Call preconditioner
247            CALL SEAICE_PRECONDITIONER(            IF ( SOLV_MAX_ITERS .GT. 0 )
248         &         CALL SEAICE_PRECONDITIONER(
249       U         duIce, dvIce,       U         duIce, dvIce,
250       I         zetaPre, etaPre, dwatPre, pressPre,       I         zetaPre, etaPre, etaZpre, dwatPre, pressPre,
251       I         newtonIter, krylovIter, myTime, myIter, myThid )       I         newtonIter, krylovIter, myTime, myIter, myThid )
252           ELSEIF (iCode.GE.2) THEN           ELSEIF (iCode.GE.2) THEN
253  C     Compute Jacobian times vector  C     Compute Jacobian times vector
# Line 292  C     end of Newton iterate Line 296  C     end of Newton iterate
296  C  C
297  C--   Output diagnostics  C--   Output diagnostics
298  C  C
299          IF ( SEAICE_monFreq .GT. 0. _d 0 ) THEN
300  C     Count iterations  C     Count iterations
301        totalJFNKtimeSteps = totalJFNKtimeSteps + 1         totalJFNKtimeSteps = totalJFNKtimeSteps + 1
302        totalNewtonIters   = totalNewtonIters + newtonIter         totalNewtonIters   = totalNewtonIters + newtonIter
303        totalKrylovIters   = totalKrylovIters + totalKrylovItersLoc         totalKrylovIters   = totalKrylovIters + totalKrylovItersLoc
304  C     Record failure  C     Record failure
305        totalKrylovFails   = totalKrylovFails + krylovFails         totalKrylovFails   = totalKrylovFails + krylovFails
306        IF ( newtonIter .EQ. SEAICEnewtonIterMax ) THEN         IF ( newtonIter .EQ. SEAICEnewtonIterMax ) THEN
307         totalNewtonFails = totalNewtonFails + 1          totalNewtonFails = totalNewtonFails + 1
308           ENDIF
309        ENDIF        ENDIF
310  C     Decide whether it is time to dump and reset the counter  C     Decide whether it is time to dump and reset the counter
311        IF ( DIFFERENT_MULTIPLE(SEAICE_monFreq,myTime+deltaTClock,        writeNow = DIFFERENT_MULTIPLE(SEAICE_monFreq,
312       &     deltaTClock) ) THEN       &     myTime+deltaTClock, deltaTClock)
313    #ifdef ALLOW_CAL
314          IF ( useCAL ) THEN
315           CALL CAL_TIME2DUMP(
316         I      zeroRL, SEAICE_monFreq,  deltaTClock,
317         U      writeNow,
318         I      myTime+deltaTclock, myIter+1, myThid )
319          ENDIF
320    #endif
321          IF ( writeNow ) THEN
322         _BEGIN_MASTER( myThid )         _BEGIN_MASTER( myThid )
323         WRITE(msgBuf,'(A)')         WRITE(msgBuf,'(A)')
324       &' // ======================================================='       &' // ======================================================='

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22