/[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.14 - (hide annotations) (download)
Sat Aug 3 17:40:35 2013 UTC (10 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.13: +5 -18 lines
move back loadedRec 2nd initialisation from main_do_loop.F to the_main_loop.F
 (just for testing loadedRec usage, within #ifdef STORE_LOADEDREC_TEST)

1 jmc 1.14 C $Header: /u/gcmpack/MITgcm/model/src/main_do_loop.F,v 1.13 2013/07/24 20:07:18 jmc Exp $
2 heimbach 1.1 C $Name: $
3    
4     #include "PACKAGES_CONFIG.h"
5     #include "CPP_OPTIONS.h"
6     #ifdef ALLOW_OBCS
7     # include "OBCS_OPTIONS.h"
8     #endif
9     #ifdef ALLOW_SEAICE
10     # include "SEAICE_OPTIONS.h"
11     #endif
12     #ifdef ALLOW_GENERIC_ADVDIFF
13     # include "GAD_OPTIONS.h"
14     #endif
15     #ifdef ALLOW_GMREDI
16     # include "GMREDI_OPTIONS.h"
17     #endif
18     #ifdef ALLOW_STREAMICE
19     # include "STREAMICE_OPTIONS.h"
20     #endif
21     #ifdef ALLOW_GGL90
22     # include "GGL90_OPTIONS.h"
23     #endif
24     #ifdef ALLOW_EXF
25     # include "EXF_OPTIONS.h"
26     #endif
27     #ifdef ALLOW_CTRL
28     # include "CTRL_OPTIONS.h"
29     #endif
30    
31     CBOP
32     C !ROUTINE: MAIN_DO_LOOP
33     C !INTERFACE:
34 heimbach 1.11 SUBROUTINE MAIN_DO_LOOP( iloop, myTime, myIter, myThid )
35 heimbach 1.1
36     C !DESCRIPTION: \bv
37     C *================================================================*
38     C | SUBROUTINE the_loop_body
39     C | o Run the ocean model and evaluate the specified cost function.
40     C *================================================================*
41     C |
42     C | MAIN_DO_LOOP is the toplevel routine for the Tangent Linear and
43     C | Adjoint Model Compiler (TAMC).
44     C | For this purpose the initialization
45     C | of the model was split into two parts. Those parameters that do
46     C | not depend on a specific model run are set in INITIALISE_FIXED,
47     C | whereas those that do depend on the specific realization are
48     C | initialized in INITIALISE_VARIA.
49     C | This routine is to be used in conjuction with the MITgcmuv
50     C | checkpoint 37.
51     C *================================================================*
52     C \ev
53    
54     C !USES:
55     IMPLICIT NONE
56     C == Global variables ==
57     #include "SIZE.h"
58     #include "EEPARAMS.h"
59     #include "PARAMS.h"
60    
61     c**************************************
62     #ifdef ALLOW_AUTODIFF
63     # ifndef ALLOW_AUTODIFF_OPENAD
64    
65     c These includes are needed for
66     c AD-checkpointing.
67     c They provide the fields to be stored.
68    
69     # include "AUTODIFF_MYFIELDS.h"
70     # include "GRID.h"
71     # include "DYNVARS.h"
72     # include "SURFACE.h"
73     # include "FFIELDS.h"
74     # include "EOS.h"
75     # include "AUTODIFF.h"
76    
77     # ifdef ALLOW_GENERIC_ADVDIFF
78     # include "GAD.h"
79     # include "GAD_SOM_VARS.h"
80     # endif
81     # ifdef ALLOW_MOM_FLUXFORM
82     # include "MOM_FLUXFORM.h"
83     # endif
84     # ifdef ALLOW_CD_CODE
85     # include "CD_CODE_VARS.h"
86     # endif
87     # ifdef ALLOW_EXF
88     # include "EXF_FIELDS.h"
89     # ifdef ALLOW_BULKFORMULAE
90     # include "EXF_CONSTANTS.h"
91     # endif
92     # endif /* ALLOW_EXF */
93     # ifdef ALLOW_SEAICE
94     # include "SEAICE_SIZE.h"
95     # include "SEAICE.h"
96     # include "SEAICE_PARAMS.h"
97     # include "SEAICE_COST.h"
98     # include "SEAICE_TRACER.h"
99     # endif
100     # ifdef ALLOW_SALT_PLUME
101     # include "SALT_PLUME.h"
102     # endif
103     # ifdef ALLOW_THSICE
104     # include "THSICE_SIZE.h"
105     # include "THSICE_VARS.h"
106 heimbach 1.9 # include "THSICE_COST.h"
107 heimbach 1.1 # endif
108     # ifdef ALLOW_EBM
109     # include "EBM.h"
110     # endif
111     # ifdef ALLOW_RBCS
112     # include "RBCS_SIZE.h"
113     # include "RBCS_FIELDS.h"
114     # endif
115     # ifdef ALLOW_OFFLINE
116     # include "OFFLINE.h"
117     # endif
118     # ifdef ALLOW_CG2D_NSA
119     # include "CG2D.h"
120     # endif
121 jmc 1.13 # ifdef ALLOW_DIVIDED_ADJOINT
122     # ifdef ALLOW_USE_MPI
123     # include "mpif.h"
124     # endif
125 heimbach 1.1 # endif
126    
127     # include "tamc.h"
128    
129     # ifdef ALLOW_GGL90
130     # include "GGL90.h"
131     # endif
132     # ifdef ALLOW_PROFILES
133     # include "profiles.h"
134     # endif
135    
136     # ifdef ALLOW_ECCO_EVOLUTION
137     # ifdef ALLOW_ECCO
138     # include "ecco_cost.h"
139     # endif
140     # endif
141    
142 heimbach 1.8 # endif /* undef ALLOW_AUTODIFF_OPENAD */
143 heimbach 1.1
144     # ifdef ALLOW_CTRL
145     # include "CTRL_SIZE.h"
146     # include "ctrl.h"
147     # include "ctrl_dummy.h"
148     # include "CTRL_GENARR.h"
149     # endif
150     # ifdef ALLOW_COST
151     # include "cost.h"
152     # endif
153    
154 heimbach 1.8 # ifdef ALLOW_PTRACERS
155     # include "PTRACERS_SIZE.h"
156     # include "PTRACERS_FIELDS.h"
157     # include "PTRACERS_START.h"
158     # endif
159     # ifdef ALLOW_GCHEM
160     # include "GCHEM_FIELDS.h"
161     # endif
162     # ifdef ALLOW_CFC
163     # include "CFC.h"
164     # endif
165     # ifdef ALLOW_DIC
166     # include "DIC_VARS.h"
167     # include "DIC_LOAD.h"
168     # include "DIC_ATMOS.h"
169     # include "DIC_CTRL.h"
170     # include "DIC_COST.h"
171     # endif
172 heimbach 1.10 # ifdef ALLOW_OBCS
173     # include "OBCS_PARAMS.h"
174     # include "OBCS_FIELDS.h"
175     # include "OBCS_SEAICE.h"
176     # ifdef ALLOW_PTRACERS
177     # include "OBCS_PTRACERS.h"
178 heimbach 1.8 # endif
179 heimbach 1.10 # endif
180     # ifdef ALLOW_SHELFICE
181     # include "SHELFICE.h"
182     # include "SHELFICE_COST.h"
183     # endif
184     # ifdef ALLOW_STREAMICE
185     # include "STREAMICE.h"
186     # include "STREAMICE_ADV.h"
187     # include "STREAMICE_BDRY.h"
188     # include "STREAMICE_CG.h"
189     # endif
190 heimbach 1.8
191 heimbach 1.1 #endif /* ALLOW_AUTODIFF */
192     c**************************************
193    
194     C !INPUT/OUTPUT PARAMETERS:
195     C == Routine arguments ==
196 jmc 1.13 C note: under the multi-threaded model myIter and
197     C myTime are local variables passed around as routine
198 heimbach 1.1 C arguments. Although this is fiddly it saves the need to
199     C impose additional synchronisation points when they are
200     C updated.
201     C myTime :: time counter for this thread
202     C myIter :: iteration counter for this thread
203     C myThid :: thread number for this instance of the routine.
204     _RL myTime
205     INTEGER myIter
206     INTEGER myThid
207    
208     C !FUNCTIONS:
209     C == Functions ==
210    
211     C !LOCAL VARIABLES:
212     C == Local variables ==
213 jmc 1.4 INTEGER iloop
214 heimbach 1.1 CEOP
215    
216     #ifdef ALLOW_DEBUG
217     IF (debugMode) CALL DEBUG_ENTER('MAIN_DO_LOOP',myThid)
218     #endif
219    
220     #ifdef ALLOW_AUTODIFF_OPENAD
221 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
222     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STARTS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
223 utke 1.3 DO iloop = 1, nTimeSteps
224 heimbach 1.1 #endif
225    
226     #ifdef ALLOW_DEBUG
227     IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid)
228     #endif
229    
230     #ifdef ALLOW_ATM2D
231 jmc 1.13 CALL TIMER_START('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
232     CALL FORWARD_STEP_ATM2D( iloop, myTime, myIter, myThid )
233     CALL TIMER_STOP ('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
234 heimbach 1.1 #else
235 jmc 1.13 CALL TIMER_START('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
236     CALL FORWARD_STEP( iloop, myTime, myIter, myThid )
237     CALL TIMER_STOP ('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
238 heimbach 1.1 #endif
239    
240 heimbach 1.11 #ifdef ALLOW_AUTODIFF_OPENAD
241 jmc 1.4 ENDDO
242 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
243     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STOPS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
244 heimbach 1.11 #endif
245 heimbach 1.1
246     #ifdef ALLOW_DEBUG
247     IF (debugMode) CALL DEBUG_LEAVE('MAIN_DO_LOOP',myThid)
248     #endif
249    
250     RETURN
251     END

  ViewVC Help
Powered by ViewVC 1.1.22