66 |
C /|\ | | | |--DYNAMICS |
C /|\ | | | |--DYNAMICS |
67 |
C | | | | | o Evaluate "forward" terms |
C | | | | | o Evaluate "forward" terms |
68 |
C /|\ | | | | |
C /|\ | | | | |
69 |
C | | | | |--DO_THE_MODEL_IO |
C | | | | |--SOLVE_FOR_PRESSURE |
70 |
C /|\ | | | | o Write model state |
C /|\ | | | | o Find pressure field to keep flow non-divergent |
71 |
C | | | | | |
C | | | | | |
72 |
C /|\ | | | |--SOLVE_FOR_PRESSURE |
C /|\ | | | |--THE_CORRECTION_STEP |
73 |
C | | | | | o Find pressure field to keep flow non-divergent |
C | | | | | o Correct flow field with and cycle time-stepping arrays |
74 |
C /|\ | | | | |
C /|\ | | | | |
75 |
C | | | | |--DO_GTERM_BLOCKING_EXCHANGES |
C | | | | |--DO_GTERM_BLOCKING_EXCHANGES |
76 |
C /|\ | | | | o Update overlap regions |
C /|\ | | | | o Update overlap regions |
77 |
C | | | | | |
C | | | | | |
78 |
C /|\ | | | |--WRITE_CHECKPOINT |
C /|\ | | | |--DO_THE_MODEL_IO |
79 |
C | | | | | o Write restart file(s) |
C | | | | | o Write model state |
80 |
C /|\ | | | |
C /|\ | | | | |
81 |
|
C | | | | |--WRITE_CHECKPOINT |
82 |
|
C /|\ | | | | o Write restart file(s) |
83 |
C | | | | |
C | | | | |
84 |
|
C /|\ | | | |
85 |
C |<== | | | ** Time stepping loop finishes here ** |
C |<== | | | ** Time stepping loop finishes here ** |
86 |
C | | | |
C | | | |
87 |
C | | |-- |
C | | |-- |
101 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
102 |
#include "PARAMS.h" |
#include "PARAMS.h" |
103 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
|
#include "CG2D.h" |
|
104 |
#ifdef ALLOW_NONHYDROSTATIC |
#ifdef ALLOW_NONHYDROSTATIC |
105 |
#include "CG3D.h" |
#include "CG3D.h" |
106 |
#endif |
#endif |
107 |
|
|
108 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
109 |
|
#include "tamc.h" |
110 |
|
#include "cost.h" |
111 |
|
#include "adcost.h" |
112 |
|
#endif |
113 |
|
|
114 |
C == Routine arguments == |
C == Routine arguments == |
115 |
C myThid - Thread number for this instance of the routine. |
C myThid - Thread number for this instance of the routine. |
116 |
INTEGER myThid |
INTEGER myThid |
121 |
C arguments. Although this is fiddly it saves the need to |
C arguments. Although this is fiddly it saves the need to |
122 |
C impose additional synchronisation points when they are |
C impose additional synchronisation points when they are |
123 |
C updated. |
C updated. |
124 |
|
C myCurrentTime - Time counter for this thread |
125 |
|
C myCurrentIter - Iteration counter for this thread |
126 |
|
INTEGER myCurrentIter |
127 |
|
_RL myCurrentTime |
128 |
|
|
129 |
C-- This timer encompasses the whole code |
C-- This timer encompasses the whole code |
130 |
CALL TIMER_START('ALL [THE_MODEL_MAIN]',myThid) |
CALL TIMER_START('ALL [THE_MODEL_MAIN]',myThid) |
135 |
CALL INITIALISE_FIXED( myThid ) |
CALL INITIALISE_FIXED( myThid ) |
136 |
CALL TIMER_STOP ('INITIALISE_FIXED [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('INITIALISE_FIXED [THE_MODEL_MAIN]',myThid) |
137 |
|
|
138 |
|
myCurrentTime = startTime |
139 |
|
myCurrentIter = nIter0 |
140 |
|
|
141 |
|
#ifdef ALLOW_MIT_ADJOINT_RUN |
142 |
|
|
143 |
|
_BEGIN_MASTER( mythid ) |
144 |
|
IF (myProcId .eq. 0) THEN |
145 |
|
CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid ) |
146 |
|
ENDIF |
147 |
|
_END_MASTER( mythid ) |
148 |
|
_BARRIER |
149 |
|
|
150 |
|
fc = 0.0 |
151 |
|
adfc = 1.0 |
152 |
|
CALL TIMER_START('ADTHE_MAIN_SENS [ADJOINT RUN]', mythid) |
153 |
|
call ADTHE_MAIN_SENS ( mythid ) |
154 |
|
call TIMER_STOP ('ADTHE_MAIN_SENS [ADJOINT RUN]', mythid) |
155 |
|
_BARRIER |
156 |
|
|
157 |
|
_BEGIN_MASTER( mythid ) |
158 |
|
IF (myProcId .eq. 0) THEN |
159 |
|
call CTRL_PACK( mycurrentiter, mycurrenttime, mythid ) |
160 |
|
ENDIF |
161 |
|
_END_MASTER( mythid ) |
162 |
|
_BARRIER |
163 |
|
|
164 |
|
#else /* ALLOW_MIT_ADJOINT_RUN undef */ |
165 |
|
|
166 |
C-- Call time stepping loop of full model |
C-- Call time stepping loop of full model |
167 |
CALL TIMER_START('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
CALL TIMER_START('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
168 |
CALL THE_MAIN_LOOP( myThid ) |
CALL THE_MAIN_SENS(myCurrentTime, myCurrentIter, myThid ) |
169 |
CALL TIMER_STOP ('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
170 |
|
|
171 |
|
#endif /* ALLOW_MIT_ADJOINT_RUN */ |
172 |
|
|
173 |
CALL TIMER_STOP ('ALL [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('ALL [THE_MODEL_MAIN]',myThid) |
174 |
|
|