/[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.23 by mlosch, Thu May 30 14:07:19 2013 UTC revision 1.27 by gforget, Mon Oct 20 03:20:57 2014 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "SEAICE_OPTIONS.h"  #include "SEAICE_OPTIONS.h"
5    #ifdef ALLOW_AUTODIFF
6    # include "AUTODIFF_OPTIONS.h"
7    #endif
8    
9  C--  File seaice_jfnk.F: seaice jfnk dynamical solver S/R:  C--  File seaice_jfnk.F: seaice jfnk dynamical solver S/R:
10  C--   Contents  C--   Contents
# Line 76  C     parameters to compute convergence Line 79  C     parameters to compute convergence
79        _RL     JFNKgamma_lin        _RL     JFNKgamma_lin
80        _RL     FGMRESeps        _RL     FGMRESeps
81        _RL     JFNKtol        _RL     JFNKtol
82  C     Adams-Bashforth extrapolation factors  C     backward differences extrapolation factors
83        _RL abFac, abAlpha        _RL bdfFac, bdfAlpha
84  C  C
85        _RL     recip_deltaT        _RL     recip_deltaT
86        LOGICAL JFNKconverged, krylovConverged        LOGICAL JFNKconverged, krylovConverged
# Line 87  C Line 90  C
90  C     u/vIceRes :: residual of sea-ice momentum equations  C     u/vIceRes :: residual of sea-ice momentum equations
91        _RL uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
92        _RL vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
93  C     extra time level required for Adams-Bashforth-2 time stepping  C     extra time level required for backward difference time stepping
94        _RL duIcNm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL duIcNm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
95        _RL dvIcNm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL dvIcNm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96  C     du/vIce   :: ice velocity increment to be added to u/vIce  C     du/vIce   :: ice velocity increment to be added to u/vIce
# Line 118  C     with iOutFgmres=1, seaice_fgmres p Line 121  C     with iOutFgmres=1, seaice_fgmres p
121       &     DIFFERENT_MULTIPLE( SEAICE_monFreq, myTime, deltaTClock ) )       &     DIFFERENT_MULTIPLE( SEAICE_monFreq, myTime, deltaTClock ) )
122       &     iOutFGMRES=1       &     iOutFGMRES=1
123    
124  C     Adams-Bashforth extrapolation factors  C     backward difference extrapolation factors
125        abFac = 0. _d 0        bdfFac = 0. _d 0
126        IF ( SEAICEuseAB2 ) THEN        IF ( SEAICEuseBDF2 ) THEN
127         IF ( myIter.EQ.nIter0 .AND. SEAICEmomStartAB.EQ.0 ) THEN         IF ( myIter.EQ.nIter0 .AND. SEAICEmomStartBDF.EQ.0 ) THEN
128          abFac = 0. _d 0          bdfFac = 0. _d 0
129         ELSE         ELSE
130          abFac = 0.5 _d 0 + SEAICE_abEps          bdfFac = 0.5 _d 0
131         ENDIF         ENDIF
132        ENDIF        ENDIF
133        abAlpha = 1. _d 0 + abFac        bdfAlpha = 1. _d 0 + bdfFac
134    
135        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
136         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
# Line 142  C     Adams-Bashforth extrapolation fact Line 145  C     Adams-Bashforth extrapolation fact
145  C     cycle ice velocities  C     cycle ice velocities
146          DO J=1-OLy,sNy+OLy          DO J=1-OLy,sNy+OLy
147           DO I=1-OLx,sNx+OLx           DO I=1-OLx,sNx+OLx
148            duIcNm1(I,J,bi,bj) = uIce(I,J,bi,bj) * abAlpha            duIcNm1(I,J,bi,bj) = uIce(I,J,bi,bj) * bdfAlpha
149       &         + ( uIce(I,J,bi,bj) - uIceNm1(I,J,bi,bj) ) * abFac       &         + ( uIce(I,J,bi,bj) - uIceNm1(I,J,bi,bj) ) * bdfFac
150            dvIcNm1(I,J,bi,bj) = vIce(I,J,bi,bj) * abAlpha            dvIcNm1(I,J,bi,bj) = vIce(I,J,bi,bj) * bdfAlpha
151       &         + ( vIce(I,J,bi,bj) - vIceNm1(I,J,bi,bj) ) * abFac       &         + ( vIce(I,J,bi,bj) - vIceNm1(I,J,bi,bj) ) * bdfFac
152            uIceNm1(I,J,bi,bj) = uIce(I,J,bi,bj)            uIceNm1(I,J,bi,bj) = uIce(I,J,bi,bj)
153            vIceNm1(I,J,bi,bj) = vIce(I,J,bi,bj)            vIceNm1(I,J,bi,bj) = vIce(I,J,bi,bj)
154           ENDDO           ENDDO
155          ENDDO          ENDDO
156          IF ( .NOT.SEAICEuseIMEX ) THEN  C     As long as IMEX is not properly implemented leave this commented out
157    CML        IF ( .NOT.SEAICEuseIMEX ) THEN
158  C     Compute things that do no change during the Newton iteration:  C     Compute things that do no change during the Newton iteration:
159  C     sea-surface tilt and wind stress:  C     sea-surface tilt and wind stress:
160  C     FORCEX/Y0 - mass*(abA*u/vIceNm1+abB*(u/vIceNm1-u/vIceNm2))/deltaT  C     FORCEX/Y0 - mass*(1.5*u/vIceNm1+0.5*(u/vIceNm1-u/vIceNm2))/deltaT
161          DO J=1-OLy,sNy+OLy          DO J=1-OLy,sNy+OLy
162           DO I=1-OLx,sNx+OLx           DO I=1-OLx,sNx+OLx
163            FORCEX(I,J,bi,bj) = FORCEX0(I,J,bi,bj)            FORCEX(I,J,bi,bj) = FORCEX0(I,J,bi,bj)
# Line 162  C     FORCEX/Y0 - mass*(abA*u/vIceNm1+ab Line 166  C     FORCEX/Y0 - mass*(abA*u/vIceNm1+ab
166       &         + seaiceMassV(I,J,bi,bj)*dvIcNm1(I,J,bi,bj)*recip_deltaT       &         + seaiceMassV(I,J,bi,bj)*dvIcNm1(I,J,bi,bj)*recip_deltaT
167           ENDDO           ENDDO
168          ENDDO          ENDDO
169          ENDIF  CML        ENDIF
170         ENDDO         ENDDO
171        ENDDO        ENDDO
172  C     Start nonlinear Newton iteration: outer loop iteration  C     Start nonlinear Newton iteration: outer loop iteration

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.22