/[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.15 - (hide annotations) (download)
Sat Aug 3 23:15:09 2013 UTC (10 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64o, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64n, checkpoint64m, checkpoint64l
Changes since 1.14: +76 -91 lines
no longer includes additional (AUTODIFF) header files when using TAF
 but only if using OpenAD

1 jmc 1.15 C $Header: /u/gcmpack/MITgcm/model/src/main_do_loop.F,v 1.14 2013/08/03 17:40:35 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 jmc 1.15 #if (defined ALLOW_AUTODIFF) && (defined ALLOW_AUTODIFF_OPENAD)
63 heimbach 1.1
64 jmc 1.15 C-- The folowing header files are included in the_main_loop.F for TAF
65     C and might be needed here (where the iloop is done) for OpenAD
66     c# include "AUTODIFF_MYFIELDS.h"
67     c# include "GRID.h"
68     c# include "DYNVARS.h"
69     c# include "SURFACE.h"
70     c# include "FFIELDS.h"
71     c# include "EOS.h"
72     c# include "AUTODIFF.h"
73     c# ifdef ALLOW_GENERIC_ADVDIFF
74     c# include "GAD.h"
75     c# include "GAD_SOM_VARS.h"
76     c# endif
77     c# ifdef ALLOW_MOM_FLUXFORM
78     c# include "MOM_FLUXFORM.h"
79     c# endif
80     c# ifdef ALLOW_CD_CODE
81     c# include "CD_CODE_VARS.h"
82     c# endif
83     c# ifdef ALLOW_EXF
84     c# include "EXF_FIELDS.h"
85     c# ifdef ALLOW_BULKFORMULAE
86     c# include "EXF_CONSTANTS.h"
87     c# endif
88     c# endif /* ALLOW_EXF */
89     c# ifdef ALLOW_SEAICE
90     c# include "SEAICE_SIZE.h"
91     c# include "SEAICE.h"
92     c# include "SEAICE_PARAMS.h"
93     c# include "SEAICE_COST.h"
94     c# include "SEAICE_TRACER.h"
95     c# endif
96     c# ifdef ALLOW_SALT_PLUME
97     c# include "SALT_PLUME.h"
98     c# endif
99     c# ifdef ALLOW_THSICE
100     c# include "THSICE_SIZE.h"
101     c# include "THSICE_VARS.h"
102     c# include "THSICE_COST.h"
103     c# endif
104     c# ifdef ALLOW_EBM
105     c# include "EBM.h"
106     c# endif
107     c# ifdef ALLOW_RBCS
108     c# include "RBCS_SIZE.h"
109     c# include "RBCS_FIELDS.h"
110     c# endif
111     c# ifdef ALLOW_OFFLINE
112     c# include "OFFLINE.h"
113     c# endif
114     c# ifdef ALLOW_CG2D_NSA
115     c# include "CG2D.h"
116     c# endif
117     c# ifdef ALLOW_GGL90
118     c# include "GGL90.h"
119     c# endif
120     c# ifdef ALLOW_PROFILES
121     c# include "profiles.h"
122     c# endif
123     c# ifdef ALLOW_ECCO_EVOLUTION
124     c# ifdef ALLOW_ECCO
125     c# include "ecco_cost.h"
126     c# endif
127     c# endif
128 heimbach 1.1
129     # ifdef ALLOW_CTRL
130 jmc 1.15 # include "CTRL_SIZE.h"
131     # include "ctrl.h"
132     # include "ctrl_dummy.h"
133     # include "CTRL_GENARR.h"
134 heimbach 1.1 # endif
135     # ifdef ALLOW_COST
136     # include "cost.h"
137     # endif
138    
139 jmc 1.15 # ifdef ALLOW_PTRACERS
140     # include "PTRACERS_SIZE.h"
141     # include "PTRACERS_FIELDS.h"
142     # include "PTRACERS_START.h"
143     # endif
144 heimbach 1.8 # ifdef ALLOW_GCHEM
145     # include "GCHEM_FIELDS.h"
146     # endif
147     # ifdef ALLOW_CFC
148     # include "CFC.h"
149     # endif
150     # ifdef ALLOW_DIC
151     # include "DIC_VARS.h"
152     # include "DIC_LOAD.h"
153     # include "DIC_ATMOS.h"
154     # include "DIC_CTRL.h"
155     # include "DIC_COST.h"
156     # endif
157 heimbach 1.10 # ifdef ALLOW_OBCS
158     # include "OBCS_PARAMS.h"
159     # include "OBCS_FIELDS.h"
160     # include "OBCS_SEAICE.h"
161     # ifdef ALLOW_PTRACERS
162     # include "OBCS_PTRACERS.h"
163 heimbach 1.8 # endif
164 heimbach 1.10 # endif
165     # ifdef ALLOW_SHELFICE
166     # include "SHELFICE.h"
167     # include "SHELFICE_COST.h"
168     # endif
169     # ifdef ALLOW_STREAMICE
170     # include "STREAMICE.h"
171     # include "STREAMICE_ADV.h"
172     # include "STREAMICE_BDRY.h"
173     # include "STREAMICE_CG.h"
174     # endif
175 heimbach 1.8
176 jmc 1.15 #endif /* ALLOW_AUTODIFF and ALLOW_AUTODIFF_OPENAD */
177 heimbach 1.1 c**************************************
178    
179     C !INPUT/OUTPUT PARAMETERS:
180     C == Routine arguments ==
181 jmc 1.13 C note: under the multi-threaded model myIter and
182     C myTime are local variables passed around as routine
183 heimbach 1.1 C arguments. Although this is fiddly it saves the need to
184     C impose additional synchronisation points when they are
185     C updated.
186     C myTime :: time counter for this thread
187     C myIter :: iteration counter for this thread
188     C myThid :: thread number for this instance of the routine.
189     _RL myTime
190     INTEGER myIter
191     INTEGER myThid
192    
193     C !FUNCTIONS:
194     C == Functions ==
195    
196     C !LOCAL VARIABLES:
197     C == Local variables ==
198 jmc 1.4 INTEGER iloop
199 heimbach 1.1 CEOP
200    
201     #ifdef ALLOW_DEBUG
202     IF (debugMode) CALL DEBUG_ENTER('MAIN_DO_LOOP',myThid)
203     #endif
204    
205     #ifdef ALLOW_AUTODIFF_OPENAD
206 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
207     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STARTS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
208 utke 1.3 DO iloop = 1, nTimeSteps
209 heimbach 1.1 #endif
210    
211     #ifdef ALLOW_DEBUG
212     IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid)
213     #endif
214    
215     #ifdef ALLOW_ATM2D
216 jmc 1.13 CALL TIMER_START('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
217     CALL FORWARD_STEP_ATM2D( iloop, myTime, myIter, myThid )
218     CALL TIMER_STOP ('FORWARD_STEP_ATM2D [MAIN_DO_LOOP]',myThid)
219 heimbach 1.1 #else
220 jmc 1.13 CALL TIMER_START('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
221     CALL FORWARD_STEP( iloop, myTime, myIter, myThid )
222     CALL TIMER_STOP ('FORWARD_STEP [MAIN_DO_LOOP]',myThid)
223 heimbach 1.1 #endif
224    
225 heimbach 1.11 #ifdef ALLOW_AUTODIFF_OPENAD
226 jmc 1.4 ENDDO
227 jmc 1.14 C >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
228     C >>>>>>>>>>>>>>>>>>>>>>>>>>> STOPS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
229 heimbach 1.11 #endif
230 heimbach 1.1
231     #ifdef ALLOW_DEBUG
232     IF (debugMode) CALL DEBUG_LEAVE('MAIN_DO_LOOP',myThid)
233     #endif
234    
235     RETURN
236     END

  ViewVC Help
Powered by ViewVC 1.1.22