/[MITgcm]/MITgcm_contrib/dgoldberg/streamice_oad_files/streamice_vel_solve_openad.F~
ViewVC logotype

Contents of /MITgcm_contrib/dgoldberg/streamice_oad_files/streamice_vel_solve_openad.F~

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


Revision 1.2 - (show annotations) (download)
Tue Oct 14 15:43:22 2014 UTC (11 years, 2 months ago) by dgoldberg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
cleanup

1 C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice_oad_files/streamice_vel_solve_openad.F~,v 1.1 2014/10/14 15:41:10 dgoldberg Exp $
2 C $Name: $
3
4 #include "STREAMICE_OPTIONS.h"
5 #ifdef ALLOW_AUTODIFF
6 # include "AUTODIFF_OPTIONS.h"
7 #endif
8
9 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
10
11 CBOP
12 SUBROUTINE STREAMICE_VEL_SOLVE_OPENAD ( myThid, maxNLIter,
13 & maxCGiter, myiter )
14 C /============================================================\
15 C | SUBROUTINE |
16 C | o |
17 C |============================================================|
18 C | |
19 C \============================================================/
20 IMPLICIT NONE
21
22 C === Global variables ===
23 #include "SIZE.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #include "STREAMICE.h"
27 #include "STREAMICE_CG.h"
28
29
30 #ifdef ALLOW_AUTODIFF_TAMC
31 # include "tamc.h"
32 #endif
33
34 C !INPUT/OUTPUT ARGUMENTS
35 INTEGER myThid
36 INTEGER maxNLIter
37 INTEGER maxCGIter
38 INTEGER myIter
39
40 #ifdef ALLOW_STREAMICE
41
42 C LOCAL VARIABLES
43
44 INTEGER i, j, k, l, bi, bj, loopiter
45 CHARACTER*(MAX_LEN_MBUF) msgBuf
46
47 INTEGER NL_iter
48 _RL err_last_change, cgtol
49 LOGICAL CONVERGED
50
51
52 #ifdef ALLOW_OPENAD
53 isinloop0 =0
54 isinloop1 =1
55 isinloop2 =2
56 #endif
57
58
59 IF (STREAMICE_ppm_driving_stress) THEN
60 CALL STREAMICE_DRIVING_STRESS_PPM (myThid)
61 ELSE
62 CALL STREAMICE_DRIVING_STRESS (myThid)
63 ENDIF
64
65 #ifdef STREAMICE_STRESS_BOUNDARY_CONTROL
66 _EXCH_XY_RL( taudx_SI , myThid )
67 _EXCH_XY_RL( taudy_SI , myThid )
68 CALL STREAMICE_FORCED_BUTTRESS (myThid)
69 #endif
70
71 CALL TIMER_START ('STREAMICE_VEL_SOLVE',myThid)
72
73 cgtol = streamice_cg_tol
74 nl_iter = 0
75 CONVERGED = .false.
76 err_last_change = 1 _d 1
77
78 _EXCH_XY_RL( taudx_SI , myThid )
79 _EXCH_XY_RL( taudy_SI , myThid )
80
81
82 DO loopiter=1,maxNLIter
83
84 C To avoid using "exit", loop goes through all iterations
85 C but after convergence loop does nothing
86
87 ! IF (.not.CONVERGED) THEN
88
89 CALL STREAMICE_VEL_PHISTAGE (
90 I myThid,
91 I maxNLIter,
92 I maxCGiter,
93 O cgtol,
94 O nL_iter,
95 O CONVERGED,
96 O err_last_change,
97 I 1)
98
99
100 ENDDO
101
102
103 C END NL ITER. LOOP
104 C-------------------------------------------------------------------
105
106 if (nl_iter .lt. streamice_max_nl_iter) then
107 WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE CONVERGED, ',
108 & nl_iter, ' iterations'
109 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
110 & SQUEEZE_RIGHT , 1)
111 else
112 WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE NOT CONVERGED IN ',
113 & nl_iter, ' iterations'
114 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
115 & SQUEEZE_RIGHT , 1)
116 endif
117
118 _EXCH_XY_RL(U_streamice, myThid)
119 _EXCH_XY_RL(V_streamice, myThid)
120
121 CALL TIMER_STOP ('STREAMICE_VEL_SOLVE',myThid)
122
123 #endif
124 RETURN
125 END

  ViewVC Help
Powered by ViewVC 1.1.22