/[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.8 - (hide annotations) (download)
Sat Nov 5 19:20:42 2011 UTC (13 years, 8 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint63g, checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63e, checkpoint63f
Changes since 1.7: +1 -318 lines
*  make derivative dummy available in derivative active read routine
   (needed by kalex)
* clean up obsolete _tile_ routines

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

  ViewVC Help
Powered by ViewVC 1.1.22