/[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.12 - (hide annotations) (download)
Fri May 31 14:08:32 2013 UTC (11 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64k, checkpoint64j
Changes since 1.11: +9 -1 lines
Small fixes.

1 heimbach 1.12 C $Header: /u/gcmpack/MITgcm/model/src/main_do_loop.F,v 1.11 2013/05/30 21:07:09 heimbach 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     # ifdef ALLOW_DIVIDED_ADJOINT_MPI
122     # include "mpif.h"
123     # endif
124    
125     # include "tamc.h"
126    
127     # ifdef ALLOW_GGL90
128     # include "GGL90.h"
129     # endif
130     # ifdef ALLOW_PROFILES
131     # include "profiles.h"
132     # endif
133    
134     # ifdef ALLOW_ECCO_EVOLUTION
135     # ifdef ALLOW_ECCO
136     # include "ecco_cost.h"
137     # endif
138     # endif
139    
140 heimbach 1.8 # endif /* undef ALLOW_AUTODIFF_OPENAD */
141 heimbach 1.1
142     # ifdef ALLOW_CTRL
143     # include "CTRL_SIZE.h"
144     # include "ctrl.h"
145     # include "ctrl_dummy.h"
146     # include "CTRL_GENARR.h"
147     # endif
148     # ifdef ALLOW_COST
149     # include "cost.h"
150     # endif
151    
152 heimbach 1.8 # ifdef ALLOW_PTRACERS
153     # include "PTRACERS_SIZE.h"
154     # include "PTRACERS_FIELDS.h"
155     # include "PTRACERS_START.h"
156     # endif
157     # ifdef ALLOW_GCHEM
158     # include "GCHEM_FIELDS.h"
159     # endif
160     # ifdef ALLOW_CFC
161     # include "CFC.h"
162     # endif
163     # ifdef ALLOW_DIC
164     # include "DIC_VARS.h"
165     # include "DIC_LOAD.h"
166     # include "DIC_ATMOS.h"
167     # include "DIC_CTRL.h"
168     # include "DIC_COST.h"
169     # endif
170 heimbach 1.10 # ifdef ALLOW_OBCS
171     # include "OBCS_PARAMS.h"
172     # include "OBCS_FIELDS.h"
173     # include "OBCS_SEAICE.h"
174     # ifdef ALLOW_PTRACERS
175     # include "OBCS_PTRACERS.h"
176 heimbach 1.8 # endif
177 heimbach 1.10 # endif
178     # ifdef ALLOW_SHELFICE
179     # include "SHELFICE.h"
180     # include "SHELFICE_COST.h"
181     # endif
182     # ifdef ALLOW_STREAMICE
183     # include "STREAMICE.h"
184     # include "STREAMICE_ADV.h"
185     # include "STREAMICE_BDRY.h"
186     # include "STREAMICE_CG.h"
187     # endif
188 heimbach 1.8
189 heimbach 1.1 #endif /* ALLOW_AUTODIFF */
190     c**************************************
191    
192     C !INPUT/OUTPUT PARAMETERS:
193     C == Routine arguments ==
194     C note: under the multi-threaded model myiter and
195     C mytime are local variables passed around as routine
196     C arguments. Although this is fiddly it saves the need to
197     C impose additional synchronisation points when they are
198     C updated.
199     C myTime :: time counter for this thread
200     C myIter :: iteration counter for this thread
201     C myThid :: thread number for this instance of the routine.
202     _RL myTime
203     INTEGER myIter
204     INTEGER myThid
205    
206     C !FUNCTIONS:
207     C == Functions ==
208    
209     C !LOCAL VARIABLES:
210     C == Local variables ==
211 jmc 1.4 INTEGER iloop
212 heimbach 1.1 #ifdef ALLOW_AUTODIFF_TAMC
213     #ifdef STORE_LOADEDREC_TEST
214 jmc 1.4 INTEGER bi,bj
215 heimbach 1.1 #endif /* STORE_LOADEDREC_TEST */
216     #endif
217    
218     CEOP
219    
220 heimbach 1.12 #ifdef STORE_LOADEDREC_TEST
221     DO bj = myByLo(myThid), myByHi(myThid)
222     DO bi = myBxLo(myThid), myBxHi(myThid)
223     loadedRec(bi,bj) = 0
224     ENDDO
225     ENDDO
226     #endif /* STORE_LOADEDREC_TEST */
227    
228 heimbach 1.1 #ifdef ALLOW_DEBUG
229     IF (debugMode) CALL DEBUG_ENTER('MAIN_DO_LOOP',myThid)
230     #endif
231    
232     c >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
233     c >>>>>>>>>>>>>>>>>>>>>>>>>>> STARTS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
234    
235     #ifdef ALLOW_AUTODIFF_OPENAD
236 utke 1.3 DO iloop = 1, nTimeSteps
237 heimbach 1.1 #endif
238    
239     #ifdef ALLOW_DEBUG
240     IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid)
241     #endif
242    
243     #ifdef ALLOW_ATM2D
244     CALL TIMER_START('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',mythid)
245     CALL FORWARD_STEP_ATM2D( iloop, mytime, myiter, mythid )
246     CALL TIMER_STOP ('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',mythid)
247     #else
248     CALL TIMER_START('FORWARD_STEP [MAIN_DO_LOOP]',mythid)
249     CALL FORWARD_STEP( iloop, mytime, myiter, mythid )
250     CALL TIMER_STOP ('FORWARD_STEP [MAIN_DO_LOOP]',mythid)
251     #endif
252    
253 heimbach 1.11 #ifdef ALLOW_AUTODIFF_OPENAD
254 jmc 1.4 ENDDO
255 heimbach 1.11 #endif
256 heimbach 1.1
257     #ifdef ALLOW_DEBUG
258     IF (debugMode) CALL DEBUG_LEAVE('MAIN_DO_LOOP',myThid)
259     #endif
260    
261     RETURN
262     END

  ViewVC Help
Powered by ViewVC 1.1.22