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

Annotation of /MITgcm/pkg/autodiff/active_file.F

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


Revision 1.1 - (hide annotations) (download)
Sun Mar 25 22:33:53 2001 UTC (24 years, 3 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint38, checkpoint40pre2, checkpoint40pre4, c37_adj, checkpoint39, checkpoint40pre5, checkpoint42, checkpoint40, checkpoint41
Modifications and additions to enable automatic differentiation.
Detailed info's in doc/notes_c37_adj.txt

1 heimbach 1.1
2     #include "CPP_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
31     c - Added routines that do active writes on tiles
32     c instead of a whole thread.
33     c
34     c ==================================================================
35    
36    
37     subroutine active_read_xy(
38     I active_var_file,
39     O active_var,
40     I irec,
41     I doglobalread,
42     I lAdInit,
43     I myOptimIter,
44     I mythid
45     I , dummy
46     & )
47    
48     c ==================================================================
49     c SUBROUTINE active_read_xy
50     c ==================================================================
51     c
52     c o Read an active 2D variable from file.
53     c
54     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
55     c
56     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
57     c
58     c - Restructured the code in order to create a package
59     c for the MITgcmUV.
60     c
61     c ==================================================================
62     c SUBROUTINE active_read_xy
63     c ==================================================================
64    
65     implicit none
66    
67     c == global variables ==
68    
69     #include "EEPARAMS.h"
70     #include "SIZE.h"
71    
72     c == routine arguments ==
73    
74     character*(*) active_var_file
75     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
76     integer irec
77     integer myOptimIter
78     integer mythid
79     logical doglobalread
80     logical lAdInit
81     _RL dummy
82    
83     c == local variables ==
84    
85     integer mynr
86    
87     c == end of interface ==
88    
89     mynr = 1
90     call active_read_rl( active_var_file, active_var, doglobalread,
91     & lAdInit, irec, mynr,
92     & FORWARD_SIMULATION, myOptimIter, mythid)
93    
94     return
95     end
96    
97     c ==================================================================
98    
99     subroutine active_read_xyz(
100     I active_var_file,
101     O active_var,
102     I irec,
103     I doglobalread,
104     I lAdInit,
105     I myOptimIter,
106     I mythid
107     I , dummy
108     & )
109    
110     c ==================================================================
111     c SUBROUTINE active_read_xyz
112     c ==================================================================
113     c
114     c o Read an active 3D variable from file.
115     c
116     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
117     c
118     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
119     c
120     c - Restructured the code in order to create a package
121     c for the MITgcmUV.
122     c
123     c ==================================================================
124     c SUBROUTINE active_read_xyz
125     c ==================================================================
126    
127     implicit none
128    
129     c == global variables ==
130    
131     #include "EEPARAMS.h"
132     #include "SIZE.h"
133    
134     c == routine arguments ==
135    
136     character*(*) active_var_file
137     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
138     integer irec
139     integer myOptimIter
140     integer mythid
141     logical doglobalread
142     logical lAdInit
143     _RL dummy
144    
145     c == local variables ==
146    
147     integer mynr
148    
149     c == end of interface ==
150    
151     mynr = nr
152     call active_read_rl( active_var_file, active_var, doglobalread,
153     & lAdInit, irec, mynr,
154     & FORWARD_SIMULATION, myOptimIter, mythid)
155    
156     return
157     end
158    
159     c ==================================================================
160    
161    
162     subroutine active_read_xz(
163     I active_var_file,
164     O active_var,
165     I irec,
166     I doglobalread,
167     I lAdInit,
168     I myOptimIter,
169     I mythid
170     I , dummy
171     & )
172    
173     c ==================================================================
174     c SUBROUTINE active_read_xz
175     c ==================================================================
176     c
177     c o Read an active 2D xz-slice from file.
178     c
179     c started: heimbach@mit.edu 05-Mar-2001
180     c
181     c ==================================================================
182     c SUBROUTINE active_read_xz
183     c ==================================================================
184    
185     implicit none
186    
187     c == global variables ==
188    
189     #include "EEPARAMS.h"
190     #include "SIZE.h"
191    
192     c == routine arguments ==
193    
194     character*(*) active_var_file
195     _RL active_var(1-olx:snx+olx,nsx,nsy)
196     integer irec
197     integer myOptimIter
198     integer mythid
199     logical doglobalread
200     logical lAdInit
201     _RL dummy
202    
203     c == local variables ==
204    
205     integer mynr
206    
207     c == end of interface ==
208    
209     mynr = 1
210     call active_read_xz_rl( active_var_file, active_var, doglobalread,
211     & lAdInit, irec, mynr,
212     & FORWARD_SIMULATION, myOptimIter, mythid)
213    
214     return
215     end
216    
217     c ==================================================================
218    
219    
220     subroutine active_read_yz(
221     I active_var_file,
222     O active_var,
223     I irec,
224     I doglobalread,
225     I lAdInit,
226     I myOptimIter,
227     I mythid
228     I , dummy
229     & )
230    
231     c ==================================================================
232     c SUBROUTINE active_read_yz
233     c ==================================================================
234     c
235     c o Read an active 2D yz-slice from file.
236     c
237     c started: heimbach@mit.edu 05-Mar-2001
238     c
239     c ==================================================================
240     c SUBROUTINE active_read_yz
241     c ==================================================================
242    
243     implicit none
244    
245     c == global variables ==
246    
247     #include "EEPARAMS.h"
248     #include "SIZE.h"
249    
250     c == routine arguments ==
251    
252     character*(*) active_var_file
253     _RL active_var(1-oly:sny+oly,nsx,nsy)
254     integer irec
255     integer myOptimIter
256     integer mythid
257     logical doglobalread
258     logical lAdInit
259     _RL dummy
260    
261     c == local variables ==
262    
263     integer mynr
264    
265     c == end of interface ==
266    
267     mynr = 1
268     call active_read_yz_rl( active_var_file, active_var, doglobalread,
269     & lAdInit, irec, mynr,
270     & FORWARD_SIMULATION, myOptimIter, mythid)
271    
272     return
273     end
274    
275     c ==================================================================
276    
277     subroutine active_write_xy(
278     I active_var_file,
279     I active_var,
280     I irec,
281     I myOptimIter,
282     I mythid
283     I , dummy
284     & )
285    
286     c ==================================================================
287     c SUBROUTINE active_write_xy
288     c ==================================================================
289     c
290     c o Write an active 2D variable to a file.
291     c
292     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
293     c
294     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
295     c
296     c - Restructured the code in order to create a package
297     c for the MITgcmUV.
298     c
299     c ==================================================================
300     c SUBROUTINE active_write_xy
301     c ==================================================================
302    
303     implicit none
304    
305     c == global variables ==
306    
307     #include "EEPARAMS.h"
308     #include "SIZE.h"
309    
310     c == routine arguments ==
311    
312     character*(*) active_var_file
313     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
314     integer irec
315     integer myOptimIter
316     integer mythid
317     _RL dummy
318    
319     c == local variables ==
320    
321     integer mynr
322     logical globalfile
323    
324     c == end of interface ==
325    
326     mynr = 1
327     globalfile = .false.
328    
329     call active_write_rl( active_var_file, active_var, globalfile,
330     & irec, mynr,
331     & FORWARD_SIMULATION, myOptimIter, mythid )
332    
333     return
334     end
335    
336     c ==================================================================
337    
338     subroutine active_write_xyz(
339     I active_var_file,
340     I active_var,
341     I irec,
342     I myOptimIter,
343     I mythid
344     I , dummy
345     & )
346    
347     c ==================================================================
348     c SUBROUTINE active_write_xyz
349     c ==================================================================
350     c
351     c o Write an active 3D variable to a file.
352     c
353     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
354     c
355     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
356     c
357     c - Restructured the code in order to create a package
358     c for the MITgcmUV.
359     c
360     c ==================================================================
361     c SUBROUTINE active_write_xyz
362     c ==================================================================
363    
364     implicit none
365    
366     c == global variables ==
367    
368     #include "EEPARAMS.h"
369     #include "SIZE.h"
370    
371     c == routine arguments ==
372    
373     character*(*) active_var_file
374     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
375     integer irec
376     integer myOptimIter
377     integer mythid
378     _RL dummy
379    
380     c == local variables ==
381    
382     integer mynr
383     logical globalfile
384    
385     c == end of interface ==
386    
387     mynr = nr
388     globalfile = .false.
389     call active_write_rl(active_var_file, active_var, globalfile,
390     & irec, mynr,
391     & FORWARD_SIMULATION, myOptimIter, mythid)
392    
393     return
394     end
395    
396     c ==================================================================
397    
398     subroutine active_write_xz(
399     I active_var_file,
400     I active_var,
401     I irec,
402     I myOptimIter,
403     I mythid
404     I , dummy
405     & )
406    
407     c ==================================================================
408     c SUBROUTINE active_write_xz
409     c ==================================================================
410     c
411     c o Write an active 2D xz-slice to a file.
412     c
413     c started: heimbach@mit.edu 05-Mar-2001
414     c
415     c ==================================================================
416     c SUBROUTINE active_write_xz
417     c ==================================================================
418    
419     implicit none
420    
421     c == global variables ==
422    
423     #include "EEPARAMS.h"
424     #include "SIZE.h"
425    
426     c == routine arguments ==
427    
428     character*(*) active_var_file
429     _RL active_var(1-olx:snx+olx,nsx,nsy)
430     integer irec
431     integer myOptimIter
432     integer mythid
433     _RL dummy
434    
435     c == local variables ==
436    
437     integer mynr
438     logical globalfile
439    
440     c == end of interface ==
441    
442     mynr = 1
443     globalfile = .false.
444    
445     call active_write_xz_rl( active_var_file, active_var, globalfile,
446     & irec, mynr,
447     & FORWARD_SIMULATION, myOptimIter, mythid )
448    
449     return
450     end
451    
452     c ==================================================================
453    
454     subroutine active_write_yz(
455     I active_var_file,
456     I active_var,
457     I irec,
458     I myOptimIter,
459     I mythid
460     I , dummy
461     & )
462    
463     c ==================================================================
464     c SUBROUTINE active_write_yz
465     c ==================================================================
466     c
467     c o Write an active 2D variable to a file.
468     c
469     c started: heimbach@mit.edu 05-Mar-2001
470     c
471     c ==================================================================
472     c SUBROUTINE active_write_yz
473     c ==================================================================
474    
475     implicit none
476    
477     c == global variables ==
478    
479     #include "EEPARAMS.h"
480     #include "SIZE.h"
481    
482     c == routine arguments ==
483    
484     character*(*) active_var_file
485     _RL active_var(1-oly:sny+oly,nsx,nsy)
486     integer irec
487     integer myOptimIter
488     integer mythid
489     _RL dummy
490    
491     c == local variables ==
492    
493     integer mynr
494     logical globalfile
495    
496     c == end of interface ==
497    
498     mynr = 1
499     globalfile = .false.
500    
501     call active_write_yz_rl( active_var_file, active_var, globalfile,
502     & irec, mynr,
503     & FORWARD_SIMULATION, myOptimIter, mythid )
504    
505     return
506     end
507    
508     c ==================================================================
509    
510     subroutine active_read_tile_xy(
511     I active_var_file,
512     O active_var,
513     I irec,
514     I doglobalread,
515     I bi,
516     I bj,
517     I lAdInit,
518     I myOptimIter,
519     I mythid
520     & )
521    
522     c ==================================================================
523     c SUBROUTINE active_read_tile_xy
524     c ==================================================================
525     c
526     c o Read an active 2D variable from file.
527     c
528     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
529     c
530     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
531     c
532     c - Restructured the code in order to create a package
533     c for the MITgcmUV.c
534     c
535     c changed: Christian Eckert eckert@mit.edu 24-Apr-2000
536     c
537     c - Added routines that do active writes on tiles
538     c instead of a whole thread.
539     c
540     c ==================================================================
541     c SUBROUTINE active_read_tile_xy
542     c ==================================================================
543    
544     implicit none
545    
546     c == global variables ==
547    
548     #include "EEPARAMS.h"
549     #include "SIZE.h"
550    
551     c == routine arguments ==
552    
553     character*(*) active_var_file
554     _RL active_var(1-olx:snx+olx,1-oly:sny+oly)
555     integer irec
556     integer myOptimIter
557     integer mythid
558     integer bi
559     integer bj
560     logical doglobalread
561     logical lAdInit
562    
563     c == local variables ==
564    
565     integer mynr
566    
567     c == end of interface ==
568    
569     mynr = 1
570     call active_read_tile_rl(
571     I active_var_file,
572     I active_var,
573     I doglobalread,
574     I lAdInit,
575     I irec,
576     I mynr,
577     I bi,
578     I bj,
579     I FORWARD_SIMULATION,
580     I myOptimIter,
581     I mythid
582     & )
583    
584     return
585     end
586    
587    
588     subroutine active_read_tile_xyz(
589     I active_var_file,
590     O active_var,
591     I irec,
592     I doglobalread,
593     I bi,
594     I bj,
595     I lAdInit,
596     I myOptimIter,
597     I mythid
598     & )
599    
600     c ==================================================================
601     c SUBROUTINE active_read_tile_xyz
602     c ==================================================================
603     c
604     c o Read an active 3D variable from file.
605     c
606     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
607     c
608     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
609     c
610     c - Restructured the code in order to create a package
611     c for the MITgcmUV.c
612     c
613     c changed: Christian Eckert eckert@mit.edu 24-Apr-2000
614     c
615     c - Added routines that do active writes on tiles
616     c instead of a whole thread.
617     c
618     c ==================================================================
619     c SUBROUTINE active_read_tile_xyz
620     c ==================================================================
621    
622     implicit none
623    
624     c == global variables ==
625    
626     #include "EEPARAMS.h"
627     #include "SIZE.h"
628    
629     c == routine arguments ==
630    
631     character*(*) active_var_file
632     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr)
633     integer irec
634     integer myOptimIter
635     integer mythid
636     logical doglobalread
637     integer bi
638     integer bj
639     logical lAdInit
640    
641     c == local variables ==
642    
643     integer mynr
644    
645     c == end of interface ==
646    
647     mynr = nr
648    
649     call active_read_tile_rl(
650     I active_var_file,
651     I active_var,
652     I doglobalread,
653     I lAdInit,
654     I irec,
655     I mynr,
656     I bi,
657     I bj,
658     I FORWARD_SIMULATION,
659     I myOptimIter,
660     I mythid
661     & )
662    
663     return
664     end
665    
666    
667     subroutine active_write_tile_xy(
668     I active_var_file,
669     I active_var,
670     I irec,
671     I bi,
672     I bj,
673     I myOptimIter,
674     I mythid
675     & )
676    
677     c ==================================================================
678     c SUBROUTINE active_write_tile_xy
679     c ==================================================================
680     c
681     c o Write an active 2D variable to a file.
682     c
683     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
684     c
685     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
686     c
687     c - Restructured the code in order to create a package
688     c for the MITgcmUV.c
689     c
690     c changed: Christian Eckert eckert@mit.edu 24-Apr-2000
691     c
692     c - Added routines that do active writes on tiles
693     c instead of a whole thread.
694     c
695     c ==================================================================
696     c SUBROUTINE active_write_tile_xy
697     c ==================================================================
698    
699     implicit none
700    
701     c == global variables ==
702    
703     #include "EEPARAMS.h"
704     #include "SIZE.h"
705    
706     c == routine arguments ==
707    
708     character*(*) active_var_file
709     _RL active_var(1-olx:snx+olx,1-oly:sny+oly)
710     integer irec
711     integer bi
712     integer bj
713     integer myOptimIter
714     integer mythid
715    
716     c == local variables ==
717    
718     integer mynr
719     logical globalfile
720    
721     c == end of interface ==
722    
723     mynr = 1
724     globalfile = .false.
725    
726     call active_write_tile_rl(
727     I active_var_file,
728     I active_var,
729     I globalfile,
730     I irec,
731     I mynr,
732     I bi,
733     I bj,
734     I FORWARD_SIMULATION,
735     I myOptimIter,
736     I mythid
737     & )
738    
739     return
740     end
741    
742    
743     subroutine active_write_tile_xyz(
744     I active_var_file,
745     I active_var,
746     I irec,
747     I bi,
748     I bj,
749     I myOptimIter,
750     I mythid
751     & )
752    
753     c ==================================================================
754     c SUBROUTINE active_write_tile_xyz
755     c ==================================================================
756     c
757     c o Write an active 3D variable to a file.
758     c
759     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
760     c
761     c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
762     c
763     c - Restructured the code in order to create a package
764     c for the MITgcmUV.c
765     c
766     c changed: Christian Eckert eckert@mit.edu 24-Apr-2000
767     c
768     c - Added routines that do active writes on tiles
769     c instead of a whole thread.
770     c
771     c ==================================================================
772     c SUBROUTINE active_write_tile_xyz
773     c ==================================================================
774    
775     implicit none
776    
777     c == global variables ==
778    
779     #include "EEPARAMS.h"
780     #include "SIZE.h"
781    
782     c == routine arguments ==
783    
784     character*(*) active_var_file
785     _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr)
786     integer irec
787     integer bi
788     integer bj
789     integer myOptimIter
790     integer mythid
791    
792     c == local variables ==
793    
794     integer mynr
795     logical globalfile
796    
797     c == end of interface ==
798    
799     mynr = nr
800     globalfile = .false.
801     call active_write_tile_rl(
802     I active_var_file,
803     I active_var,
804     I globalfile,
805     I irec,
806     I mynr,
807     I bi,
808     I bj,
809     I FORWARD_SIMULATION,
810     I myOptimIter,
811     I mythid
812     & )
813    
814     return
815     end

  ViewVC Help
Powered by ViewVC 1.1.22