1 |
|
2 |
#include "AUTODIFF_OPTIONS.h" |
3 |
|
4 |
c ================================================================== |
5 |
c |
6 |
c active_file.F: Routines to handle the I/O of the active file for |
7 |
c the adjoint calculations. All files are direct |
8 |
c access files. |
9 |
c |
10 |
c Routines |
11 |
c |
12 |
c o active_read_xy - Read an active 2D variable from file. |
13 |
c o active_read_xyz - Read an active 3D variable from file. |
14 |
c o active_read_xz - Read an active 2D xz-slice from file. |
15 |
c o active_read_yz - Read an active 2D yz-slice from file. |
16 |
c |
17 |
c o active_write_xy - Write an active 2D variable to a file. |
18 |
c o active_write_xyz - Write an active 3D variable to a file. |
19 |
c o active_write_xz - Write an active 2D xz-slice to a file. |
20 |
c o active_write_yz - Write an active 2D yz-slice to a file. |
21 |
c |
22 |
c o active_read_tile_xy - Read an active 2D variable from file. |
23 |
c o active_read_tile_xyz - Read an active 3D variable from file. |
24 |
c |
25 |
c o active_write_tile_xy - Write an active 2D variable to a file. |
26 |
c o active_write_tile_xyz - Write an active 3D variable to a file. |
27 |
c |
28 |
c |
29 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
30 |
c - Added routines that do active writes on tiles |
31 |
c instead of a whole thread. |
32 |
c changed: heimbach@mit.edu 05-Mar-2001 |
33 |
c - added active file handling of xz-/yz-arrays |
34 |
c |
35 |
c ================================================================== |
36 |
|
37 |
|
38 |
CBOP |
39 |
C !ROUTINE: active_read_xy_loc |
40 |
C !INTERFACE: |
41 |
subroutine active_read_xy_loc( |
42 |
I active_var_file, |
43 |
O active_var, |
44 |
I irec, |
45 |
I doglobalread, |
46 |
I lAdInit, |
47 |
I myOptimIter, |
48 |
I mythid |
49 |
I , dummy |
50 |
& ) |
51 |
|
52 |
C !DESCRIPTION: \bv |
53 |
c ================================================================== |
54 |
c SUBROUTINE active_read_xy_loc |
55 |
c ================================================================== |
56 |
c o Read an active 2D (XY) variable from file. |
57 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
58 |
c ================================================================== |
59 |
C \ev |
60 |
|
61 |
C !USES: |
62 |
implicit none |
63 |
|
64 |
c == global variables == |
65 |
#include "EEPARAMS.h" |
66 |
#include "SIZE.h" |
67 |
|
68 |
C !INPUT/OUTPUT PARAMETERS: |
69 |
c == routine arguments == |
70 |
c active_var_file: filename |
71 |
c active_var: array |
72 |
c irec: record number |
73 |
c myOptimIter: number of optimization iteration (default: 0) |
74 |
c mythid: thread number for this instance |
75 |
c doglobalread: flag for global or local read/write |
76 |
c (default: .false.) |
77 |
c lAdInit: initialisation of corresponding adjoint |
78 |
c variable and write to active file |
79 |
character*(*) active_var_file |
80 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
81 |
integer irec |
82 |
integer myOptimIter |
83 |
integer mythid |
84 |
logical doglobalread |
85 |
logical lAdInit |
86 |
_RL dummy |
87 |
|
88 |
C !LOCAL VARIABLES: |
89 |
c == local variables == |
90 |
integer mynr |
91 |
|
92 |
c == end of interface == |
93 |
CEOP |
94 |
|
95 |
mynr = 1 |
96 |
call active_read_rl_loc( active_var_file, active_var, |
97 |
& doglobalread, lAdInit, irec, mynr, |
98 |
& FORWARD_SIMULATION, myOptimIter, mythid) |
99 |
|
100 |
return |
101 |
end |
102 |
|
103 |
c ================================================================== |
104 |
|
105 |
CBOP |
106 |
C !ROUTINE: active_read_xyz_loc |
107 |
C !INTERFACE: |
108 |
subroutine active_read_xyz_loc( |
109 |
I active_var_file, |
110 |
O active_var, |
111 |
I irec, |
112 |
I doglobalread, |
113 |
I lAdInit, |
114 |
I myOptimIter, |
115 |
I mythid |
116 |
I , dummy |
117 |
& ) |
118 |
|
119 |
C !DESCRIPTION: \bv |
120 |
c ================================================================== |
121 |
c SUBROUTINE active_read_xyz_loc |
122 |
c ================================================================== |
123 |
c o Read an active 3D variable from file. |
124 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
125 |
c ================================================================== |
126 |
C \ev |
127 |
|
128 |
C !USES: |
129 |
implicit none |
130 |
|
131 |
c == global variables == |
132 |
#include "EEPARAMS.h" |
133 |
#include "SIZE.h" |
134 |
|
135 |
C !INPUT/OUTPUT PARAMETERS: |
136 |
c == routine arguments == |
137 |
c active_var_file: filename |
138 |
c active_var: array |
139 |
c irec: record number |
140 |
c myOptimIter: number of optimization iteration (default: 0) |
141 |
c mythid: thread number for this instance |
142 |
c doglobalread: flag for global or local read/write |
143 |
c (default: .false.) |
144 |
c lAdInit: initialisation of corresponding adjoint |
145 |
c variable and write to active file |
146 |
character*(*) active_var_file |
147 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
148 |
integer irec |
149 |
integer myOptimIter |
150 |
integer mythid |
151 |
logical doglobalread |
152 |
logical lAdInit |
153 |
_RL dummy |
154 |
|
155 |
C !LOCAL VARIABLES: |
156 |
c == local variables == |
157 |
integer mynr |
158 |
|
159 |
c == end of interface == |
160 |
CEOP |
161 |
|
162 |
mynr = nr |
163 |
call active_read_rl_loc( active_var_file, active_var, |
164 |
& doglobalread, lAdInit, irec, mynr, |
165 |
& FORWARD_SIMULATION, myOptimIter, mythid) |
166 |
|
167 |
return |
168 |
end |
169 |
|
170 |
c ================================================================== |
171 |
|
172 |
|
173 |
CBOP |
174 |
C !ROUTINE: active_read_xz_loc |
175 |
C !INTERFACE: |
176 |
subroutine active_read_xz_loc( |
177 |
I active_var_file, |
178 |
O active_var, |
179 |
I irec, |
180 |
I doglobalread, |
181 |
I lAdInit, |
182 |
I myOptimIter, |
183 |
I mythid |
184 |
I , dummy |
185 |
& ) |
186 |
|
187 |
C !DESCRIPTION: \bv |
188 |
c ================================================================== |
189 |
c SUBROUTINE active_read_xz_loc |
190 |
c ================================================================== |
191 |
c o Read an active 2D xz-slice from file. |
192 |
c started: heimbach@mit.edu 05-Mar-2001 |
193 |
c ================================================================== |
194 |
C \ev |
195 |
|
196 |
C !USES: |
197 |
implicit none |
198 |
|
199 |
c == global variables == |
200 |
#include "EEPARAMS.h" |
201 |
#include "SIZE.h" |
202 |
|
203 |
C !INPUT/OUTPUT PARAMETERS: |
204 |
c == routine arguments == |
205 |
c active_var_file: filename |
206 |
c active_var: array |
207 |
c irec: record number |
208 |
c myOptimIter: number of optimization iteration (default: 0) |
209 |
c mythid: thread number for this instance |
210 |
c doglobalread: flag for global or local read/write |
211 |
c (default: .false.) |
212 |
c lAdInit: initialisation of corresponding adjoint |
213 |
c variable and write to active file |
214 |
character*(*) active_var_file |
215 |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
216 |
integer irec |
217 |
integer myOptimIter |
218 |
integer mythid |
219 |
logical doglobalread |
220 |
logical lAdInit |
221 |
_RL dummy |
222 |
|
223 |
C !LOCAL VARIABLES: |
224 |
c == local variables == |
225 |
integer mynr |
226 |
|
227 |
c == end of interface == |
228 |
CEOP |
229 |
|
230 |
mynr = nr |
231 |
call active_read_xz_rl_loc( active_var_file, active_var, |
232 |
& doglobalread, lAdInit, irec, mynr, |
233 |
& FORWARD_SIMULATION, myOptimIter, mythid) |
234 |
|
235 |
return |
236 |
end |
237 |
|
238 |
c ================================================================== |
239 |
|
240 |
|
241 |
CBOP |
242 |
C !ROUTINE: active_read_yz_loc |
243 |
C !INTERFACE: |
244 |
subroutine active_read_yz_loc( |
245 |
I active_var_file, |
246 |
O active_var, |
247 |
I irec, |
248 |
I doglobalread, |
249 |
I lAdInit, |
250 |
I myOptimIter, |
251 |
I mythid |
252 |
I , dummy |
253 |
& ) |
254 |
|
255 |
C !DESCRIPTION: \bv |
256 |
c ================================================================== |
257 |
c SUBROUTINE active_read_yz_loc |
258 |
c ================================================================== |
259 |
c o Read an active 2D yz-slice from file. |
260 |
c started: heimbach@mit.edu 05-Mar-2001 |
261 |
c ================================================================== |
262 |
C \ev |
263 |
|
264 |
C !USES: |
265 |
implicit none |
266 |
|
267 |
c == global variables == |
268 |
#include "EEPARAMS.h" |
269 |
#include "SIZE.h" |
270 |
|
271 |
C !INPUT/OUTPUT PARAMETERS: |
272 |
c == routine arguments == |
273 |
c active_var_file: filename |
274 |
c active_var: array |
275 |
c irec: record number |
276 |
c myOptimIter: number of optimization iteration (default: 0) |
277 |
c mythid: thread number for this instance |
278 |
c doglobalread: flag for global or local read/write |
279 |
c (default: .false.) |
280 |
c lAdInit: initialisation of corresponding adjoint |
281 |
c variable and write to active file |
282 |
character*(*) active_var_file |
283 |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
284 |
integer irec |
285 |
integer myOptimIter |
286 |
integer mythid |
287 |
logical doglobalread |
288 |
logical lAdInit |
289 |
_RL dummy |
290 |
|
291 |
C !LOCAL VARIABLES: |
292 |
c == local variables == |
293 |
integer mynr |
294 |
|
295 |
c == end of interface == |
296 |
CEOP |
297 |
|
298 |
mynr = nr |
299 |
call active_read_yz_rl_loc( active_var_file, active_var, |
300 |
& doglobalread, lAdInit, irec, mynr, |
301 |
& FORWARD_SIMULATION, myOptimIter, mythid) |
302 |
|
303 |
return |
304 |
end |
305 |
|
306 |
c ================================================================== |
307 |
|
308 |
CBOP |
309 |
C !ROUTINE: active_write_xy_loc |
310 |
C !INTERFACE: |
311 |
subroutine active_write_xy_loc( |
312 |
I active_var_file, |
313 |
I active_var, |
314 |
I irec, |
315 |
I myOptimIter, |
316 |
I mythid |
317 |
I , dummy |
318 |
& ) |
319 |
|
320 |
C !DESCRIPTION: \bv |
321 |
c ================================================================== |
322 |
c SUBROUTINE active_write_xy_loc |
323 |
c ================================================================== |
324 |
c o Write an active 2D variable to a file. |
325 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
326 |
c ================================================================== |
327 |
C \ev |
328 |
|
329 |
C !USES: |
330 |
implicit none |
331 |
|
332 |
c == global variables == |
333 |
#include "EEPARAMS.h" |
334 |
#include "SIZE.h" |
335 |
|
336 |
c == routine arguments == |
337 |
c active_var_file: filename |
338 |
c active_var: array |
339 |
c irec: record number |
340 |
c myOptimIter: number of optimization iteration (default: 0) |
341 |
c mythid: thread number for this instance |
342 |
character*(*) active_var_file |
343 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
344 |
integer irec |
345 |
integer myOptimIter |
346 |
integer mythid |
347 |
_RL dummy |
348 |
|
349 |
C !LOCAL VARIABLES: |
350 |
c == local variables == |
351 |
integer mynr |
352 |
logical globalfile |
353 |
|
354 |
c == end of interface == |
355 |
CEOP |
356 |
|
357 |
mynr = 1 |
358 |
globalfile = .false. |
359 |
|
360 |
call active_write_rl_loc( active_var_file, active_var, |
361 |
& globalfile, irec, mynr, |
362 |
& FORWARD_SIMULATION, myOptimIter, mythid ) |
363 |
|
364 |
return |
365 |
end |
366 |
|
367 |
c ================================================================== |
368 |
|
369 |
CBOP |
370 |
C !ROUTINE: active_write_xyz_loc |
371 |
C !INTERFACE: |
372 |
subroutine active_write_xyz_loc( |
373 |
I active_var_file, |
374 |
I active_var, |
375 |
I irec, |
376 |
I myOptimIter, |
377 |
I mythid |
378 |
I , dummy |
379 |
& ) |
380 |
|
381 |
C !DESCRIPTION: \bv |
382 |
c ================================================================== |
383 |
c SUBROUTINE active_write_xyz_loc |
384 |
c ================================================================== |
385 |
c o Write an active 3D variable to a file. |
386 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
387 |
c ================================================================== |
388 |
C \ev |
389 |
|
390 |
C !USES: |
391 |
implicit none |
392 |
|
393 |
c == global variables == |
394 |
#include "EEPARAMS.h" |
395 |
#include "SIZE.h" |
396 |
|
397 |
c == routine arguments == |
398 |
c active_var_file: filename |
399 |
c active_var: array |
400 |
c irec: record number |
401 |
c myOptimIter: number of optimization iteration (default: 0) |
402 |
c mythid: thread number for this instance |
403 |
character*(*) active_var_file |
404 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
405 |
integer irec |
406 |
integer myOptimIter |
407 |
integer mythid |
408 |
_RL dummy |
409 |
|
410 |
C !LOCAL VARIABLES: |
411 |
c == local variables == |
412 |
integer mynr |
413 |
logical globalfile |
414 |
|
415 |
c == end of interface == |
416 |
CEOP |
417 |
|
418 |
mynr = nr |
419 |
globalfile = .false. |
420 |
call active_write_rl_loc(active_var_file, active_var, |
421 |
& globalfile, irec, mynr, |
422 |
& FORWARD_SIMULATION, myOptimIter, mythid) |
423 |
|
424 |
return |
425 |
end |
426 |
|
427 |
c ================================================================== |
428 |
|
429 |
CBOP |
430 |
C !ROUTINE: active_write_xz_loc |
431 |
C !INTERFACE: |
432 |
subroutine active_write_xz_loc( |
433 |
I active_var_file, |
434 |
I active_var, |
435 |
I irec, |
436 |
I myOptimIter, |
437 |
I mythid |
438 |
I , dummy |
439 |
& ) |
440 |
|
441 |
C !DESCRIPTION: \bv |
442 |
c ================================================================== |
443 |
c SUBROUTINE active_write_xz_loc |
444 |
c ================================================================== |
445 |
c o Write an active 2D xz-slice to a file. |
446 |
c started: heimbach@mit.edu 05-Mar-2001 |
447 |
c ================================================================== |
448 |
C \ev |
449 |
|
450 |
C !USES: |
451 |
implicit none |
452 |
|
453 |
c == global variables == |
454 |
#include "EEPARAMS.h" |
455 |
#include "SIZE.h" |
456 |
|
457 |
c == routine arguments == |
458 |
c active_var_file: filename |
459 |
c active_var: array |
460 |
c irec: record number |
461 |
c myOptimIter: number of optimization iteration (default: 0) |
462 |
c mythid: thread number for this instance |
463 |
character*(*) active_var_file |
464 |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
465 |
integer irec |
466 |
integer myOptimIter |
467 |
integer mythid |
468 |
_RL dummy |
469 |
|
470 |
C !LOCAL VARIABLES: |
471 |
c == local variables == |
472 |
integer mynr |
473 |
logical globalfile |
474 |
|
475 |
c == end of interface == |
476 |
CEOP |
477 |
|
478 |
mynr = nr |
479 |
globalfile = .false. |
480 |
|
481 |
call active_write_xz_rl_loc( active_var_file, active_var, |
482 |
& globalfile, irec, mynr, |
483 |
& FORWARD_SIMULATION, myOptimIter, mythid ) |
484 |
|
485 |
return |
486 |
end |
487 |
|
488 |
c ================================================================== |
489 |
|
490 |
CBOP |
491 |
C !ROUTINE: active_write_yz_loc |
492 |
C !INTERFACE: |
493 |
subroutine active_write_yz_loc( |
494 |
I active_var_file, |
495 |
I active_var, |
496 |
I irec, |
497 |
I myOptimIter, |
498 |
I mythid |
499 |
I , dummy |
500 |
& ) |
501 |
|
502 |
C !DESCRIPTION: \bv |
503 |
c ================================================================== |
504 |
c SUBROUTINE active_write_yz_loc |
505 |
c ================================================================== |
506 |
c o Write an active 2D variable to a file. |
507 |
c started: heimbach@mit.edu 05-Mar-2001 |
508 |
c ================================================================== |
509 |
C \ev |
510 |
|
511 |
C !USES: |
512 |
implicit none |
513 |
|
514 |
c == global variables == |
515 |
#include "EEPARAMS.h" |
516 |
#include "SIZE.h" |
517 |
|
518 |
c == routine arguments == |
519 |
c active_var_file: filename |
520 |
c active_var: array |
521 |
c irec: record number |
522 |
c myOptimIter: number of optimization iteration (default: 0) |
523 |
c mythid: thread number for this instance |
524 |
character*(*) active_var_file |
525 |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
526 |
integer irec |
527 |
integer myOptimIter |
528 |
integer mythid |
529 |
_RL dummy |
530 |
|
531 |
C !LOCAL VARIABLES: |
532 |
c == local variables == |
533 |
integer mynr |
534 |
logical globalfile |
535 |
|
536 |
c == end of interface == |
537 |
CEOP |
538 |
|
539 |
mynr = nr |
540 |
globalfile = .false. |
541 |
|
542 |
call active_write_yz_rl_loc( active_var_file, active_var, |
543 |
& globalfile, irec, mynr, |
544 |
& FORWARD_SIMULATION, myOptimIter, mythid ) |
545 |
|
546 |
return |
547 |
end |