/[MITgcm]/MITgcm/pkg/autodiff/active_file_ad.F
ViewVC logotype

Contents of /MITgcm/pkg/autodiff/active_file_ad.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (show annotations) (download)
Sat Aug 2 23:16:58 2008 UTC (15 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62c, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint62, checkpoint63, checkpoint63d, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62b, checkpoint61f, checkpoint61n, checkpoint61q, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.8: +3 -1 lines
add cvs Header & Name

1 C $Header: $
2 C $Name: $
3
4 #include "AUTODIFF_OPTIONS.h"
5
6 c ==================================================================
7 c
8 c active_files_ad.F: Routines to handle the I/O of the active file
9 c for the adjoint calculations. All files are
10 c direct access files.
11 c
12 c Routines
13 c
14 c o adactive_read_xy - Adjoint of active_read_xy
15 c o adactive_read_xyz - Adjoint of active_read_xyz
16 c o adactive_write_xy - Adjoint of active_write_xy
17 c o adactive_write_xyz - Adjoint of active_write_xyz
18 c
19 c o adactive_read_xz - Adjoint of active_read_xz
20 c o adactive_read_yz - Adjoint of active_read_yz
21 c o adactive_write_xz - Adjoint of active_write_xz
22 c o adactive_write_yz - Adjoint of active_write_yz
23 c
24 c changed: Christian Eckert eckert@mit.edu 24-Apr-2000
25 c - Added routines that do active writes on tiles
26 c instead of a whole thread.
27 c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
28 c - changed suboutine argument list:
29 c dropped mycurrentiter, mycurrenttime
30 c changed: heimbach@mit.edu 25-Mar-2002
31 c - added active file handling of xz-/yz-arrays
32 c
33 c ==================================================================
34
35 CBOP
36 C !ROUTINE: adactive_read_xy
37 C !INTERFACE:
38 #ifdef AUTODIFF_TAMC_COMPATIBILITY
39 subroutine adactive_read_xy(
40 I active_var_file,
41 I irec,
42 I doglobalread,
43 I lAdInit,
44 I myiter,
45 I mythid,
46 I adactive_var
47 & )
48 #else
49 subroutine adactive_read_xy(
50 I active_var_file,
51 I adactive_var,
52 I irec,
53 I doglobalread,
54 I lAdInit,
55 I myiter,
56 I mythid
57 & )
58 #endif
59
60 C !DESCRIPTION: \bv
61 c ==================================================================
62 c SUBROUTINE adactive_read_xy
63 c ==================================================================
64 c o Adjoint of active_read_xy.
65 c started: Christian Eckert eckert@mit.edu 24-May-1999
66 c ==================================================================
67 C \ev
68
69 C !USES:
70 implicit none
71
72 c == global variables ==
73 #include "EEPARAMS.h"
74 #include "SIZE.h"
75
76 C !INPUT/OUTPUT PARAMETERS:
77 c == routine arguments ==
78 c active_var_file: filename
79 c adactive_var: array
80 c irec: record number
81 c myIter: number of optimization iteration (default: 0)
82 c mythid: thread number for this instance
83 c doglobalread: flag for global or local read/write
84 c (default: .false.)
85 c lAdInit: initialisation of corresponding adjoint
86 c variable and write to active file
87 character*(*) active_var_file
88 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
89 integer irec
90 integer myiter,mythid
91 logical doglobalread
92 logical lAdInit
93
94 C !LOCAL VARIABLES:
95 c == local variables ==
96 integer mynr
97 integer il
98 integer ilnblnk
99 character*(2) adpref
100 character*(80) fname
101
102 c == functions ==
103 external ilnblnk
104
105 c == end of interface ==
106 CEOP
107
108 mynr = 1
109 adpref = 'ad'
110 write(fname(1:80),'(a)') ' '
111
112 il = ilnblnk(active_var_file)
113
114 write(fname(1:2),'(a)') adpref
115 write(fname(3:2+il),'(a)') active_var_file(1:il)
116
117 call active_read_rl( fname, adactive_var,
118 & doglobalread, lAdInit, irec, mynr,
119 & REVERSE_SIMULATION, myiter, mythid )
120
121 end
122
123 CBOP
124 C !ROUTINE: adactive_read_xyz
125 C !INTERFACE:
126 #ifdef AUTODIFF_TAMC_COMPATIBILITY
127 subroutine adactive_read_xyz(
128 I active_var_file,
129 I irec,
130 I doglobalread,
131 I lAdInit,
132 I myiter,
133 I mythid,
134 I adactive_var
135 & )
136 #else
137 subroutine adactive_read_xyz(
138 I active_var_file,
139 I adactive_var,
140 I irec,
141 I doglobalread,
142 I lAdInit,
143 I myiter,
144 I mythid
145 & )
146 #endif
147
148 C !DESCRIPTION: \bv
149 c ==================================================================
150 c SUBROUTINE adactive_read_xyz
151 c ==================================================================
152 c o Adjoint of active_read_xyz.
153 c started: Christian Eckert eckert@mit.edu 24-May-1999
154 c ==================================================================
155 C \ev
156
157 C !USES:
158 implicit none
159
160 c == global variables ==
161 #include "EEPARAMS.h"
162 #include "SIZE.h"
163
164 c == routine arguments ==
165 c active_var_file: filename
166 c adactive_var: array
167 c irec: record number
168 c myIter: number of optimization iteration (default: 0)
169 c mythid: thread number for this instance
170 c doglobalread: flag for global or local read/write
171 c (default: .false.)
172 c lAdInit: initialisation of corresponding adjoint
173 c variable and write to active file
174 character*(*) active_var_file
175 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
176 integer irec
177 integer myiter,mythid
178 logical doglobalread
179 logical lAdInit
180
181 C !LOCAL VARIABLES:
182 c == local variables ==
183 integer mynr
184 integer il
185 integer ilnblnk
186 character*(2) adpref
187 character*(80) fname
188
189 c == functions ==
190 external ilnblnk
191
192 c == end of interface ==
193 CEOP
194
195 mynr = nr
196 adpref = 'ad'
197 write(fname(1:80),'(a)') ' '
198
199 il = ilnblnk(active_var_file)
200
201 write(fname(1:2),'(a)') adpref
202 write(fname(3:2+il),'(a)') active_var_file(1:il)
203
204 call active_read_rl( fname, adactive_var,
205 & doglobalread, lAdInit, irec, mynr,
206 & REVERSE_SIMULATION, myiter, mythid )
207
208 end
209
210 CBOP
211 C !ROUTINE: adactive_read_xz
212 C !INTERFACE:
213 #ifdef AUTODIFF_TAMC_COMPATIBILITY
214 subroutine adactive_read_xz(
215 I active_var_file,
216 I irec,
217 I doglobalread,
218 I lAdInit,
219 I myiter,
220 I mythid,
221 I adactive_var
222 & )
223 #else
224 subroutine adactive_read_xz(
225 I active_var_file,
226 I adactive_var,
227 I irec,
228 I doglobalread,
229 I lAdInit,
230 I myiter,
231 I mythid
232 & )
233 #endif
234
235 C !DESCRIPTION: \bv
236 c ==================================================================
237 c SUBROUTINE adactive_read_xz
238 c ==================================================================
239 c o Adjoint of active_read_xz.
240 c started: heimbach@mit.edu 05-Mar-2001
241 c ==================================================================
242 C \ev
243
244 C !USES:
245 implicit none
246
247 c == global variables ==
248 #include "EEPARAMS.h"
249 #include "SIZE.h"
250
251 c == routine arguments ==
252 c active_var_file: filename
253 c adactive_var: array
254 c irec: record number
255 c myIter: number of optimization iteration (default: 0)
256 c mythid: thread number for this instance
257 c doglobalread: flag for global or local read/write
258 c (default: .false.)
259 c lAdInit: initialisation of corresponding adjoint
260 c variable and write to active file
261 character*(*) active_var_file
262 _RL adactive_var(1-olx:snx+olx,nr,nsx,nsy)
263 integer irec
264 integer myiter,mythid
265 logical doglobalread
266 logical lAdInit
267
268 C !LOCAL VARIABLES:
269 c == local variables ==
270 integer mynr
271 integer il
272 integer ilnblnk
273 character*(2) adpref
274 character*(80) fname
275
276 c == functions ==
277 external ilnblnk
278
279 c == end of interface ==
280 CEOP
281
282 mynr = nr
283 adpref = 'ad'
284 write(fname(1:80),'(a)') ' '
285
286 il = ilnblnk(active_var_file)
287
288 write(fname(1:2),'(a)') adpref
289 write(fname(3:2+il),'(a)') active_var_file(1:il)
290
291 call active_read_xz_rl( fname, adactive_var,
292 & doglobalread, lAdInit, irec, mynr,
293 & REVERSE_SIMULATION, myiter, mythid )
294
295 end
296
297 CBOP
298 C !ROUTINE: adactive_read_yz
299 C !INTERFACE:
300 #ifdef AUTODIFF_TAMC_COMPATIBILITY
301 subroutine adactive_read_yz(
302 I active_var_file,
303 I irec,
304 I doglobalread,
305 I lAdInit,
306 I myiter,
307 I mythid,
308 I adactive_var
309 & )
310 #else
311 subroutine adactive_read_yz(
312 I active_var_file,
313 I adactive_var,
314 I irec,
315 I doglobalread,
316 I lAdInit,
317 I myiter,
318 I mythid
319 & )
320 #endif
321
322 C !DESCRIPTION: \bv
323 c ==================================================================
324 c SUBROUTINE adactive_read_yz
325 c ==================================================================
326 c o Adjoint of active_read_yz.
327 c started: heimbach@mit.edu 05-Mar-2001
328 c ==================================================================
329 C \ev
330
331 C !USES:
332 implicit none
333
334 c == global variables ==
335 #include "EEPARAMS.h"
336 #include "SIZE.h"
337
338 c == routine arguments ==
339 c active_var_file: filename
340 c adactive_var: array
341 c irec: record number
342 c myIter: number of optimization iteration (default: 0)
343 c mythid: thread number for this instance
344 c doglobalread: flag for global or local read/write
345 c (default: .false.)
346 c lAdInit: initialisation of corresponding adjoint
347 c variable and write to active file
348 character*(*) active_var_file
349 _RL adactive_var(1-oly:sny+oly,nr,nsx,nsy)
350 integer irec
351 integer myiter,mythid
352 logical doglobalread
353 logical lAdInit
354
355 C !LOCAL VARIABLES:
356 c == local variables ==
357 integer mynr
358 integer il
359 integer ilnblnk
360 character*(2) adpref
361 character*(80) fname
362
363 c == functions ==
364 external ilnblnk
365
366 c == end of interface ==
367 CEOP
368
369 mynr = nr
370 adpref = 'ad'
371 write(fname(1:80),'(a)') ' '
372
373 il = ilnblnk(active_var_file)
374
375 write(fname(1:2),'(a)') adpref
376 write(fname(3:2+il),'(a)') active_var_file(1:il)
377
378 call active_read_yz_rl( fname, adactive_var,
379 & doglobalread, lAdInit, irec, mynr,
380 & REVERSE_SIMULATION, myiter, mythid )
381
382 end
383
384 CBOP
385 C !ROUTINE: adactive_read_xy
386 C !INTERFACE:
387 #ifdef AUTODIFF_TAMC_COMPATIBILITY
388 subroutine adactive_write_xy(
389 I active_var_file,
390 I irec,
391 I myiter,
392 I mythid,
393 U adactive_var,
394 I dummy
395 & )
396 #else
397 subroutine adactive_write_xy(
398 I active_var_file,
399 U adactive_var,
400 I irec,
401 I myiter,
402 I mythid,
403 I dummy
404 & )
405 #endif
406
407
408 C !DESCRIPTION: \bv
409 c ==================================================================
410 c SUBROUTINE adactive_write_xy
411 c ==================================================================
412 c o Adjoint of active_write_xy.
413 c started: Christian Eckert eckert@mit.edu 24-May-1999
414 c ==================================================================
415 C \ev
416
417 C !USES:
418 implicit none
419
420 c == global variables ==
421 #include "EEPARAMS.h"
422 #include "SIZE.h"
423
424 c == routine arguments ==
425 c active_var_file: filename
426 c adactive_var: array
427 c irec: record number
428 c myIter: number of optimization iteration (default: 0)
429 c mythid: thread number for this instance
430 character*(*) active_var_file
431 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
432 integer irec
433 integer myiter,mythid
434 _RL dummy
435
436 C !LOCAL VARIABLES:
437 c == local variables ==
438 integer mynr
439 integer il
440 integer ilnblnk
441 character*(2) adpref
442 character*(80) fname
443 logical globalfile
444
445 c == functions ==
446 external ilnblnk
447
448 c == end of interface ==
449 CEOP
450
451 mynr = 1
452 adpref = 'ad'
453 write(fname(1:80),'(a)') ' '
454
455 il = ilnblnk(active_var_file)
456
457 write(fname(1:2),'(a)') adpref
458 write(fname(3:2+il),'(a)') active_var_file(1:il)
459
460 globalfile = .false.
461
462 call active_write_rl( fname, adactive_var,
463 & globalfile, irec, mynr,
464 & REVERSE_SIMULATION, myiter, mythid )
465
466 end
467
468 CBOP
469 C !ROUTINE: adactive_read_xyz
470 C !INTERFACE:
471 #ifdef AUTODIFF_TAMC_COMPATIBILITY
472 subroutine adactive_write_xyz(
473 I active_var_file,
474 I irec,
475 I myiter,
476 I mythid,
477 U adactive_var,
478 I dummy
479 & )
480 #else
481 subroutine adactive_write_xyz(
482 I active_var_file,
483 U adactive_var,
484 I irec,
485 I myiter,
486 I mythid,
487 I dummy
488 & )
489 #endif
490
491
492 C !DESCRIPTION: \bv
493 c ==================================================================
494 c SUBROUTINE adactive_write_xyz
495 c ==================================================================
496 c o Adjoint of active_write_xyz.
497 c started: Christian Eckert eckert@mit.edu 24-May-1999
498 c ==================================================================
499 C \ev
500
501 C !USES:
502 implicit none
503
504 c == global variables ==
505 #include "EEPARAMS.h"
506 #include "SIZE.h"
507
508 c == routine arguments ==
509 c active_var_file: filename
510 c adactive_var: array
511 c irec: record number
512 c myIter: number of optimization iteration (default: 0)
513 c mythid: thread number for this instance
514 character*(*) active_var_file
515 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
516 integer irec
517 integer myiter,mythid
518 _RL dummy
519
520 C !LOCAL VARIABLES:
521 c == local variables ==
522 integer mynr
523 integer il
524 integer ilnblnk
525 character*(2) adpref
526 character*(80) fname
527 logical globalfile
528
529 c == functions ==
530 external ilnblnk
531
532 c == end of interface ==
533 CEOP
534
535 mynr = nr
536 adpref = 'ad'
537 write(fname(1:80),'(a)') ' '
538
539 il = ilnblnk(active_var_file)
540
541 write(fname(1:2),'(a)') adpref
542 write(fname(3:2+il),'(a)') active_var_file(1:il)
543
544 globalfile = .false.
545
546 call active_write_rl( fname, adactive_var,
547 & globalfile, irec, mynr,
548 & REVERSE_SIMULATION, myiter, mythid )
549
550 end
551
552 CBOP
553 C !ROUTINE: adactive_read_xz
554 C !INTERFACE:
555 #ifdef AUTODIFF_TAMC_COMPATIBILITY
556 subroutine adactive_write_xz(
557 I active_var_file,
558 I irec,
559 I myiter,
560 I mythid,
561 U adactive_var,
562 I dummy
563 & )
564 #else
565 subroutine adactive_write_xz(
566 I active_var_file,
567 U adactive_var,
568 I irec,
569 I myiter,
570 I mythid,
571 I dummy
572 & )
573 #endif
574
575 C !DESCRIPTION: \bv
576 c ==================================================================
577 c SUBROUTINE adactive_write_xz
578 c ==================================================================
579 c o Adjoint of active_write_xz.
580 c started: heimbach@mit.edu 05-Mar-2001
581 c ==================================================================
582 C \ev
583
584 C !USES:
585 implicit none
586
587 c == global variables ==
588 #include "EEPARAMS.h"
589 #include "SIZE.h"
590
591 c == routine arguments ==
592 c active_var_file: filename
593 c adactive_var: array
594 c irec: record number
595 c myIter: number of optimization iteration (default: 0)
596 c mythid: thread number for this instance
597 character*(*) active_var_file
598 _RL adactive_var(1-olx:snx+olx,nr,nsx,nsy)
599 integer irec
600 integer myiter,mythid
601 _RL dummy
602
603 C !LOCAL VARIABLES:
604 c == local variables ==
605 integer mynr
606 integer il
607 integer ilnblnk
608 character*(2) adpref
609 character*(80) fname
610 logical globalfile
611
612 c == functions ==
613 external ilnblnk
614
615 c == end of interface ==
616 CEOP
617
618 mynr = nr
619 adpref = 'ad'
620 write(fname(1:80),'(a)') ' '
621
622 il = ilnblnk(active_var_file)
623
624 write(fname(1:2),'(a)') adpref
625 write(fname(3:2+il),'(a)') active_var_file(1:il)
626
627 globalfile = .false.
628
629 call active_write_xz_rl( fname, adactive_var,
630 & globalfile, irec, mynr,
631 & REVERSE_SIMULATION, myiter, mythid )
632
633 end
634
635 CBOP
636 C !ROUTINE: adactive_read_yz
637 C !INTERFACE:
638 #ifdef AUTODIFF_TAMC_COMPATIBILITY
639 subroutine adactive_write_yz(
640 I active_var_file,
641 I irec,
642 I myiter,
643 I mythid,
644 U adactive_var,
645 I dummy
646 & )
647 #else
648 subroutine adactive_write_yz(
649 I active_var_file,
650 U adactive_var,
651 I irec,
652 I myiter,
653 I mythid,
654 I dummy
655 & )
656 #endif
657
658
659 C !DESCRIPTION: \bv
660 c ==================================================================
661 c SUBROUTINE adactive_write_yz
662 c ==================================================================
663 c o Adjoint of active_write_yz.
664 c started: heimbach@mit.edu 05-Mar-2001
665 c ==================================================================
666 C \ev
667
668 C !USES:
669 implicit none
670
671 c == global variables ==
672 #include "EEPARAMS.h"
673 #include "SIZE.h"
674
675 c == routine arguments ==
676 c active_var_file: filename
677 c adactive_var: array
678 c irec: record number
679 c myIter: number of optimization iteration (default: 0)
680 c mythid: thread number for this instance
681 character*(*) active_var_file
682 _RL adactive_var(1-oly:sny+oly,nr,nsx,nsy)
683 integer irec
684 integer myiter,mythid
685 _RL dummy
686
687 C !LOCAL VARIABLES:
688 c == local variables ==
689 integer mynr
690 integer il
691 integer ilnblnk
692 character*(2) adpref
693 character*(80) fname
694 logical globalfile
695
696 c == functions ==
697 external ilnblnk
698
699 c == end of interface ==
700 CEOP
701
702 mynr = nr
703 adpref = 'ad'
704 write(fname(1:80),'(a)') ' '
705
706 il = ilnblnk(active_var_file)
707
708 write(fname(1:2),'(a)') adpref
709 write(fname(3:2+il),'(a)') active_var_file(1:il)
710
711 globalfile = .false.
712
713 call active_write_yz_rl( fname, adactive_var,
714 & globalfile, irec, mynr,
715 & REVERSE_SIMULATION, myiter, mythid )
716
717 end
718
719

  ViewVC Help
Powered by ViewVC 1.1.22