/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_vel_solve.F
ViewVC logotype

Diff of /MITgcm_contrib/dgoldberg/streamice/streamice_vel_solve.F

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

revision 1.2 by heimbach, Wed May 2 02:36:01 2012 UTC revision 1.5 by dgoldberg, Thu Jul 26 16:13:18 2012 UTC
# Line 94  C     LOCAL VARIABLES Line 94  C     LOCAL VARIABLES
94         ENDDO         ENDDO
95        ENDDO        ENDDO
96    
97    
98        CALL STREAMICE_CG_BOUND_VALS( myThid,            CALL STREAMICE_CG_BOUND_VALS( myThid,    
99       O    ubd_SI,       O    ubd_SI,
100       O    vbd_SI)       O    vbd_SI)
# Line 142  C     LOCAL VARIABLES Line 143  C     LOCAL VARIABLES
143    
144        CALL GLOBAL_MAX_R8 (err_init, myThid)        CALL GLOBAL_MAX_R8 (err_init, myThid)
145    
146          WRITE(msgBuf,'(A,E15.7)') 'initial nonlinear resid (error): ',
147         &                       err_init
148          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
149         &                    SQUEEZE_RIGHT , 1)
150    
151    
152        iter_numconv = 0        iter_numconv = 0
153        err_max = err_init        err_max = err_init
154        err_lastchange = err_init        err_lastchange = err_init
# Line 201  C       but after convergence loop does Line 208  C       but after convergence loop does
208  !$TAF STORE zv_old_si = comlev1_stream_nl, key=ikey_nl  !$TAF STORE zv_old_si = comlev1_stream_nl, key=ikey_nl
209  #endif  #endif
210    
211         CALL STREAMICE_CG_SOLVE(  #ifdef ALLOW_AUTODIFF_TAMC
212       &  U_streamice,  !       DO bj = myByLo(myThid), myByHi(myThid)
213       &  V_streamice,  !        DO bi = myBxLo(myThid), myBxHi(myThid)
214       &  taudx_SI,  !         DO j=1-OLy,sNy+OLy
215       &  taudy_SI,  !          DO i=1-OLx,sNx+OLx
216       &  cgtol,  !           U_streamice (i,j,bi,bj) = 0. _d 0
217       &  cg_iters,  !           V_streamice (i,j,bi,bj) = 0. _d 0
218       &  myThid )  !          ENDDO
219    !         ENDDO
220    !        ENDDO
221    !       ENDDO
222    #endif
223    
224           CALL STREAMICE_CG_WRAPPER(
225         &       U_streamice,
226         &       V_streamice,
227         &       taudx_SI,
228         &       taudy_SI,
229         &       cgtol,
230         &       cg_iters,
231         &       myThid )
232    
233                
234    
# Line 225  C       but after convergence loop does Line 245  C       but after convergence loop does
245  #endif  #endif
246    
247         CALL STREAMICE_VISC_BETA ( myThid )         CALL STREAMICE_VISC_BETA ( myThid )
248    
249    
250  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
251  !$TAF STORE U_streamice = comlev1_stream_nl, key=ikey_nl  !$TAF STORE U_streamice = comlev1_stream_nl, key=ikey_nl
# Line 309  C       but after convergence loop does Line 330  C       but after convergence loop does
330       &   STREAMICE_lower_cg_tol) THEN       &   STREAMICE_lower_cg_tol) THEN
331           cgtol = cgtol * 5.e-2           cgtol = cgtol * 5.e-2
332           err_lastchange = err_max           err_lastchange = err_max
333           WRITE(msgBuf,'(A,F11.7)') 'new cg tol: ',           WRITE(msgBuf,'(A,E15.7)') 'new cg tol: ',
334       &                       cgtol       &                       cgtol
335           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
336       &                    SQUEEZE_RIGHT , 1)       &                    SQUEEZE_RIGHT , 1)
337         ENDIF         ENDIF
338    
339    
340         ENDIF ! (err_max .GT. streamice_nonlin_tol * err_init)         ENDIF ! (err_max .GT. streamice_nonlin_tol * err_init)
341        ENDDO        ENDDO
342    
# Line 322  C END NL ITER. LOOP Line 344  C END NL ITER. LOOP
344  C-------------------------------------------------------------------  C-------------------------------------------------------------------
345    
346        if (iter_numconv .lt. streamice_max_nl_iter) then        if (iter_numconv .lt. streamice_max_nl_iter) then
347         PRINT *, "VELOCITY SOLVE CONVERGED, ", iter_numconv,         WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE CONVERGED, ',
348       & " iterations"       &         iter_numconv, ' iterations'
349           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
350         &                     SQUEEZE_RIGHT , 1)
351        else        else
352         PRINT *, "VELOCITY SOLVE DID NOT CONVERGE IN ",         WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE NOT CONVERGED IN ',
353       & iter, " iterations"       &         iter_numconv, ' iterations'
354           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
355         &                     SQUEEZE_RIGHT , 1)
356        endif        endif
357    
358    !        DO bj = myByLo(myThid), myByHi(myThid)
359    !         DO bi = myBxLo(myThid), myBxHi(myThid)
360    !          DO j=1,sNy
361    !           DO i=1,sNx
362    !            U_streamice (i,j,bi,bj) = 0. _d 0
363    !            V_streamice (i,j,bi,bj) = 0. _d 0
364    !           ENDDO
365    !          ENDDO
366    !         ENDDO
367    !        ENDDO
368    !
369    !        CALL STREAMICE_CG_WRAPPER(
370    !      &       U_streamice,
371    !      &       V_streamice,
372    !      &       taudx_SI,
373    !      &       taudy_SI,
374    !      &       cgtol,
375    !      &       cg_iters,
376    !      &       myThid )
377    
378    
379        _EXCH_XY_RL (U_streamice, myThid)        _EXCH_XY_RL (U_streamice, myThid)
380        _EXCH_XY_RL (V_streamice, myThid)        _EXCH_XY_RL (V_streamice, myThid)
381    

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

  ViewVC Help
Powered by ViewVC 1.1.22