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

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

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


Revision 1.6 - (show annotations) (download)
Sat Aug 2 23:16:58 2008 UTC (15 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63d, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62, checkpoint63, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.5: +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_loc
37 C !INTERFACE:
38 #ifdef AUTODIFF_TAMC_COMPATIBILITY
39 subroutine adactive_read_xy_loc(
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_loc(
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_loc
63 c ==================================================================
64 c o Adjoint of active_read_xy_loc.
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_loc( 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_loc
125 C !INTERFACE:
126 #ifdef AUTODIFF_TAMC_COMPATIBILITY
127 subroutine adactive_read_xyz_loc(
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_loc(
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_loc
151 c ==================================================================
152 c o Adjoint of active_read_xyz_loc.
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_loc( 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_loc
212 C !INTERFACE:
213 #ifdef AUTODIFF_TAMC_COMPATIBILITY
214 subroutine adactive_read_xz_loc(
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_loc(
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_loc
238 c ==================================================================
239 c o Adjoint of active_read_xz_loc.
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_loc( 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_loc
299 C !INTERFACE:
300 #ifdef AUTODIFF_TAMC_COMPATIBILITY
301 subroutine adactive_read_yz_loc(
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_loc(
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_loc
325 c ==================================================================
326 c o Adjoint of active_read_yz_loc.
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_loc( 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_loc
386 C !INTERFACE:
387 #ifdef AUTODIFF_TAMC_COMPATIBILITY
388 subroutine adactive_write_xy_loc(
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_loc(
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 C !DESCRIPTION: \bv
408 c ==================================================================
409 c SUBROUTINE adactive_write_xy_loc
410 c ==================================================================
411 c o Adjoint of active_write_xy_loc.
412 c started: Christian Eckert eckert@mit.edu 24-May-1999
413 c ==================================================================
414 C \ev
415
416 C !USES:
417 implicit none
418
419 c == global variables ==
420 #include "EEPARAMS.h"
421 #include "SIZE.h"
422
423 c == routine arguments ==
424 c active_var_file: filename
425 c adactive_var: array
426 c irec: record number
427 c myIter: number of optimization iteration (default: 0)
428 c mythid: thread number for this instance
429 character*(*) active_var_file
430 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
431 integer irec
432 integer myiter,mythid
433 _RL dummy
434
435 C !LOCAL VARIABLES:
436 c == local variables ==
437 integer mynr
438 integer il
439 integer ilnblnk
440 character*(2) adpref
441 character*(80) fname
442 logical globalfile
443
444 c == functions ==
445 external ilnblnk
446
447 c == end of interface ==
448 CEOP
449
450 mynr = 1
451 adpref = 'ad'
452 write(fname(1:80),'(a)') ' '
453
454 il = ilnblnk(active_var_file)
455
456 write(fname(1:2),'(a)') adpref
457 write(fname(3:2+il),'(a)') active_var_file(1:il)
458
459 globalfile = .false.
460
461 call active_write_rl_loc( fname, adactive_var,
462 & globalfile, irec, mynr,
463 & REVERSE_SIMULATION, myiter, mythid )
464
465 end
466
467 CBOP
468 C !ROUTINE: adactive_read_xyz_loc
469 C !INTERFACE:
470 #ifdef AUTODIFF_TAMC_COMPATIBILITY
471 subroutine adactive_write_xyz_loc(
472 I active_var_file,
473 I irec,
474 I myiter,
475 I mythid,
476 U adactive_var,
477 I dummy
478 & )
479 #else
480 subroutine adactive_write_xyz_loc(
481 I active_var_file,
482 U adactive_var,
483 I irec,
484 I myiter,
485 I mythid,
486 I dummy
487 & )
488 #endif
489
490 C !DESCRIPTION: \bv
491 c ==================================================================
492 c SUBROUTINE adactive_write_xyz_loc
493 c ==================================================================
494 c o Adjoint of active_write_xyz_loc.
495 c started: Christian Eckert eckert@mit.edu 24-May-1999
496 c ==================================================================
497 C \ev
498
499 C !USES:
500 implicit none
501
502 c == global variables ==
503 #include "EEPARAMS.h"
504 #include "SIZE.h"
505
506 c == routine arguments ==
507 c active_var_file: filename
508 c adactive_var: array
509 c irec: record number
510 c myIter: number of optimization iteration (default: 0)
511 c mythid: thread number for this instance
512 character*(*) active_var_file
513 _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
514 integer irec
515 integer myiter,mythid
516 _RL dummy
517
518 C !LOCAL VARIABLES:
519 c == local variables ==
520 integer mynr
521 integer il
522 integer ilnblnk
523 character*(2) adpref
524 character*(80) fname
525 logical globalfile
526
527 c == functions ==
528 external ilnblnk
529
530 c == end of interface ==
531 CEOP
532
533 mynr = nr
534 adpref = 'ad'
535 write(fname(1:80),'(a)') ' '
536
537 il = ilnblnk(active_var_file)
538
539 write(fname(1:2),'(a)') adpref
540 write(fname(3:2+il),'(a)') active_var_file(1:il)
541
542 globalfile = .false.
543
544 call active_write_rl_loc( fname, adactive_var,
545 & globalfile, irec, mynr,
546 & REVERSE_SIMULATION, myiter, mythid )
547
548 end
549
550 CBOP
551 C !ROUTINE: adactive_read_xz_loc
552 C !INTERFACE:
553 #ifdef AUTODIFF_TAMC_COMPATIBILITY
554 subroutine adactive_write_xz_loc(
555 I active_var_file,
556 I irec,
557 I myiter,
558 I mythid,
559 U adactive_var,
560 I dummy
561 & )
562 #else
563 subroutine adactive_write_xz_loc(
564 I active_var_file,
565 U adactive_var,
566 I irec,
567 I myiter,
568 I mythid,
569 I dummy
570 & )
571 #endif
572
573 C !DESCRIPTION: \bv
574 c ==================================================================
575 c SUBROUTINE adactive_write_xz_loc
576 c ==================================================================
577 c o Adjoint of active_write_xz_loc.
578 c started: heimbach@mit.edu 05-Mar-2001
579 c ==================================================================
580 C \ev
581
582 C !USES:
583 implicit none
584
585 c == global variables ==
586 #include "EEPARAMS.h"
587 #include "SIZE.h"
588
589 c == routine arguments ==
590 c active_var_file: filename
591 c adactive_var: array
592 c irec: record number
593 c myIter: number of optimization iteration (default: 0)
594 c mythid: thread number for this instance
595 character*(*) active_var_file
596 _RL adactive_var(1-olx:snx+olx,nr,nsx,nsy)
597 integer irec
598 integer myiter,mythid
599 _RL dummy
600
601 C !LOCAL VARIABLES:
602 c == local variables ==
603 integer mynr
604 integer il
605 integer ilnblnk
606 character*(2) adpref
607 character*(80) fname
608 logical globalfile
609
610 c == functions ==
611 external ilnblnk
612
613 c == end of interface ==
614 CEOP
615
616 mynr = nr
617 adpref = 'ad'
618 write(fname(1:80),'(a)') ' '
619
620 il = ilnblnk(active_var_file)
621
622 write(fname(1:2),'(a)') adpref
623 write(fname(3:2+il),'(a)') active_var_file(1:il)
624
625 globalfile = .false.
626
627 call active_write_xz_rl_loc( fname, adactive_var,
628 & globalfile, irec, mynr,
629 & REVERSE_SIMULATION, myiter, mythid )
630
631 end
632
633 CBOP
634 C !ROUTINE: adactive_read_yz_loc
635 C !INTERFACE:
636 #ifdef AUTODIFF_TAMC_COMPATIBILITY
637 subroutine adactive_write_yz_loc(
638 I active_var_file,
639 I irec,
640 I myiter,
641 I mythid,
642 U adactive_var,
643 I dummy
644 & )
645 #else
646 subroutine adactive_write_yz_loc(
647 I active_var_file,
648 U adactive_var,
649 I irec,
650 I myiter,
651 I mythid,
652 I dummy
653 & )
654 #endif
655
656 C !DESCRIPTION: \bv
657 c ==================================================================
658 c SUBROUTINE adactive_write_yz_loc
659 c ==================================================================
660 c o Adjoint of active_write_yz_loc.
661 c started: heimbach@mit.edu 05-Mar-2001
662 c ==================================================================
663 C \ev
664
665 C !USES:
666 implicit none
667
668 c == global variables ==
669 #include "EEPARAMS.h"
670 #include "SIZE.h"
671
672 c == routine arguments ==
673 c active_var_file: filename
674 c adactive_var: array
675 c irec: record number
676 c myIter: number of optimization iteration (default: 0)
677 c mythid: thread number for this instance
678 character*(*) active_var_file
679 _RL adactive_var(1-oly:sny+oly,nr,nsx,nsy)
680 integer irec
681 integer myiter,mythid
682 _RL dummy
683
684 C !LOCAL VARIABLES:
685 c == local variables ==
686 integer mynr
687 integer il
688 integer ilnblnk
689 character*(2) adpref
690 character*(80) fname
691 logical globalfile
692
693 c == functions ==
694 external ilnblnk
695
696 c == end of interface ==
697 CEOP
698
699 mynr = nr
700 adpref = 'ad'
701 write(fname(1:80),'(a)') ' '
702
703 il = ilnblnk(active_var_file)
704
705 write(fname(1:2),'(a)') adpref
706 write(fname(3:2+il),'(a)') active_var_file(1:il)
707
708 globalfile = .false.
709
710 call active_write_yz_rl_loc( fname, adactive_var,
711 & globalfile, irec, mynr,
712 & REVERSE_SIMULATION, myiter, mythid )
713
714 end
715
716

  ViewVC Help
Powered by ViewVC 1.1.22