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

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

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


Revision 1.4 - (hide annotations) (download)
Mon Oct 8 23:50:53 2007 UTC (16 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j
Changes since 1.3: +3 -1 lines
add missing cvs $Header:$ or $Name:$

1 jmc 1.4 C $Header: $
2     C $Name: $
3 heimbach 1.2
4 edhill 1.3 #include "AUTODIFF_OPTIONS.h"
5 heimbach 1.2
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 jmc 1.4 c - changed suboutine argument list:
29 heimbach 1.2 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     subroutine adactive_read_xy_loc(
39     I active_var_file,
40     I irec,
41     I doglobalread,
42     I lAdInit,
43     I myiter,
44     I mythid,
45     I adactive_var
46     & )
47    
48     C !DESCRIPTION: \bv
49     c ==================================================================
50     c SUBROUTINE adactive_read_xy_loc
51     c ==================================================================
52     c o Adjoint of active_read_xy_loc.
53     c started: Christian Eckert eckert@mit.edu 24-May-1999
54     c ==================================================================
55     C \ev
56    
57     C !USES:
58     implicit none
59    
60     c == global variables ==
61     #include "EEPARAMS.h"
62     #include "SIZE.h"
63    
64     C !INPUT/OUTPUT PARAMETERS:
65     c == routine arguments ==
66     c active_var_file: filename
67     c adactive_var: array
68     c irec: record number
69     c myIter: number of optimization iteration (default: 0)
70     c mythid: thread number for this instance
71     c doglobalread: flag for global or local read/write
72     c (default: .false.)
73     c lAdInit: initialisation of corresponding adjoint
74     c variable and write to active file
75     character*(*) active_var_file
76     _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
77     integer irec
78     integer myiter,mythid
79     logical doglobalread
80     logical lAdInit
81    
82     C !LOCAL VARIABLES:
83     c == local variables ==
84     integer mynr
85     integer il
86     integer ilnblnk
87     character*(2) adpref
88     character*(80) fname
89    
90     c == functions ==
91     external ilnblnk
92    
93     c == end of interface ==
94     CEOP
95    
96     mynr = 1
97     adpref = 'ad'
98     write(fname(1:80),'(a)') ' '
99    
100     il = ilnblnk(active_var_file)
101    
102     write(fname(1:2),'(a)') adpref
103     write(fname(3:2+il),'(a)') active_var_file(1:il)
104    
105     call active_read_rl_loc( fname, adactive_var,
106     & doglobalread, lAdInit, irec, mynr,
107     & REVERSE_SIMULATION, myiter, mythid )
108    
109     end
110    
111     CBOP
112     C !ROUTINE: adactive_read_xyz_loc
113     C !INTERFACE:
114     subroutine adactive_read_xyz_loc(
115     I active_var_file,
116     I irec,
117     I doglobalread,
118     I lAdInit,
119     I myiter,
120     I mythid,
121     I adactive_var
122     & )
123    
124     C !DESCRIPTION: \bv
125     c ==================================================================
126     c SUBROUTINE adactive_read_xyz_loc
127     c ==================================================================
128     c o Adjoint of active_read_xyz_loc.
129     c started: Christian Eckert eckert@mit.edu 24-May-1999
130     c ==================================================================
131     C \ev
132    
133     C !USES:
134     implicit none
135    
136     c == global variables ==
137     #include "EEPARAMS.h"
138     #include "SIZE.h"
139    
140     c == routine arguments ==
141     c active_var_file: filename
142     c adactive_var: array
143     c irec: record number
144     c myIter: number of optimization iteration (default: 0)
145     c mythid: thread number for this instance
146     c doglobalread: flag for global or local read/write
147     c (default: .false.)
148     c lAdInit: initialisation of corresponding adjoint
149     c variable and write to active file
150     character*(*) active_var_file
151     _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
152     integer irec
153     integer myiter,mythid
154     logical doglobalread
155     logical lAdInit
156    
157     C !LOCAL VARIABLES:
158     c == local variables ==
159     integer mynr
160     integer il
161     integer ilnblnk
162     character*(2) adpref
163     character*(80) fname
164    
165     c == functions ==
166     external ilnblnk
167    
168     c == end of interface ==
169     CEOP
170    
171     mynr = nr
172     adpref = 'ad'
173     write(fname(1:80),'(a)') ' '
174    
175     il = ilnblnk(active_var_file)
176    
177     write(fname(1:2),'(a)') adpref
178     write(fname(3:2+il),'(a)') active_var_file(1:il)
179    
180     call active_read_rl_loc( fname, adactive_var,
181     & doglobalread, lAdInit, irec, mynr,
182     & REVERSE_SIMULATION, myiter, mythid )
183    
184     end
185    
186     CBOP
187     C !ROUTINE: adactive_read_xz_loc
188     C !INTERFACE:
189     subroutine adactive_read_xz_loc(
190     I active_var_file,
191     I irec,
192     I doglobalread,
193     I lAdInit,
194     I myiter,
195     I mythid,
196     I adactive_var
197     & )
198    
199     C !DESCRIPTION: \bv
200     c ==================================================================
201     c SUBROUTINE adactive_read_xz_loc
202     c ==================================================================
203     c o Adjoint of active_read_xz_loc.
204     c started: heimbach@mit.edu 05-Mar-2001
205     c ==================================================================
206     C \ev
207    
208     C !USES:
209     implicit none
210    
211     c == global variables ==
212     #include "EEPARAMS.h"
213     #include "SIZE.h"
214    
215     c == routine arguments ==
216     c active_var_file: filename
217     c adactive_var: array
218     c irec: record number
219     c myIter: number of optimization iteration (default: 0)
220     c mythid: thread number for this instance
221     c doglobalread: flag for global or local read/write
222     c (default: .false.)
223     c lAdInit: initialisation of corresponding adjoint
224     c variable and write to active file
225     character*(*) active_var_file
226     _RL adactive_var(1-olx:snx+olx,nr,nsx,nsy)
227     integer irec
228     integer myiter,mythid
229     logical doglobalread
230     logical lAdInit
231    
232     C !LOCAL VARIABLES:
233     c == local variables ==
234     integer mynr
235     integer il
236     integer ilnblnk
237     character*(2) adpref
238     character*(80) fname
239    
240     c == functions ==
241     external ilnblnk
242    
243     c == end of interface ==
244     CEOP
245    
246     mynr = nr
247     adpref = 'ad'
248     write(fname(1:80),'(a)') ' '
249    
250     il = ilnblnk(active_var_file)
251    
252     write(fname(1:2),'(a)') adpref
253     write(fname(3:2+il),'(a)') active_var_file(1:il)
254    
255     call active_read_xz_rl_loc( fname, adactive_var,
256     & doglobalread, lAdInit, irec, mynr,
257     & REVERSE_SIMULATION, myiter, mythid )
258    
259     end
260    
261     CBOP
262     C !ROUTINE: adactive_read_yz_loc
263     C !INTERFACE:
264     subroutine adactive_read_yz_loc(
265     I active_var_file,
266     I irec,
267     I doglobalread,
268     I lAdInit,
269     I myiter,
270     I mythid,
271     I adactive_var
272     & )
273    
274     C !DESCRIPTION: \bv
275     c ==================================================================
276     c SUBROUTINE adactive_read_yz_loc
277     c ==================================================================
278     c o Adjoint of active_read_yz_loc.
279     c started: heimbach@mit.edu 05-Mar-2001
280     c ==================================================================
281     C \ev
282    
283     C !USES:
284     implicit none
285    
286     c == global variables ==
287     #include "EEPARAMS.h"
288     #include "SIZE.h"
289    
290     c == routine arguments ==
291     c active_var_file: filename
292     c adactive_var: array
293     c irec: record number
294     c myIter: number of optimization iteration (default: 0)
295     c mythid: thread number for this instance
296     c doglobalread: flag for global or local read/write
297     c (default: .false.)
298     c lAdInit: initialisation of corresponding adjoint
299     c variable and write to active file
300     character*(*) active_var_file
301     _RL adactive_var(1-oly:sny+oly,nr,nsx,nsy)
302     integer irec
303     integer myiter,mythid
304     logical doglobalread
305     logical lAdInit
306    
307     C !LOCAL VARIABLES:
308     c == local variables ==
309     integer mynr
310     integer il
311     integer ilnblnk
312     character*(2) adpref
313     character*(80) fname
314    
315     c == functions ==
316     external ilnblnk
317    
318     c == end of interface ==
319     CEOP
320    
321     mynr = nr
322     adpref = 'ad'
323     write(fname(1:80),'(a)') ' '
324    
325     il = ilnblnk(active_var_file)
326    
327     write(fname(1:2),'(a)') adpref
328     write(fname(3:2+il),'(a)') active_var_file(1:il)
329    
330     call active_read_yz_rl_loc( fname, adactive_var,
331     & doglobalread, lAdInit, irec, mynr,
332     & REVERSE_SIMULATION, myiter, mythid )
333    
334     end
335    
336     CBOP
337     C !ROUTINE: adactive_read_xy_loc
338     C !INTERFACE:
339     subroutine adactive_write_xy_loc(
340     I active_var_file,
341     I irec,
342     I myiter,
343     I mythid,
344     U adactive_var,
345     I dummy
346     & )
347    
348    
349     C !DESCRIPTION: \bv
350     c ==================================================================
351     c SUBROUTINE adactive_write_xy_loc
352     c ==================================================================
353     c o Adjoint of active_write_xy_loc.
354     c started: Christian Eckert eckert@mit.edu 24-May-1999
355     c ==================================================================
356     C \ev
357    
358     C !USES:
359     implicit none
360    
361     c == global variables ==
362     #include "EEPARAMS.h"
363     #include "SIZE.h"
364    
365     c == routine arguments ==
366     c active_var_file: filename
367     c adactive_var: array
368     c irec: record number
369     c myIter: number of optimization iteration (default: 0)
370     c mythid: thread number for this instance
371     character*(*) active_var_file
372     _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
373     integer irec
374     integer myiter,mythid
375     _RL dummy
376    
377     C !LOCAL VARIABLES:
378     c == local variables ==
379     integer mynr
380     integer il
381     integer ilnblnk
382     character*(2) adpref
383     character*(80) fname
384     logical globalfile
385    
386     c == functions ==
387     external ilnblnk
388    
389     c == end of interface ==
390     CEOP
391    
392     mynr = 1
393     adpref = 'ad'
394     write(fname(1:80),'(a)') ' '
395    
396     il = ilnblnk(active_var_file)
397    
398     write(fname(1:2),'(a)') adpref
399     write(fname(3:2+il),'(a)') active_var_file(1:il)
400    
401     globalfile = .false.
402    
403     call active_write_rl_loc( fname, adactive_var,
404     & globalfile, irec, mynr,
405     & REVERSE_SIMULATION, myiter, mythid )
406    
407     end
408    
409     CBOP
410     C !ROUTINE: adactive_read_xyz_loc
411     C !INTERFACE:
412     subroutine adactive_write_xyz_loc(
413     I active_var_file,
414     I irec,
415     I myiter,
416     I mythid,
417     U adactive_var,
418     I dummy
419     & )
420    
421    
422     C !DESCRIPTION: \bv
423     c ==================================================================
424     c SUBROUTINE adactive_write_xyz_loc
425     c ==================================================================
426     c o Adjoint of active_write_xyz_loc.
427     c started: Christian Eckert eckert@mit.edu 24-May-1999
428     c ==================================================================
429     C \ev
430    
431     C !USES:
432     implicit none
433    
434     c == global variables ==
435     #include "EEPARAMS.h"
436     #include "SIZE.h"
437    
438     c == routine arguments ==
439     c active_var_file: filename
440     c adactive_var: array
441     c irec: record number
442     c myIter: number of optimization iteration (default: 0)
443     c mythid: thread number for this instance
444     character*(*) active_var_file
445     _RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
446     integer irec
447     integer myiter,mythid
448     _RL dummy
449    
450     C !LOCAL VARIABLES:
451     c == local variables ==
452     integer mynr
453     integer il
454     integer ilnblnk
455     character*(2) adpref
456     character*(80) fname
457     logical globalfile
458    
459     c == functions ==
460     external ilnblnk
461    
462     c == end of interface ==
463     CEOP
464    
465     mynr = nr
466     adpref = 'ad'
467     write(fname(1:80),'(a)') ' '
468    
469     il = ilnblnk(active_var_file)
470    
471     write(fname(1:2),'(a)') adpref
472     write(fname(3:2+il),'(a)') active_var_file(1:il)
473    
474     globalfile = .false.
475    
476     call active_write_rl_loc( fname, adactive_var,
477     & globalfile, irec, mynr,
478     & REVERSE_SIMULATION, myiter, mythid )
479    
480     end
481    
482     CBOP
483     C !ROUTINE: adactive_read_xz_loc
484     C !INTERFACE:
485     subroutine adactive_write_xz_loc(
486     I active_var_file,
487     I irec,
488     I myiter,
489     I mythid,
490     U adactive_var,
491     I dummy
492     & )
493    
494    
495     C !DESCRIPTION: \bv
496     c ==================================================================
497     c SUBROUTINE adactive_write_xz_loc
498     c ==================================================================
499     c o Adjoint of active_write_xz_loc.
500     c started: heimbach@mit.edu 05-Mar-2001
501     c ==================================================================
502     C \ev
503    
504     C !USES:
505     implicit none
506    
507     c == global variables ==
508     #include "EEPARAMS.h"
509     #include "SIZE.h"
510    
511     c == routine arguments ==
512     c active_var_file: filename
513     c adactive_var: array
514     c irec: record number
515     c myIter: number of optimization iteration (default: 0)
516     c mythid: thread number for this instance
517     character*(*) active_var_file
518     _RL adactive_var(1-olx:snx+olx,nr,nsx,nsy)
519     integer irec
520     integer myiter,mythid
521     _RL dummy
522    
523     C !LOCAL VARIABLES:
524     c == local variables ==
525     integer mynr
526     integer il
527     integer ilnblnk
528     character*(2) adpref
529     character*(80) fname
530     logical globalfile
531    
532     c == functions ==
533     external ilnblnk
534    
535     c == end of interface ==
536     CEOP
537    
538     mynr = nr
539     adpref = 'ad'
540     write(fname(1:80),'(a)') ' '
541    
542     il = ilnblnk(active_var_file)
543    
544     write(fname(1:2),'(a)') adpref
545     write(fname(3:2+il),'(a)') active_var_file(1:il)
546    
547     globalfile = .false.
548    
549     call active_write_xz_rl_loc( fname, adactive_var,
550     & globalfile, irec, mynr,
551     & REVERSE_SIMULATION, myiter, mythid )
552    
553     end
554    
555     CBOP
556     C !ROUTINE: adactive_read_yz_loc
557     C !INTERFACE:
558     subroutine adactive_write_yz_loc(
559     I active_var_file,
560     I irec,
561     I myiter,
562     I mythid,
563     U adactive_var,
564     I dummy
565     & )
566    
567    
568     C !DESCRIPTION: \bv
569     c ==================================================================
570     c SUBROUTINE adactive_write_yz_loc
571     c ==================================================================
572     c o Adjoint of active_write_yz_loc.
573     c started: heimbach@mit.edu 05-Mar-2001
574     c ==================================================================
575     C \ev
576    
577     C !USES:
578     implicit none
579    
580     c == global variables ==
581     #include "EEPARAMS.h"
582     #include "SIZE.h"
583    
584     c == routine arguments ==
585     c active_var_file: filename
586     c adactive_var: array
587     c irec: record number
588     c myIter: number of optimization iteration (default: 0)
589     c mythid: thread number for this instance
590     character*(*) active_var_file
591     _RL adactive_var(1-oly:sny+oly,nr,nsx,nsy)
592     integer irec
593     integer myiter,mythid
594     _RL dummy
595    
596     C !LOCAL VARIABLES:
597     c == local variables ==
598     integer mynr
599     integer il
600     integer ilnblnk
601     character*(2) adpref
602     character*(80) fname
603     logical globalfile
604    
605     c == functions ==
606     external ilnblnk
607    
608     c == end of interface ==
609     CEOP
610    
611     mynr = nr
612     adpref = 'ad'
613     write(fname(1:80),'(a)') ' '
614    
615     il = ilnblnk(active_var_file)
616    
617     write(fname(1:2),'(a)') adpref
618     write(fname(3:2+il),'(a)') active_var_file(1:il)
619    
620     globalfile = .false.
621    
622     call active_write_yz_rl_loc( fname, adactive_var,
623     & globalfile, irec, mynr,
624     & REVERSE_SIMULATION, myiter, mythid )
625    
626     end
627    
628    

  ViewVC Help
Powered by ViewVC 1.1.22