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

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

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


Revision 1.6 - (hide annotations) (download)
Fri Aug 3 18:49:34 2012 UTC (11 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63r, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.5: +306 -327 lines
replace calls to specific "_LOC" version (from active_file_loc_control*.F)
with calls to standard version (S/R ACTIVE_READ/WRITE_3D/XZ/YZ_RL), and
set "useCurrentDir" to .TRUE.

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

  ViewVC Help
Powered by ViewVC 1.1.22