25 |
#include "PARAMS.h" |
#include "PARAMS.h" |
26 |
#include "STREAMICE.h" |
#include "STREAMICE.h" |
27 |
#include "STREAMICE_CG.h" |
#include "STREAMICE_CG.h" |
28 |
!#ifdef ALLOW_PETSC |
|
|
!#include "finclude/petsc.h" |
|
|
!#endif |
|
29 |
|
|
30 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
31 |
# include "tamc.h" |
# include "tamc.h" |
56 |
_RL max_vel, tempu, tempv, err_lastchange, cgtol |
_RL max_vel, tempu, tempv, err_lastchange, cgtol |
57 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
58 |
LOGICAL CONVERGED |
LOGICAL CONVERGED |
59 |
#ifdef ALLOW_PETSC |
|
|
! myThidTemp = myThid |
|
|
! call streamice_initialize_petsc (myThidTemp) |
|
|
#endif |
|
60 |
! _RL taudx (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
! _RL taudx (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
61 |
! _RL taudy (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
! _RL taudy (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
62 |
|
|
123 |
_EXCH_XY_RL( tau_beta_eff_streamice , myThid ) |
_EXCH_XY_RL( tau_beta_eff_streamice , myThid ) |
124 |
_EXCH_XY_RL( visc_streamice , myThid ) |
_EXCH_XY_RL( visc_streamice , myThid ) |
125 |
|
|
126 |
|
! to stop ifort complaining |
127 |
|
err_init = 0. _d 0 |
128 |
|
|
129 |
if (STREAMICE_chkresidconvergence .or. |
if (STREAMICE_chkresidconvergence .or. |
130 |
& (streamice_maxnliter_cpl.eq.0 .and. myIter.eq.0)) then |
& (streamice_maxnliter_cpl.eq.0 .and. myIter.eq.0)) then |
131 |
|
|
132 |
|
|
133 |
CALL STREAMICE_GET_VEL_RESID_ERR ( err_init, myThid ) |
CALL STREAMICE_GET_VEL_RESID_ERR ( err_init, myThid ) |
134 |
|
|
135 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
153 |
|
|
154 |
DO iter=1,maxNLIter |
DO iter=1,maxNLIter |
155 |
|
|
156 |
|
|
157 |
C To avoid using "exit", loop goes through all iterations |
C To avoid using "exit", loop goes through all iterations |
158 |
C but after convergence loop does nothing |
C but after convergence loop does nothing |
159 |
|
|
323 |
ENDIF ! (err_max .GT. streamice_nonlin_tol * err_init) |
ENDIF ! (err_max .GT. streamice_nonlin_tol * err_init) |
324 |
ENDDO |
ENDDO |
325 |
|
|
326 |
#ifdef ALLOW_PETSC |
|
|
! call streamice_finalize_petsc (myThidTemp) |
|
|
! call streamice_finalize_petsc (myThid) |
|
|
#endif |
|
327 |
|
|
328 |
C END NL ITER. LOOP |
C END NL ITER. LOOP |
329 |
C------------------------------------------------------------------- |
C------------------------------------------------------------------- |
330 |
|
|
331 |
if (iter_numconv .lt. streamice_max_nl_iter) then |
if (iter_numconv .lt. maxnliter) then |
332 |
WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE CONVERGED, ', |
WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE CONVERGED, ', |
333 |
& iter_numconv, ' iterations' |
& iter_numconv, ' iterations' |
334 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |