/[MITgcm]/MITgcm/model/src/main_do_loop.F
ViewVC logotype

Annotation of /MITgcm/model/src/main_do_loop.F

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


Revision 1.21 - (hide annotations) (download)
Mon May 23 13:12:09 2016 UTC (8 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint65z, checkpoint65x, checkpoint65y
Changes since 1.20: +7 -1 lines
include some of pkg/bling header files.

1 jmc 1.21 C $Header: /u/gcmpack/MITgcm/model/src/main_do_loop.F,v 1.20 2015/07/04 17:58:26 heimbach Exp $
2 heimbach 1.1 C $Name: $
3    
4     #include "PACKAGES_CONFIG.h"
5     #include "CPP_OPTIONS.h"
6 heimbach 1.20 #ifdef ALLOW_OPENAD
7     # include "OPENAD_OPTIONS.h"
8     #endif
9 jmc 1.16 c#ifdef ALLOW_AUTODIFF
10     c# include "AUTODIFF_OPTIONS.h"
11     c#endif
12 heimbach 1.1 #ifdef ALLOW_OBCS
13     # include "OBCS_OPTIONS.h"
14     #endif
15     #ifdef ALLOW_SEAICE
16     # include "SEAICE_OPTIONS.h"
17     #endif
18     #ifdef ALLOW_GENERIC_ADVDIFF
19     # include "GAD_OPTIONS.h"
20     #endif
21     #ifdef ALLOW_GMREDI
22     # include "GMREDI_OPTIONS.h"
23     #endif
24     #ifdef ALLOW_STREAMICE
25     # include "STREAMICE_OPTIONS.h"
26     #endif
27     #ifdef ALLOW_GGL90
28     # include "GGL90_OPTIONS.h"
29     #endif
30     #ifdef ALLOW_EXF
31     # include "EXF_OPTIONS.h"
32     #endif
33 jmc 1.16 #ifdef ALLOW_COST
34     # include "COST_OPTIONS.h"
35     #endif
36 heimbach 1.1 #ifdef ALLOW_CTRL
37     # include "CTRL_OPTIONS.h"
38     #endif
39 gforget 1.18 c#ifdef ALLOW_ECCO
40     c# include "ECCO_OPTIONS.h"
41     c#endif
42 heimbach 1.1
43     CBOP
44     C !ROUTINE: MAIN_DO_LOOP
45     C !INTERFACE:
46 heimbach 1.11 SUBROUTINE MAIN_DO_LOOP( iloop, myTime, myIter, myThid )
47 heimbach 1.1
48     C !DESCRIPTION: \bv
49     C *================================================================*
50     C | SUBROUTINE the_loop_body
51     C | o Run the ocean model and evaluate the specified cost function.
52     C *================================================================*
53     C |
54     C | MAIN_DO_LOOP is the toplevel routine for the Tangent Linear and
55     C | Adjoint Model Compiler (TAMC).
56     C | For this purpose the initialization
57     C | of the model was split into two parts. Those parameters that do
58     C | not depend on a specific model run are set in INITIALISE_FIXED,
59     C | whereas those that do depend on the specific realization are
60     C | initialized in INITIALISE_VARIA.
61     C | This routine is to be used in conjuction with the MITgcmuv
62     C | checkpoint 37.
63     C *================================================================*
64     C \ev
65    
66     C !USES:
67     IMPLICIT NONE
68     C == Global variables ==
69     #include "SIZE.h"
70     #include "EEPARAMS.h"
71     #include "PARAMS.h"
72    
73     c**************************************
74 jmc 1.16 #ifdef ALLOW_OPENAD
75 heimbach 1.1
76     # ifdef ALLOW_CTRL
77 jmc 1.15 # include "CTRL_SIZE.h"
78     # include "ctrl.h"
79     # include "ctrl_dummy.h"
80     # include "CTRL_GENARR.h"
81 gforget 1.17 # include "CTRL_OBCS.h"
82 heimbach 1.1 # endif
83     # ifdef ALLOW_COST
84     # include "cost.h"
85     # endif
86    
87 jmc 1.15 # ifdef ALLOW_PTRACERS
88     # include "PTRACERS_SIZE.h"
89     # include "PTRACERS_FIELDS.h"
90     # include "PTRACERS_START.h"
91     # endif
92 heimbach 1.8 # ifdef ALLOW_GCHEM
93     # include "GCHEM_FIELDS.h"
94     # endif
95     # ifdef ALLOW_CFC
96     # include "CFC.h"
97     # endif
98     # ifdef ALLOW_DIC
99     # include "DIC_VARS.h"
100     # include "DIC_LOAD.h"
101     # include "DIC_ATMOS.h"
102     # include "DIC_CTRL.h"
103     # include "DIC_COST.h"
104     # endif
105 jmc 1.21 # ifdef ALLOW_BLING
106     # include "BLING_VARS.h"
107     # include "BLING_LOAD.h"
108     # include "BLING_CTRL.h"
109     # include "BLING_COST.h"
110     # endif
111 heimbach 1.10 # ifdef ALLOW_OBCS
112     # include "OBCS_PARAMS.h"
113     # include "OBCS_FIELDS.h"
114     # include "OBCS_SEAICE.h"
115     # ifdef ALLOW_PTRACERS
116     # include "OBCS_PTRACERS.h"
117 heimbach 1.8 # endif
118 heimbach 1.10 # endif
119     # ifdef ALLOW_SHELFICE
120     # include "SHELFICE.h"
121     # include "SHELFICE_COST.h"
122     # endif
123     # ifdef ALLOW_STREAMICE
124     # include "STREAMICE.h"
125     # include "STREAMICE_ADV.h"
126     # include "STREAMICE_BDRY.h"
127     # include "STREAMICE_CG.h"
128     # endif
129 heimbach 1.8
130 jmc 1.16 #endif /* ALLOW_OPENAD */
131 heimbach 1.1 c**************************************
132    
133     C !INPUT/OUTPUT PARAMETERS:
134     C == Routine arguments ==
135 jmc 1.13 C note: under the multi-threaded model myIter and
136     C myTime are local variables passed around as routine
137 heimbach 1.1 C arguments. Although this is fiddly it saves the need to
138     C impose additional synchronisation points when they are
139     C updated.
140     C myTime :: time counter for this thread
141     C myIter :: iteration counter for this thread
142     C myThid :: thread number for this instance of the routine.
143     _RL myTime
144     INTEGER myIter
145     INTEGER myThid
146    
147     C !FUNCTIONS:
148     C == Functions ==
149    
150     C !LOCAL VARIABLES:
151     C == Local variables ==
152 jmc 1.4 INTEGER iloop
153 heimbach 1.1 CEOP
154    
155     #ifdef ALLOW_DEBUG
156     IF (debugMode) CALL DEBUG_ENTER('MAIN_DO_LOOP',myThid)
157     #endif
158    
159 jmc 1.16 #ifdef ALLOW_OPENAD
160 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
161     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STARTS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
162 heimbach 1.20 # ifdef ALLOW_OPENAD_DIVA
163 heimbach 1.19 DO iloop = 1, nTimeSteps_l2
164 heimbach 1.20 # else
165 utke 1.3 DO iloop = 1, nTimeSteps
166 heimbach 1.20 # endif
167 heimbach 1.1
168 heimbach 1.20 #endif /* ALLOW_OPENAD */
169 heimbach 1.19
170 heimbach 1.1 #ifdef ALLOW_DEBUG
171     IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid)
172     #endif
173    
174 heimbach 1.19 #ifndef ALLOW_OPENAD
175 heimbach 1.20 # ifdef ALLOW_ATM2D
176 jmc 1.13 CALL TIMER_START('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
177     CALL FORWARD_STEP_ATM2D( iloop, myTime, myIter, myThid )
178     CALL TIMER_STOP ('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
179 heimbach 1.20 # else
180 jmc 1.13 CALL TIMER_START('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
181     CALL FORWARD_STEP( iloop, myTime, myIter, myThid )
182     CALL TIMER_STOP ('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
183 heimbach 1.20 # endif
184 heimbach 1.19 #else
185 heimbach 1.20 # ifdef ALLOW_OPENAD_DIVA
186 heimbach 1.19 CALL TIMER_START('INNER_DO_LOOP [MAIN_DO_LOOP]',myThid)
187     nTimeSteps_l2 = 2
188     CALL INNER_DO_LOOP( iloop, myTime, myIter, myThid )
189     CALL TIMER_STOP ('INNER_DO_LOOP [MAIN_DO_LOOP]',myThid)
190 heimbach 1.20 # else
191 heimbach 1.19 CALL TIMER_START('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
192     nTimeSteps_l2 = 2
193     CALL FORWARD_STEP( iloop, myTime, myIter, myThid )
194     CALL TIMER_STOP ('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
195 heimbach 1.20 # endif
196     #endif /* ndef ALLOW_OPENAD */
197 heimbach 1.1
198 jmc 1.16 #ifdef ALLOW_OPENAD
199 jmc 1.4 ENDDO
200 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
201     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STOPS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
202 heimbach 1.20 #endif /* ALLOW_OPENAD */
203 heimbach 1.1
204     #ifdef ALLOW_DEBUG
205     IF (debugMode) CALL DEBUG_LEAVE('MAIN_DO_LOOP',myThid)
206     #endif
207    
208     RETURN
209     END

  ViewVC Help
Powered by ViewVC 1.1.22