121 |
integer ilev_1 |
integer ilev_1 |
122 |
integer ilev_2 |
integer ilev_2 |
123 |
integer ilev_3 |
integer ilev_3 |
124 |
|
integer ilev_4 |
125 |
integer max_lev2 |
integer max_lev2 |
126 |
integer max_lev3 |
integer max_lev3 |
127 |
|
integer max_lev4 |
128 |
#endif |
#endif |
129 |
CEOP |
CEOP |
130 |
|
|
138 |
c-- Initialize storage for the outermost loop. |
c-- Initialize storage for the outermost loop. |
139 |
CADJ INIT tapelev_ini_bibj_k = USER |
CADJ INIT tapelev_ini_bibj_k = USER |
140 |
CADJ INIT tapelev_init = USER |
CADJ INIT tapelev_init = USER |
141 |
#ifdef AUTODIFF_2_LEVEL_CHECKPOINT |
c |
142 |
|
#if (defined (AUTODIFF_2_LEVEL_CHECKPOINT)) |
143 |
CADJ INIT tapelev2 = USER |
CADJ INIT tapelev2 = USER |
144 |
|
#elif (defined (AUTODIFF_4_LEVEL_CHECKPOINT)) |
145 |
|
CADJ INIT tapelev4 = USER |
146 |
#else |
#else |
147 |
CADJ INIT tapelev3 = USER |
CADJ INIT tapelev3 = USER |
148 |
#endif |
#endif |
202 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
203 |
#ifdef ALLOW_TAMC_CHECKPOINTING |
#ifdef ALLOW_TAMC_CHECKPOINTING |
204 |
|
|
205 |
|
max_lev4=nTimeSteps/(nchklev_1*nchklev_2*nchklev_3)+1 |
206 |
max_lev3=nTimeSteps/(nchklev_1*nchklev_2)+1 |
max_lev3=nTimeSteps/(nchklev_1*nchklev_2)+1 |
207 |
max_lev2=nTimeSteps/nchklev_1+1 |
max_lev2=nTimeSteps/nchklev_1+1 |
208 |
|
|
212 |
#endif |
#endif |
213 |
c************************************** |
c************************************** |
214 |
|
|
215 |
#ifndef AUTODIFF_2_LEVEL_CHECKPOINT |
#ifdef AUTODIFF_4_LEVEL_CHECKPOINT |
216 |
|
do ilev_4 = 1,nchklev_4 |
217 |
|
if(ilev_4.le.max_lev4) then |
218 |
|
c************************************** |
219 |
|
#include "checkpoint_lev4_directives.h" |
220 |
|
c************************************** |
221 |
|
c-- Initialise storage for the middle loop. |
222 |
|
CADJ INIT tapelev3 = USER |
223 |
|
#endif /* AUTODIFF_4_LEVEL_CHECKPOINT */ |
224 |
|
|
225 |
|
#ifndef AUTODIFF_2_LEVEL_CHECKPOINT |
226 |
do ilev_3 = 1,nchklev_3 |
do ilev_3 = 1,nchklev_3 |
227 |
if(ilev_3.le.max_lev3) then |
if(ilev_3.le.max_lev3) then |
228 |
c************************************** |
c************************************** |
229 |
#include "checkpoint_lev3_directives.h" |
#include "checkpoint_lev3_directives.h" |
230 |
c************************************** |
c************************************** |
|
|
|
231 |
c-- Initialise storage for the middle loop. |
c-- Initialise storage for the middle loop. |
232 |
CADJ INIT tapelev2 = USER |
CADJ INIT tapelev2 = USER |
|
|
|
233 |
#endif /* AUTODIFF_2_LEVEL_CHECKPOINT */ |
#endif /* AUTODIFF_2_LEVEL_CHECKPOINT */ |
234 |
|
|
235 |
do ilev_2 = 1,nchklev_2 |
do ilev_2 = 1,nchklev_2 |
290 |
c-- The if-statement below introduces a some flexibility in the |
c-- The if-statement below introduces a some flexibility in the |
291 |
c-- choice of the 3-tupel ( nchklev_1, nchklev_2, nchklev_3 ). |
c-- choice of the 3-tupel ( nchklev_1, nchklev_2, nchklev_3 ). |
292 |
|
|
293 |
iloop = (ilev_2 - 1)*nchklev_1 + ilev_1 |
iloop = (ilev_2 - 1)*nchklev_1 + ilev_1 |
294 |
#ifndef AUTODIFF_2_LEVEL_CHECKPOINT |
#ifndef AUTODIFF_2_LEVEL_CHECKPOINT |
295 |
& + (ilev_3 - 1)*nchklev_2*nchklev_1 |
& + (ilev_3 - 1)*nchklev_2*nchklev_1 |
296 |
#endif |
#endif |
297 |
|
#ifdef AUTODIFF_4_LEVEL_CHECKPOINT |
298 |
|
& + (ilev_4 - 1)*nchklev_3*nchklev_2*nchklev_1 |
299 |
|
#endif |
300 |
|
|
301 |
if ( iloop .le. nTimeSteps ) then |
if ( iloop .le. nTimeSteps ) then |
302 |
|
|
374 |
endif |
endif |
375 |
enddo |
enddo |
376 |
#endif |
#endif |
377 |
#else |
#ifdef AUTODIFF_4_LEVEL_CHECKPOINT |
378 |
|
endif |
379 |
enddo |
enddo |
380 |
#endif |
#endif |
381 |
|
#else /* ndef ALLOW_TAMC_CHECKPOINTING */ |
382 |
|
enddo |
383 |
|
#endif /* ALLOW_TAMC_CHECKPOINTING */ |
384 |
|
|
385 |
#else |
#else /* ndef ALLOW_AUTODIFF_TAMC */ |
386 |
enddo |
enddo |
387 |
#endif |
#endif /* ALLOW_AUTODIFF_TAMC */ |
388 |
|
|
389 |
#ifdef ALLOW_COST |
#ifdef ALLOW_COST |
390 |
c-- Sum all cost function contributions. |
c-- Sum all cost function contributions. |