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

Annotation 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.1 - (hide annotations) (download)
Tue Oct 14 15:41:10 2014 UTC (10 years, 9 months ago) by dgoldberg
Branch: MAIN
source files for streamice verification -- oad fixed point

1 dgoldberg 1.1 C $Header: /u/gcmpack/MITgcm/pkg/streamice/streamice_vel_solve.F,v 1.9 2014/09/09 23:09:21 jmc 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     CALL STREAMICE_VEL_PHISTAGE (
82     I myThid,
83     I maxNLIter,
84     I maxCGiter,
85     O cgtol,
86     O nL_iter,
87     O CONVERGED,
88     O err_last_change,
89     I isinloop0)
90    
91    
92     DO loopiter=1,maxNLIter
93    
94     C To avoid using "exit", loop goes through all iterations
95     C but after convergence loop does nothing
96    
97     ! IF (.not.CONVERGED) THEN
98    
99     CALL STREAMICE_VEL_PHISTAGE (
100     I myThid,
101     I maxNLIter,
102     I maxCGiter,
103     O cgtol,
104     O nL_iter,
105     O CONVERGED,
106     O err_last_change,
107     I isinloop1)
108    
109    
110     ENDDO
111    
112     CALL STREAMICE_VEL_PHISTAGE (
113     I myThid,
114     I maxNLIter,
115     I maxCGiter,
116     O cgtol,
117     O nL_iter,
118     O CONVERGED,
119     O err_last_change,
120     I isinloop2)
121    
122    
123     C END NL ITER. LOOP
124     C-------------------------------------------------------------------
125    
126     if (nl_iter .lt. streamice_max_nl_iter) then
127     WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE CONVERGED, ',
128     & nl_iter, ' iterations'
129     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
130     & SQUEEZE_RIGHT , 1)
131     else
132     WRITE(msgBuf,'(A,I5,A)') 'VELOCITY SOLVE NOT CONVERGED IN ',
133     & nl_iter, ' iterations'
134     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
135     & SQUEEZE_RIGHT , 1)
136     endif
137    
138     _EXCH_XY_RL(U_streamice, myThid)
139     _EXCH_XY_RL(V_streamice, myThid)
140    
141     CALL TIMER_STOP ('STREAMICE_VEL_SOLVE',myThid)
142    
143     #endif
144     RETURN
145     END

  ViewVC Help
Powered by ViewVC 1.1.22