14 |
|
|
15 |
integer iaddr |
integer iaddr |
16 |
external iaddr |
external iaddr |
17 |
|
_RL err_max |
18 |
!<------------------Begin user declarations ---------------------->! |
!<------------------Begin user declarations ---------------------->! |
19 |
! Insert declarations of dummy variables for calling adjoint computation |
! Insert declarations of dummy variables for calling adjoint computation |
20 |
! without side effects, and storing adjoint variable iterates |
! without side effects, and storing adjoint variable iterates |
63 |
CALL print_message(MSGBUF,STANDARDMESSAGEUNIT,'R',1) |
CALL print_message(MSGBUF,STANDARDMESSAGEUNIT,'R',1) |
64 |
|
|
65 |
!!!!!!!!!!!! conv check |
!!!!!!!!!!!! conv check |
|
|
|
|
if (STREAMICE_chkfixedptconvergence) then |
|
66 |
|
|
67 |
CALL openad_STREAMICE_GET_FP_ERR_OAD ( err_max_fp, myThid ) |
if (STREAMICE_chkresidconvergence) then |
68 |
|
|
69 |
WRITE(msgBuf,'(A,1PE22.14)') 'STREAMICE_FP_ERROR =', |
CALL openad_STREAMICE_GET_VEL_RESID_ERR_OAD (err_max,myThid) |
70 |
& err_max_fp |
|
71 |
|
WRITE(msgBuf,'(A,E15.7)') 'err/err_init', |
72 |
|
& err_max/err_init |
73 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
74 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
75 |
|
|
76 |
IF (err_max_fp .LE. streamice_nonlin_tol_fp) THEN |
IF (err_max .LE. streamice_nonlin_tol * err_init) THEN |
77 |
CONVERGED = .true. |
CONVERGED = .true. |
78 |
ENDIF |
ENDIF |
79 |
|
|
80 |
IF (err_max_fp<err_last_change*1.e-2 .and. |
IF (err_max<err_last_change*1.e-2 .and. |
81 |
& STREAMICE_lower_cg_tol) THEN |
& STREAMICE_lower_cg_tol) THEN |
82 |
cgtol = cgtol * 5.e-2 |
cgtol = cgtol * 5.e-2 |
83 |
err_last_change = err_max_fp |
err_last_change = err_max |
84 |
WRITE(msgBuf,'(A,E15.7)') 'new cg tol: ', |
WRITE(msgBuf,'(A,E15.7)') 'new cg tol: ', |
85 |
& cgtol |
& cgtol |
86 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
88 |
ENDIF |
ENDIF |
89 |
|
|
90 |
endif |
endif |
91 |
|
|
92 |
|
if (STREAMICE_chkfixedptconvergence) then |
93 |
|
|
94 |
|
CALL openad_STREAMICE_GET_FP_ERR_OAD ( err_max_fp, myThid ) |
95 |
|
|
96 |
|
WRITE(msgBuf,'(A,1PE22.14)') 'STREAMICE_FP_ERROR =', |
97 |
|
& err_max_fp |
98 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
99 |
|
& SQUEEZE_RIGHT , 1) |
100 |
|
|
101 |
|
IF (err_max_fp .LE. streamice_nonlin_tol_fp) THEN |
102 |
|
CONVERGED = .true. |
103 |
|
ENDIF |
104 |
|
|
105 |
|
|
106 |
|
endif |
107 |
|
|
108 |
!!!!!!!!!!!! end conv check |
!!!!!!!!!!!! end conv check |
109 |
|
|
165 |
|
|
166 |
!---- conv check |
!---- conv check |
167 |
|
|
168 |
if (STREAMICE_chkfixedptconvergence) then |
if (STREAMICE_chkresidconvergence) then |
169 |
|
|
170 |
CALL openad_STREAMICE_GET_FP_ERR_OAD ( err_max_fp, myThid ) |
CALL openad_STREAMICE_GET_VEL_RESID_ERR_OAD (err_max,myThid) |
171 |
|
|
172 |
WRITE(msgBuf,'(A,1PE22.14)') 'STREAMICE_FP_ERROR =', |
WRITE(msgBuf,'(A,E15.7)') 'err/err_init', |
173 |
& err_max_fp |
& err_max/err_init |
174 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
175 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
176 |
|
|
177 |
IF (err_max_fp .LE. streamice_nonlin_tol_fp) THEN |
IF (err_max .LE. streamice_nonlin_tol * err_init) THEN |
178 |
CONVERGED = .true. |
CONVERGED = .true. |
179 |
ENDIF |
ENDIF |
180 |
|
|
181 |
IF (err_max_fp<err_last_change*1.e-2 .and. |
IF (err_max<err_last_change*1.e-2 .and. |
182 |
& STREAMICE_lower_cg_tol) THEN |
& STREAMICE_lower_cg_tol) THEN |
183 |
cgtol = cgtol * 5.e-2 |
cgtol = cgtol * 5.e-2 |
184 |
err_last_change = err_max_fp |
err_last_change = err_max |
185 |
WRITE(msgBuf,'(A,E15.7)') 'new cg tol: ', |
WRITE(msgBuf,'(A,E15.7)') 'new cg tol: ', |
186 |
& cgtol |
& cgtol |
187 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
190 |
|
|
191 |
endif |
endif |
192 |
|
|
193 |
|
if (STREAMICE_chkfixedptconvergence) then |
194 |
|
|
195 |
|
CALL openad_STREAMICE_GET_FP_ERR_OAD ( err_max_fp, myThid ) |
196 |
|
|
197 |
|
WRITE(msgBuf,'(A,1PE22.14)') 'STREAMICE_FP_ERROR =', |
198 |
|
& err_max_fp |
199 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
200 |
|
& SQUEEZE_RIGHT , 1) |
201 |
|
|
202 |
|
IF (err_max_fp .LE. streamice_nonlin_tol_fp) THEN |
203 |
|
CONVERGED = .true. |
204 |
|
ENDIF |
205 |
|
|
206 |
|
endif |
207 |
|
|
208 |
!--------conv check done |
!--------conv check done |
209 |
|
|
210 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
232 |
our_rev_mode%plain=.false. |
our_rev_mode%plain=.false. |
233 |
our_rev_mode%tape=.true. |
our_rev_mode%tape=.true. |
234 |
our_rev_mode%adjoint=.false. |
our_rev_mode%adjoint=.false. |
235 |
CALL OpenAD_streamice_vel_phi(MYTHID,MAXNLITER,MAXCGITER,CGTOL |
CALL OpenAD_streamice_vel_phi(MYTHID,MAXNLITER,MAXCGITER,CG |
236 |
+,CG_ITERS) |
+TOL,CG_ITERS) |
237 |
end if |
end if |
238 |
end if |
end if |
239 |
end if |
end if |