1 |
|
C $Header$ |
2 |
|
|
3 |
#include "CPP_OPTIONS.h" |
#include "AUTODIFF_OPTIONS.h" |
4 |
|
|
5 |
c ================================================================== |
c ================================================================== |
6 |
c |
c |
15 |
c o adactive_write_xy - Adjoint of active_write_xy |
c o adactive_write_xy - Adjoint of active_write_xy |
16 |
c o adactive_write_xyz - Adjoint of active_write_xyz |
c o adactive_write_xyz - Adjoint of active_write_xyz |
17 |
c |
c |
18 |
|
c o adactive_read_xz - Adjoint of active_read_xz |
19 |
|
c o adactive_read_yz - Adjoint of active_read_yz |
20 |
|
c o adactive_write_xz - Adjoint of active_write_xz |
21 |
|
c o adactive_write_yz - Adjoint of active_write_yz |
22 |
|
c |
23 |
c o adactive_read_tile_xy - Adjoint of active_read_tile_xy |
c o adactive_read_tile_xy - Adjoint of active_read_tile_xy |
24 |
c o adactive_read_tile_xyz - Adjoint of active_read_tile_xyz |
c o adactive_read_tile_xyz - Adjoint of active_read_tile_xyz |
25 |
c o adactive_write_tile_xy - Adjoint of active_write_tile_xy |
c o adactive_write_tile_xy - Adjoint of active_write_tile_xy |
26 |
c o adactive_write_tile_xyz - Adjoint of active_write_tile_xyz |
c o adactive_write_tile_xyz - Adjoint of active_write_tile_xyz |
27 |
c |
c |
|
c |
|
28 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
29 |
c - Added routines that do active writes on tiles |
c - Added routines that do active writes on tiles |
30 |
c instead of a whole thread. |
c instead of a whole thread. |
31 |
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
32 |
c - changed suboutine argument list: |
c - changed suboutine argument list: |
33 |
c dropped mycurrentiter, mycurrenttime |
c dropped mycurrentiter, mycurrenttime |
34 |
|
c changed: heimbach@mit.edu 25-Mar-2002 |
35 |
|
c - added active file handling of xz-/yz-arrays |
36 |
c |
c |
37 |
c ================================================================== |
c ================================================================== |
38 |
|
|
192 |
end |
end |
193 |
|
|
194 |
CBOP |
CBOP |
195 |
|
C !ROUTINE: adactive_read_xz |
196 |
|
C !INTERFACE: |
197 |
|
subroutine adactive_read_xz( |
198 |
|
I active_var_file, |
199 |
|
I irec, |
200 |
|
I doglobalread, |
201 |
|
I lAdInit, |
202 |
|
I myiter, |
203 |
|
I mythid, |
204 |
|
I adactive_var |
205 |
|
& ) |
206 |
|
|
207 |
|
C !DESCRIPTION: \bv |
208 |
|
c ================================================================== |
209 |
|
c SUBROUTINE adactive_read_xz |
210 |
|
c ================================================================== |
211 |
|
c o Adjoint of active_read_xz. |
212 |
|
c started: heimbach@mit.edu 05-Mar-2001 |
213 |
|
c ================================================================== |
214 |
|
c SUBROUTINE adactive_read_xz |
215 |
|
c ================================================================== |
216 |
|
C \ev |
217 |
|
|
218 |
|
C !USES: |
219 |
|
implicit none |
220 |
|
|
221 |
|
c == global variables == |
222 |
|
#include "EEPARAMS.h" |
223 |
|
#include "SIZE.h" |
224 |
|
|
225 |
|
c == routine arguments == |
226 |
|
c active_var_file: filename |
227 |
|
c adactive_var: array |
228 |
|
c irec: record number |
229 |
|
c myIter: number of optimization iteration (default: 0) |
230 |
|
c mythid: thread number for this instance |
231 |
|
c doglobalread: flag for global or local read/write |
232 |
|
c (default: .false.) |
233 |
|
c lAdInit: initialisation of corresponding adjoint |
234 |
|
c variable and write to active file |
235 |
|
character*(*) active_var_file |
236 |
|
_RL adactive_var(1-olx:snx+olx,nr,nsx,nsy) |
237 |
|
integer irec |
238 |
|
integer myiter,mythid |
239 |
|
logical doglobalread |
240 |
|
logical lAdInit |
241 |
|
|
242 |
|
C !LOCAL VARIABLES: |
243 |
|
c == local variables == |
244 |
|
integer mynr |
245 |
|
integer il |
246 |
|
integer ilnblnk |
247 |
|
character*(2) adpref |
248 |
|
character*(80) fname |
249 |
|
|
250 |
|
c == functions == |
251 |
|
external ilnblnk |
252 |
|
|
253 |
|
c == end of interface == |
254 |
|
CEOP |
255 |
|
|
256 |
|
mynr = nr |
257 |
|
adpref = 'ad' |
258 |
|
write(fname(1:80),'(a)') ' ' |
259 |
|
|
260 |
|
il = ilnblnk(active_var_file) |
261 |
|
|
262 |
|
write(fname(1:2),'(a)') adpref |
263 |
|
write(fname(3:2+il),'(a)') active_var_file(1:il) |
264 |
|
|
265 |
|
call active_read_xz_rl( fname, adactive_var, |
266 |
|
& doglobalread, lAdInit, irec, mynr, |
267 |
|
& REVERSE_SIMULATION, myiter, mythid ) |
268 |
|
|
269 |
|
end |
270 |
|
|
271 |
|
CBOP |
272 |
|
C !ROUTINE: adactive_read_yz |
273 |
|
C !INTERFACE: |
274 |
|
subroutine adactive_read_yz( |
275 |
|
I active_var_file, |
276 |
|
I irec, |
277 |
|
I doglobalread, |
278 |
|
I lAdInit, |
279 |
|
I myiter, |
280 |
|
I mythid, |
281 |
|
I adactive_var |
282 |
|
& ) |
283 |
|
|
284 |
|
C !DESCRIPTION: \bv |
285 |
|
c ================================================================== |
286 |
|
c SUBROUTINE adactive_read_yz |
287 |
|
c ================================================================== |
288 |
|
c o Adjoint of active_read_yz. |
289 |
|
c started: heimbach@mit.edu 05-Mar-2001 |
290 |
|
c ================================================================== |
291 |
|
c SUBROUTINE adactive_read_yz |
292 |
|
c ================================================================== |
293 |
|
C \ev |
294 |
|
|
295 |
|
C !USES: |
296 |
|
implicit none |
297 |
|
|
298 |
|
c == global variables == |
299 |
|
#include "EEPARAMS.h" |
300 |
|
#include "SIZE.h" |
301 |
|
|
302 |
|
c == routine arguments == |
303 |
|
c active_var_file: filename |
304 |
|
c adactive_var: array |
305 |
|
c irec: record number |
306 |
|
c myIter: number of optimization iteration (default: 0) |
307 |
|
c mythid: thread number for this instance |
308 |
|
c doglobalread: flag for global or local read/write |
309 |
|
c (default: .false.) |
310 |
|
c lAdInit: initialisation of corresponding adjoint |
311 |
|
c variable and write to active file |
312 |
|
character*(*) active_var_file |
313 |
|
_RL adactive_var(1-oly:sny+oly,nr,nsx,nsy) |
314 |
|
integer irec |
315 |
|
integer myiter,mythid |
316 |
|
logical doglobalread |
317 |
|
logical lAdInit |
318 |
|
|
319 |
|
C !LOCAL VARIABLES: |
320 |
|
c == local variables == |
321 |
|
integer mynr |
322 |
|
integer il |
323 |
|
integer ilnblnk |
324 |
|
character*(2) adpref |
325 |
|
character*(80) fname |
326 |
|
|
327 |
|
c == functions == |
328 |
|
external ilnblnk |
329 |
|
|
330 |
|
c == end of interface == |
331 |
|
CEOP |
332 |
|
|
333 |
|
mynr = nr |
334 |
|
adpref = 'ad' |
335 |
|
write(fname(1:80),'(a)') ' ' |
336 |
|
|
337 |
|
il = ilnblnk(active_var_file) |
338 |
|
|
339 |
|
write(fname(1:2),'(a)') adpref |
340 |
|
write(fname(3:2+il),'(a)') active_var_file(1:il) |
341 |
|
|
342 |
|
call active_read_yz_rl( fname, adactive_var, |
343 |
|
& doglobalread, lAdInit, irec, mynr, |
344 |
|
& REVERSE_SIMULATION, myiter, mythid ) |
345 |
|
|
346 |
|
end |
347 |
|
|
348 |
|
CBOP |
349 |
C !ROUTINE: adactive_read_xy |
C !ROUTINE: adactive_read_xy |
350 |
C !INTERFACE: |
C !INTERFACE: |
351 |
subroutine adactive_write_xy( |
subroutine adactive_write_xy( |
420 |
|
|
421 |
end |
end |
422 |
|
|
|
|
|
423 |
CBOP |
CBOP |
424 |
C !ROUTINE: adactive_read_xyz |
C !ROUTINE: adactive_read_xyz |
425 |
C !INTERFACE: |
C !INTERFACE: |
493 |
& globalfile, irec, mynr, |
& globalfile, irec, mynr, |
494 |
& REVERSE_SIMULATION, myiter, mythid ) |
& REVERSE_SIMULATION, myiter, mythid ) |
495 |
|
|
496 |
|
end |
497 |
|
|
498 |
|
CBOP |
499 |
|
C !ROUTINE: adactive_read_xz |
500 |
|
C !INTERFACE: |
501 |
|
subroutine adactive_write_xz( |
502 |
|
I active_var_file, |
503 |
|
I irec, |
504 |
|
I myiter, |
505 |
|
I mythid, |
506 |
|
U adactive_var, |
507 |
|
I dummy |
508 |
|
& ) |
509 |
|
|
510 |
|
|
511 |
|
C !DESCRIPTION: \bv |
512 |
|
c ================================================================== |
513 |
|
c SUBROUTINE adactive_write_xz |
514 |
|
c ================================================================== |
515 |
|
c o Adjoint of active_write_xz. |
516 |
|
c started: heimbach@mit.edu 05-Mar-2001 |
517 |
|
c ================================================================== |
518 |
|
c SUBROUTINE adactive_write_xz |
519 |
|
c ================================================================== |
520 |
|
C \ev |
521 |
|
|
522 |
|
C !USES: |
523 |
|
implicit none |
524 |
|
|
525 |
|
c == global variables == |
526 |
|
#include "EEPARAMS.h" |
527 |
|
#include "SIZE.h" |
528 |
|
|
529 |
|
c == routine arguments == |
530 |
|
c active_var_file: filename |
531 |
|
c adactive_var: array |
532 |
|
c irec: record number |
533 |
|
c myIter: number of optimization iteration (default: 0) |
534 |
|
c mythid: thread number for this instance |
535 |
|
character*(*) active_var_file |
536 |
|
_RL adactive_var(1-olx:snx+olx,nr,nsx,nsy) |
537 |
|
integer irec |
538 |
|
integer myiter,mythid |
539 |
|
_RL dummy |
540 |
|
|
541 |
|
C !LOCAL VARIABLES: |
542 |
|
c == local variables == |
543 |
|
integer mynr |
544 |
|
integer il |
545 |
|
integer ilnblnk |
546 |
|
character*(2) adpref |
547 |
|
character*(80) fname |
548 |
|
logical globalfile |
549 |
|
|
550 |
|
c == functions == |
551 |
|
external ilnblnk |
552 |
|
|
553 |
|
c == end of interface == |
554 |
|
CEOP |
555 |
|
|
556 |
|
mynr = nr |
557 |
|
adpref = 'ad' |
558 |
|
write(fname(1:80),'(a)') ' ' |
559 |
|
|
560 |
|
il = ilnblnk(active_var_file) |
561 |
|
|
562 |
|
write(fname(1:2),'(a)') adpref |
563 |
|
write(fname(3:2+il),'(a)') active_var_file(1:il) |
564 |
|
|
565 |
|
globalfile = .false. |
566 |
|
|
567 |
|
call active_write_xz_rl( fname, adactive_var, |
568 |
|
& globalfile, irec, mynr, |
569 |
|
& REVERSE_SIMULATION, myiter, mythid ) |
570 |
|
|
571 |
|
end |
572 |
|
|
573 |
|
CBOP |
574 |
|
C !ROUTINE: adactive_read_yz |
575 |
|
C !INTERFACE: |
576 |
|
subroutine adactive_write_yz( |
577 |
|
I active_var_file, |
578 |
|
I irec, |
579 |
|
I myiter, |
580 |
|
I mythid, |
581 |
|
U adactive_var, |
582 |
|
I dummy |
583 |
|
& ) |
584 |
|
|
585 |
|
|
586 |
|
C !DESCRIPTION: \bv |
587 |
|
c ================================================================== |
588 |
|
c SUBROUTINE adactive_write_yz |
589 |
|
c ================================================================== |
590 |
|
c o Adjoint of active_write_yz. |
591 |
|
c started: heimbach@mit.edu 05-Mar-2001 |
592 |
|
c ================================================================== |
593 |
|
c SUBROUTINE adactive_write_yz |
594 |
|
c ================================================================== |
595 |
|
C \ev |
596 |
|
|
597 |
|
C !USES: |
598 |
|
implicit none |
599 |
|
|
600 |
|
c == global variables == |
601 |
|
#include "EEPARAMS.h" |
602 |
|
#include "SIZE.h" |
603 |
|
|
604 |
|
c == routine arguments == |
605 |
|
c active_var_file: filename |
606 |
|
c adactive_var: array |
607 |
|
c irec: record number |
608 |
|
c myIter: number of optimization iteration (default: 0) |
609 |
|
c mythid: thread number for this instance |
610 |
|
character*(*) active_var_file |
611 |
|
_RL adactive_var(1-oly:sny+oly,nr,nsx,nsy) |
612 |
|
integer irec |
613 |
|
integer myiter,mythid |
614 |
|
_RL dummy |
615 |
|
|
616 |
|
C !LOCAL VARIABLES: |
617 |
|
c == local variables == |
618 |
|
integer mynr |
619 |
|
integer il |
620 |
|
integer ilnblnk |
621 |
|
character*(2) adpref |
622 |
|
character*(80) fname |
623 |
|
logical globalfile |
624 |
|
|
625 |
|
c == functions == |
626 |
|
external ilnblnk |
627 |
|
|
628 |
|
c == end of interface == |
629 |
|
CEOP |
630 |
|
|
631 |
|
mynr = nr |
632 |
|
adpref = 'ad' |
633 |
|
write(fname(1:80),'(a)') ' ' |
634 |
|
|
635 |
|
il = ilnblnk(active_var_file) |
636 |
|
|
637 |
|
write(fname(1:2),'(a)') adpref |
638 |
|
write(fname(3:2+il),'(a)') active_var_file(1:il) |
639 |
|
|
640 |
|
globalfile = .false. |
641 |
|
|
642 |
|
call active_write_yz_rl( fname, adactive_var, |
643 |
|
& globalfile, irec, mynr, |
644 |
|
& REVERSE_SIMULATION, myiter, mythid ) |
645 |
|
|
646 |
end |
end |
647 |
|
|
648 |
|
|