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 |
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 |
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 |
99 |
C precomputed (= constant per Newton iteration) versions of |
C precomputed (= constant per Newton iteration) versions of |
100 |
C zeta, eta, and DWATN, press |
C zeta, eta, and DWATN, press |
101 |
_RL zetaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL zetaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
102 |
|
_RL zetaZPre(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
103 |
_RL etaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL etaPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
104 |
_RL etaZPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL etaZPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
105 |
_RL dwatPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL dwatPre (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
122 |
& DIFFERENT_MULTIPLE( SEAICE_monFreq, myTime, deltaTClock ) ) |
& DIFFERENT_MULTIPLE( SEAICE_monFreq, myTime, deltaTClock ) ) |
123 |
& iOutFGMRES=1 |
& iOutFGMRES=1 |
124 |
|
|
125 |
C Adams-Bashforth extrapolation factors |
C backward difference extrapolation factors |
126 |
abFac = 0. _d 0 |
bdfFac = 0. _d 0 |
127 |
IF ( SEAICEuseAB2 ) THEN |
IF ( SEAICEuseBDF2 ) THEN |
128 |
IF ( myIter.EQ.nIter0 .AND. SEAICEmomStartAB.EQ.0 ) THEN |
IF ( myIter.EQ.nIter0 .AND. SEAICEmomStartBDF.EQ.0 ) THEN |
129 |
abFac = 0. _d 0 |
bdfFac = 0. _d 0 |
130 |
ELSE |
ELSE |
131 |
abFac = 0.5 _d 0 + SEAICE_abEps |
bdfFac = 0.5 _d 0 |
132 |
ENDIF |
ENDIF |
133 |
ENDIF |
ENDIF |
134 |
abAlpha = 1. _d 0 + abFac |
bdfAlpha = 1. _d 0 + bdfFac |
135 |
|
|
136 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
137 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
146 |
C cycle ice velocities |
C cycle ice velocities |
147 |
DO J=1-OLy,sNy+OLy |
DO J=1-OLy,sNy+OLy |
148 |
DO I=1-OLx,sNx+OLx |
DO I=1-OLx,sNx+OLx |
149 |
duIcNm1(I,J,bi,bj) = uIce(I,J,bi,bj) * abAlpha |
duIcNm1(I,J,bi,bj) = uIce(I,J,bi,bj) * bdfAlpha |
150 |
& + ( uIce(I,J,bi,bj) - uIceNm1(I,J,bi,bj) ) * abFac |
& + ( uIce(I,J,bi,bj) - uIceNm1(I,J,bi,bj) ) * bdfFac |
151 |
dvIcNm1(I,J,bi,bj) = vIce(I,J,bi,bj) * abAlpha |
dvIcNm1(I,J,bi,bj) = vIce(I,J,bi,bj) * bdfAlpha |
152 |
& + ( vIce(I,J,bi,bj) - vIceNm1(I,J,bi,bj) ) * abFac |
& + ( vIce(I,J,bi,bj) - vIceNm1(I,J,bi,bj) ) * bdfFac |
153 |
uIceNm1(I,J,bi,bj) = uIce(I,J,bi,bj) |
uIceNm1(I,J,bi,bj) = uIce(I,J,bi,bj) |
154 |
vIceNm1(I,J,bi,bj) = vIce(I,J,bi,bj) |
vIceNm1(I,J,bi,bj) = vIce(I,J,bi,bj) |
155 |
ENDDO |
ENDDO |
156 |
ENDDO |
ENDDO |
157 |
IF ( .NOT.SEAICEuseIMEX ) THEN |
C As long as IMEX is not properly implemented leave this commented out |
158 |
|
CML IF ( .NOT.SEAICEuseIMEX ) THEN |
159 |
C Compute things that do no change during the Newton iteration: |
C Compute things that do no change during the Newton iteration: |
160 |
C sea-surface tilt and wind stress: |
C sea-surface tilt and wind stress: |
161 |
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 |
162 |
DO J=1-OLy,sNy+OLy |
DO J=1-OLy,sNy+OLy |
163 |
DO I=1-OLx,sNx+OLx |
DO I=1-OLx,sNx+OLx |
164 |
FORCEX(I,J,bi,bj) = FORCEX0(I,J,bi,bj) |
FORCEX(I,J,bi,bj) = FORCEX0(I,J,bi,bj) |
167 |
& + seaiceMassV(I,J,bi,bj)*dvIcNm1(I,J,bi,bj)*recip_deltaT |
& + seaiceMassV(I,J,bi,bj)*dvIcNm1(I,J,bi,bj)*recip_deltaT |
168 |
ENDDO |
ENDDO |
169 |
ENDDO |
ENDDO |
170 |
ENDIF |
CML ENDIF |
171 |
ENDDO |
ENDDO |
172 |
ENDDO |
ENDDO |
173 |
C Start nonlinear Newton iteration: outer loop iteration |
C Start nonlinear Newton iteration: outer loop iteration |
188 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
189 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
190 |
zetaPre(I,J,bi,bj) = zeta(I,J,bi,bj) |
zetaPre(I,J,bi,bj) = zeta(I,J,bi,bj) |
191 |
|
zetaZPre(I,J,bi,bj)= zetaZ(I,J,bi,bj) |
192 |
etaPre(I,J,bi,bj) = eta(I,J,bi,bj) |
etaPre(I,J,bi,bj) = eta(I,J,bi,bj) |
193 |
etaZPre(I,J,bi,bj) = etaZ(I,J,bi,bj) |
etaZPre(I,J,bi,bj) = etaZ(I,J,bi,bj) |
194 |
dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj) |
dwatPre(I,J,bi,bj) = DWATN(I,J,bi,bj) |
245 |
IF ( SOLV_MAX_ITERS .GT. 0 ) |
IF ( SOLV_MAX_ITERS .GT. 0 ) |
246 |
& CALL SEAICE_PRECONDITIONER( |
& CALL SEAICE_PRECONDITIONER( |
247 |
U duIce, dvIce, |
U duIce, dvIce, |
248 |
I zetaPre, etaPre, etaZpre, dwatPre, |
I zetaPre, etaPre, etaZpre, zetaZpre, 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 |