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

Diff of /MITgcm/pkg/autodiff/active_file_ad.F

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

revision 1.1 by heimbach, Sun Mar 25 22:33:53 2001 UTC revision 1.8 by heimbach, Fri Jun 20 21:43:18 2008 UTC
# Line 1  Line 1 
1    
2  CADJ SUBROUTINE active_read_rl  INPUT   = 1, 2, 3, 4, 5, 6, 7, 8, 9  #include "AUTODIFF_OPTIONS.h"
 CADJ SUBROUTINE active_read_rl  OUTPUT  =    2  
   
 CADJ SUBROUTINE active_write_rl INPUT   = 1, 2, 3, 4, 5, 6, 7, 8  
 CADJ SUBROUTINE active_write_rl OUTPUT  =    2  
   
 CADJ SUBROUTINE active_read_tile_rl  INPUT   = 1, 2, 3, 4, 5, 6, 7, 8, 9  
 CADJ SUBROUTINE active_read_tile_rl  INPUT  += 10, 11  
 CADJ SUBROUTINE active_read_tile_rl  OUTPUT  =    2  
   
 CADJ SUBROUTINE active_write_tile_rl INPUT   = 1, 2, 3, 4, 5, 6, 7, 8, 9  
 CADJ SUBROUTINE active_write_tile_rl INPUT  += 10  
 CADJ SUBROUTINE active_write_tile_rl OUTPUT  =    2  
   
 #include "CPP_OPTIONS.h"  
3    
4  c     ==================================================================  c     ==================================================================
5  c  c
# Line 28  c     o  adactive_read_xyz        - Adjo Line 14  c     o  adactive_read_xyz        - Adjo
14  c     o  adactive_write_xy        - Adjoint of active_write_xy  c     o  adactive_write_xy        - Adjoint of active_write_xy
15  c     o  adactive_write_xyz       - Adjoint of active_write_xyz  c     o  adactive_write_xyz       - Adjoint of active_write_xyz
16  c  c
17  c     o  adactive_read_tile_xy    - Adjoint of active_read_tile_xy  c     o  adactive_read_xz         - Adjoint of active_read_xz
18  c     o  adactive_read_tile_xyz   - Adjoint of active_read_tile_xyz  c     o  adactive_read_yz         - Adjoint of active_read_yz
19  c     o  adactive_write_tile_xy   - Adjoint of active_write_tile_xy  c     o  adactive_write_xz        - Adjoint of active_write_xz
20  c     o  adactive_write_tile_xyz  - Adjoint of active_write_tile_xyz  c     o  adactive_write_yz        - Adjoint of active_write_yz
 c  
21  c  c
22  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000
 c  
23  c                 - Added routines that do active writes on tiles  c                 - Added routines that do active writes on tiles
24  c                   instead of a whole thread.  c                   instead of a whole thread.
 c  
25  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
 c  
26  c                 - changed suboutine argument list:  c                 - changed suboutine argument list:
27  c                   dropped mycurrentiter, mycurrenttime  c                   dropped mycurrentiter, mycurrenttime
28    c        changed: heimbach@mit.edu 25-Mar-2002
29    c                 - added active file handling of xz-/yz-arrays
30  c  c
31  c     ==================================================================  c     ==================================================================
32    
33    CBOP
34    C     !ROUTINE: adactive_read_xy
35    C     !INTERFACE:
36    #ifdef AUTODIFF_TAMC_COMPATIBILITY
37        subroutine adactive_read_xy(        subroutine adactive_read_xy(
38       I                             active_var_file,       I                             active_var_file,
39       I                             irec,       I                             irec,
# Line 55  c     ================================== Line 43  c     ==================================
43       I                             mythid,       I                             mythid,
44       I                             adactive_var       I                             adactive_var
45       &                           )       &                           )
46    #else
47          subroutine adactive_read_xy(
48         I                             active_var_file,
49         I                             adactive_var,
50         I                             irec,
51         I                             doglobalread,
52         I                             lAdInit,
53         I                             myiter,
54         I                             mythid
55         &                           )
56    #endif
57    
58    C     !DESCRIPTION: \bv
59  c     ==================================================================  c     ==================================================================
60  c     SUBROUTINE active_read_xy  c     SUBROUTINE adactive_read_xy
61  c     ==================================================================  c     ==================================================================
 c  
62  c     o Adjoint of active_read_xy.  c     o Adjoint of active_read_xy.
 c  
63  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_read_xy  
64  c     ==================================================================  c     ==================================================================
65    C     \ev
66    
67    C     !USES:
68        implicit none        implicit none
69    
70  c     == global variables ==  c     == global variables ==
   
71  #include "EEPARAMS.h"  #include "EEPARAMS.h"
72  #include "SIZE.h"  #include "SIZE.h"
73    
74    C     !INPUT/OUTPUT PARAMETERS:
75  c     == routine arguments ==  c     == routine arguments ==
76    c     active_var_file: filename
77    c     adactive_var:    array
78    c     irec:            record number
79    c     myIter:          number of optimization iteration (default: 0)
80    c     mythid:          thread number for this instance
81    c     doglobalread:    flag for global or local read/write
82    c                      (default: .false.)
83    c     lAdInit:         initialisation of corresponding adjoint
84    c                      variable and write to active file
85        character*(*) active_var_file        character*(*) active_var_file
86        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
87        integer irec        integer irec
# Line 94  c     == routine arguments == Line 89  c     == routine arguments ==
89        logical doglobalread        logical doglobalread
90        logical lAdInit        logical lAdInit
91    
92    C     !LOCAL VARIABLES:
93  c     == local variables ==  c     == local variables ==
   
94        integer mynr        integer mynr
95        integer il        integer il
96        integer ilnblnk        integer ilnblnk
# Line 103  c     == local variables == Line 98  c     == local variables ==
98        character*(80) fname        character*(80) fname
99    
100  c     == functions ==  c     == functions ==
   
101        external ilnblnk        external ilnblnk
102    
103  c     == end of interface ==  c     == end of interface ==
104    CEOP
105    
106        mynr   = 1        mynr   = 1
107        adpref = 'ad'        adpref = 'ad'
# Line 123  c     == end of interface == Line 118  c     == end of interface ==
118    
119        end        end
120    
121    CBOP
122    C     !ROUTINE: adactive_read_xyz
123    C     !INTERFACE:
124    #ifdef AUTODIFF_TAMC_COMPATIBILITY
125        subroutine adactive_read_xyz(        subroutine adactive_read_xyz(
126       I                              active_var_file,       I                              active_var_file,
127       I                              irec,       I                              irec,
# Line 132  c     == end of interface == Line 131  c     == end of interface ==
131       I                              mythid,       I                              mythid,
132       I                              adactive_var       I                              adactive_var
133       &                            )       &                            )
134    #else
135          subroutine adactive_read_xyz(
136         I                              active_var_file,
137         I                              adactive_var,
138         I                              irec,
139         I                              doglobalread,
140         I                              lAdInit,
141         I                              myiter,
142         I                              mythid
143         &                            )
144    #endif
145    
146    C     !DESCRIPTION: \bv
147  c     ==================================================================  c     ==================================================================
148  c     SUBROUTINE adactive_read_xyz  c     SUBROUTINE adactive_read_xyz
149  c     ==================================================================  c     ==================================================================
 c  
150  c     o Adjoint of active_read_xyz.  c     o Adjoint of active_read_xyz.
 c  
151  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
 c     ==================================================================  
 c     SUBROUTINE adactive_read_xyz  
152  c     ==================================================================  c     ==================================================================
153    C     \ev
154    
155    C     !USES:
156        implicit none        implicit none
157    
158  c     == global variables ==  c     == global variables ==
   
159  #include "EEPARAMS.h"  #include "EEPARAMS.h"
160  #include "SIZE.h"  #include "SIZE.h"
161    
162  c     == routine arguments ==  c     == routine arguments ==
163    c     active_var_file: filename
164    c     adactive_var:    array
165    c     irec:            record number
166    c     myIter:          number of optimization iteration (default: 0)
167    c     mythid:          thread number for this instance
168    c     doglobalread:    flag for global or local read/write
169    c                      (default: .false.)
170    c     lAdInit:         initialisation of corresponding adjoint
171    c                      variable and write to active file
172        character*(*) active_var_file        character*(*) active_var_file
173        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
174        integer irec        integer irec
# Line 171  c     == routine arguments == Line 176  c     == routine arguments ==
176        logical doglobalread        logical doglobalread
177        logical lAdInit        logical lAdInit
178    
179    C     !LOCAL VARIABLES:
180  c     == local variables ==  c     == local variables ==
   
181        integer mynr        integer mynr
182        integer il        integer il
183        integer ilnblnk        integer ilnblnk
# Line 180  c     == local variables == Line 185  c     == local variables ==
185        character*(80) fname        character*(80) fname
186    
187  c     == functions ==  c     == functions ==
   
188        external ilnblnk        external ilnblnk
189    
190  c     == end of interface ==  c     == end of interface ==
191    CEOP
192    
193        mynr   = nr        mynr   = nr
194        adpref = 'ad'        adpref = 'ad'
# Line 200  c     == end of interface == Line 205  c     == end of interface ==
205    
206        end        end
207    
208        subroutine adactive_write_xy(  CBOP
209    C     !ROUTINE: adactive_read_xz
210    C     !INTERFACE:
211    #ifdef AUTODIFF_TAMC_COMPATIBILITY
212          subroutine adactive_read_xz(
213       I                              active_var_file,       I                              active_var_file,
214       I                              irec,       I                              irec,
215         I                              doglobalread,
216         I                              lAdInit,
217       I                              myiter,       I                              myiter,
218       I                              mythid,       I                              mythid,
219       U                              adactive_var,       I                              adactive_var
      I                              dummy  
220       &                            )       &                            )
221    #else
222          subroutine adactive_read_xz(
223         I                              active_var_file,
224         I                              adactive_var,
225         I                              irec,
226         I                              doglobalread,
227         I                              lAdInit,
228         I                              myiter,
229         I                              mythid
230         &                            )
231    #endif
232    
233    C     !DESCRIPTION: \bv
234  c     ==================================================================  c     ==================================================================
235  c     SUBROUTINE adactive_write_xy  c     SUBROUTINE adactive_read_xz
236  c     ==================================================================  c     ==================================================================
237  c  c     o Adjoint of active_read_xz.
238  c     o Adjoint of active_write_xy.  c     started: heimbach@mit.edu 05-Mar-2001
 c  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
 c     ==================================================================  
 c     SUBROUTINE adactive_write_xy  
239  c     ==================================================================  c     ==================================================================
240    C     \ev
241    
242    C     !USES:
243        implicit none        implicit none
244    
245  c     == global variables ==  c     == global variables ==
   
246  #include "EEPARAMS.h"  #include "EEPARAMS.h"
247  #include "SIZE.h"  #include "SIZE.h"
248    
249  c     == routine arguments ==  c     == routine arguments ==
250    c     active_var_file: filename
251    c     adactive_var:    array
252    c     irec:            record number
253    c     myIter:          number of optimization iteration (default: 0)
254    c     mythid:          thread number for this instance
255    c     doglobalread:    flag for global or local read/write
256    c                      (default: .false.)
257    c     lAdInit:         initialisation of corresponding adjoint
258    c                      variable and write to active file
259        character*(*) active_var_file        character*(*) active_var_file
260        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
261        integer irec        integer irec
262        integer myiter,mythid        integer myiter,mythid
263        _RL     dummy        logical doglobalread
264          logical lAdInit
265    
266    C     !LOCAL VARIABLES:
267  c     == local variables ==  c     == local variables ==
   
268        integer mynr        integer mynr
269        integer il        integer il
270        integer ilnblnk        integer ilnblnk
271        character*(2) adpref        character*(2) adpref
272        character*(80) fname        character*(80) fname
       logical globalfile  
273    
274  c     == functions ==  c     == functions ==
   
275        external ilnblnk        external ilnblnk
276    
277  c     == end of interface ==  c     == end of interface ==
278    CEOP
279    
280        mynr   = 1        mynr   = nr
281        adpref = 'ad'        adpref = 'ad'
282        write(fname(1:80),'(a)') ' '        write(fname(1:80),'(a)') ' '
283    
# Line 271  c     == end of interface == Line 286  c     == end of interface ==
286        write(fname(1:2),'(a)') adpref        write(fname(1:2),'(a)') adpref
287        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
288    
289        globalfile = .false.        call active_read_xz_rl( fname, adactive_var,
290         &                     doglobalread, lAdInit, irec, mynr,
291        call active_write_rl( fname, adactive_var,       &                     REVERSE_SIMULATION, myiter, mythid )
      &                      globalfile, irec, mynr,  
      &                      REVERSE_SIMULATION, myiter, mythid )  
292    
293        end        end
294    
295    CBOP
296    C     !ROUTINE: adactive_read_yz
297    C     !INTERFACE:
298    #ifdef AUTODIFF_TAMC_COMPATIBILITY
299          subroutine adactive_read_yz(
300         I                              active_var_file,
301         I                              irec,
302         I                              doglobalread,
303         I                              lAdInit,
304         I                              myiter,
305         I                              mythid,
306         I                              adactive_var
307         &                            )
308    #else
309          subroutine adactive_read_yz(
310         I                              active_var_file,
311         I                              adactive_var,
312         I                              irec,
313         I                              doglobalread,
314         I                              lAdInit,
315         I                              myiter,
316         I                              mythid
317         &                            )
318    #endif
319    
320        subroutine adactive_write_xyz(  C     !DESCRIPTION: \bv
      I                               active_var_file,  
      I                               irec,  
      I                               myiter,  
      I                               mythid,  
      U                               adactive_var,  
      I                               dummy  
      &                             )  
   
   
 c     ==================================================================  
 c     SUBROUTINE adactive_write_xyz  
321  c     ==================================================================  c     ==================================================================
322  c  c     SUBROUTINE adactive_read_yz
 c     o Adjoint of active_write_xyz.  
 c  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
323  c     ==================================================================  c     ==================================================================
324  c     SUBROUTINE adactive_write_xyz  c     o Adjoint of active_read_yz.
325    c     started: heimbach@mit.edu 05-Mar-2001
326  c     ==================================================================  c     ==================================================================
327    C     \ev
328    
329    C     !USES:
330        implicit none        implicit none
331    
332  c     == global variables ==  c     == global variables ==
   
333  #include "EEPARAMS.h"  #include "EEPARAMS.h"
334  #include "SIZE.h"  #include "SIZE.h"
335    
336  c     == routine arguments ==  c     == routine arguments ==
337    c     active_var_file: filename
338    c     adactive_var:    array
339    c     irec:            record number
340    c     myIter:          number of optimization iteration (default: 0)
341    c     mythid:          thread number for this instance
342    c     doglobalread:    flag for global or local read/write
343    c                      (default: .false.)
344    c     lAdInit:         initialisation of corresponding adjoint
345    c                      variable and write to active file
346        character*(*) active_var_file        character*(*) active_var_file
347        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
348        integer irec        integer irec
349        integer myiter,mythid        integer myiter,mythid
350        _RL dummy        logical doglobalread
351          logical lAdInit
352    
353    C     !LOCAL VARIABLES:
354  c     == local variables ==  c     == local variables ==
   
355        integer mynr        integer mynr
356        integer il        integer il
357        integer ilnblnk        integer ilnblnk
358        character*(2) adpref        character*(2) adpref
359        character*(80) fname        character*(80) fname
       logical globalfile  
360    
361  c     == functions ==  c     == functions ==
   
362        external ilnblnk        external ilnblnk
363    
364  c     == end of interface ==  c     == end of interface ==
365    CEOP
366    
367        mynr   = nr        mynr   = nr
368        adpref = 'ad'        adpref = 'ad'
# Line 351  c     == end of interface == Line 373  c     == end of interface ==
373        write(fname(1:2),'(a)') adpref        write(fname(1:2),'(a)') adpref
374        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
375    
376        globalfile = .false.        call active_read_yz_rl( fname, adactive_var,
377         &                     doglobalread, lAdInit, irec, mynr,
378        call active_write_rl( fname, adactive_var,       &                     REVERSE_SIMULATION, myiter, mythid )
      &                      globalfile, irec, mynr,  
      &                      REVERSE_SIMULATION, myiter, mythid )  
379    
380        end        end
381    
382    CBOP
383    C     !ROUTINE: adactive_read_xy
384    C     !INTERFACE:
385    #ifdef AUTODIFF_TAMC_COMPATIBILITY
386          subroutine adactive_write_xy(
387         I                              active_var_file,
388         I                              irec,
389         I                              myiter,
390         I                              mythid,
391         U                              adactive_var,
392         I                              dummy
393         &                            )
394    #else
395          subroutine adactive_write_xy(
396         I                              active_var_file,
397         U                              adactive_var,
398         I                              irec,
399         I                              myiter,
400         I                              mythid,
401         I                              dummy
402         &                            )
403    #endif
404    
405    
406        subroutine adactive_read_tile_xy(  C     !DESCRIPTION: \bv
      I                                  active_var_file,  
      I                                  irec,  
      I                                  doglobalread,  
      I                                  bi,  
      I                                  bj,  
      I                                  lAdInit,  
      I                                  myOptimIter,  
      I                                  mythid,  
      U                                  adactive_var  
      &                                )  
   
407  c     ==================================================================  c     ==================================================================
408  c     SUBROUTINE active_read_tile_xy  c     SUBROUTINE adactive_write_xy
409  c     ==================================================================  c     ==================================================================
410  c  c     o Adjoint of active_write_xy.
 c     o Adjoint of active_read_tile_xy.  
 c  
411  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xy  
412  c     ==================================================================  c     ==================================================================
413    C     \ev
414    
415    C     !USES:
416        implicit none        implicit none
417    
418  c     == global variables ==  c     == global variables ==
   
419  #include "EEPARAMS.h"  #include "EEPARAMS.h"
420  #include "SIZE.h"  #include "SIZE.h"
421    
422  c     == routine arguments ==  c     == routine arguments ==
423    c     active_var_file: filename
424    c     adactive_var:    array
425    c     irec:            record number
426    c     myIter:          number of optimization iteration (default: 0)
427    c     mythid:          thread number for this instance
428        character*(*) active_var_file        character*(*) active_var_file
429        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
430        integer irec        integer irec
431        integer myOptimIter        integer myiter,mythid
432        integer mythid        _RL     dummy
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
433    
434    C     !LOCAL VARIABLES:
435  c     == local variables ==  c     == local variables ==
   
436        integer mynr        integer mynr
437        integer il        integer il
438        integer ilnblnk        integer ilnblnk
439        character*(2) adpref        character*(2) adpref
440        character*(80) fname        character*(80) fname
441          logical globalfile
442    
443  c     == functions ==  c     == functions ==
   
444        external ilnblnk        external ilnblnk
445    
446  c     == end of interface ==  c     == end of interface ==
447    CEOP
448    
449        mynr   = 1        mynr   = 1
450        adpref = 'ad'        adpref = 'ad'
# Line 439  c     == end of interface == Line 452  c     == end of interface ==
452    
453        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
454    
455        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
456        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
457    
458        call active_read_tile_rl(        globalfile = .false.
459       I                          fname,  
460       U                          adactive_var,        call active_write_rl( fname, adactive_var,
461       I                          doglobalread,       &                      globalfile, irec, mynr,
462       I                          lAdInit,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                          irec,  
      I                          mynr,  
      I                          bi,  
      I                          bj,  
      I                          REVERSE_SIMULATION,  
      I                          myOptimIter,  
      I                          mythid  
      &                        )  
463    
464        end        end
465    
466    CBOP
467    C     !ROUTINE: adactive_read_xyz
468    C     !INTERFACE:
469    #ifdef AUTODIFF_TAMC_COMPATIBILITY
470          subroutine adactive_write_xyz(
471         I                               active_var_file,
472         I                               irec,
473         I                               myiter,
474         I                               mythid,
475         U                               adactive_var,
476         I                               dummy
477         &                             )
478    #else
479          subroutine adactive_write_xyz(
480         I                               active_var_file,
481         U                               adactive_var,
482         I                               irec,
483         I                               myiter,
484         I                               mythid,
485         I                               dummy
486         &                             )
487    #endif
488    
       subroutine adactive_read_tile_xyz(  
      I                                   active_var_file,  
      I                                   irec,  
      I                                   doglobalread,  
      I                                   bi,  
      I                                   bj,  
      I                                   lAdInit,  
      I                                   myOptimIter,  
      I                                   mythid,  
      U                                   adactive_var  
      &                                 )  
489    
490    C     !DESCRIPTION: \bv
491  c     ==================================================================  c     ==================================================================
492  c     SUBROUTINE adactive_read_tile_xyz  c     SUBROUTINE adactive_write_xyz
493  c     ==================================================================  c     ==================================================================
494  c  c     o Adjoint of active_write_xyz.
 c     o Adjoint of active_read_tile_xyz.  
 c  
495  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
 c     ==================================================================  
 c     SUBROUTINE adactive_read_tile_xyz  
496  c     ==================================================================  c     ==================================================================
497    C     \ev
498    
499    C     !USES:
500        implicit none        implicit none
501    
502  c     == global variables ==  c     == global variables ==
   
503  #include "EEPARAMS.h"  #include "EEPARAMS.h"
504  #include "SIZE.h"  #include "SIZE.h"
505    
506  c     == routine arguments ==  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        character*(*) active_var_file
513        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
514        integer irec        integer irec
515        integer myOptimIter        integer myiter,mythid
516        integer mythid        _RL dummy
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
517    
518    C     !LOCAL VARIABLES:
519  c     == local variables ==  c     == local variables ==
   
520        integer mynr        integer mynr
521        integer il        integer il
522        integer ilnblnk        integer ilnblnk
523        character*(2) adpref        character*(2) adpref
524        character*(80) fname        character*(80) fname
525          logical globalfile
526    
527  c     == functions ==  c     == functions ==
   
528        external ilnblnk        external ilnblnk
529    
530  c     == end of interface ==  c     == end of interface ==
531    CEOP
532    
533        mynr   = nr        mynr   = nr
534        adpref = 'ad'        adpref = 'ad'
# Line 537  c     == end of interface == Line 536  c     == end of interface ==
536    
537        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
538    
539        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
540        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
541    
542        call active_read_tile_rl(        globalfile = .false.
      I                          fname,  
      U                          adactive_var,  
      I                          doglobalread,  
      I                          lAdInit,  
      I                          irec,  
      I                          mynr,  
      I                          bi,  
      I                          bj,  
      I                          REVERSE_SIMULATION,  
      I                          myOptimIter,  
      I                          mythid  
      &                        )  
   
       end  
543    
544          call active_write_rl( fname, adactive_var,
545         &                      globalfile, irec, mynr,
546         &                      REVERSE_SIMULATION, myiter, mythid )
547    
548        subroutine adactive_write_tile_xy(        end
      I                                   active_var_file,  
      I                                   irec,  
      I                                   bi,  
      I                                   bj,  
      I                                   myOptimIter,  
      I                                   mythid,  
      U                                   adactive_var  
      &                                 )  
549    
550    CBOP
551    C     !ROUTINE: adactive_read_xz
552    C     !INTERFACE:
553    #ifdef AUTODIFF_TAMC_COMPATIBILITY
554          subroutine adactive_write_xz(
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(
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     ==================================================================  c     ==================================================================
575  c     SUBROUTINE adactive_write_tile_xy  c     SUBROUTINE adactive_write_xz
 c     ==================================================================  
 c  
 c     o Adjoint of active_write_tile_xy.  
 c  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
576  c     ==================================================================  c     ==================================================================
577  c     SUBROUTINE adactive_write_tile_xy  c     o Adjoint of active_write_xz.
578    c     started: heimbach@mit.edu 05-Mar-2001
579  c     ==================================================================  c     ==================================================================
580    C     \ev
581    
582    C     !USES:
583        implicit none        implicit none
584    
585  c     == global variables ==  c     == global variables ==
   
586  #include "EEPARAMS.h"  #include "EEPARAMS.h"
587  #include "SIZE.h"  #include "SIZE.h"
588    
589  c     == routine arguments ==  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        character*(*) active_var_file
596        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
597        integer irec        integer irec
598        integer bi        integer myiter,mythid
599        integer bj        _RL dummy
       integer myOptimIter  
       integer mythid  
600    
601    C     !LOCAL VARIABLES:
602  c     == local variables ==  c     == local variables ==
   
603        integer mynr        integer mynr
604        integer il        integer il
605        integer ilnblnk        integer ilnblnk
# Line 622  c     == local variables == Line 608  c     == local variables ==
608        logical globalfile        logical globalfile
609    
610  c     == functions ==  c     == functions ==
   
611        external ilnblnk        external ilnblnk
612    
613  c     == end of interface ==  c     == end of interface ==
614    CEOP
615    
616        mynr   = 1        mynr   = nr
617        adpref = 'ad'        adpref = 'ad'
618        write(fname(1:80),'(a)') ' '        write(fname(1:80),'(a)') ' '
619    
620        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
621    
622        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
623        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
624    
625        globalfile = .false.        globalfile = .false.
626    
627        call active_write_tile_rl(        call active_write_xz_rl( fname, adactive_var,
628       I                           fname,       &                      globalfile, irec, mynr,
629       U                           adactive_var,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
630    
631        end        end
632    
633    CBOP
634        subroutine adactive_write_tile_xyz(  C     !ROUTINE: adactive_read_yz
635       I                                    active_var_file,  C     !INTERFACE:
636       I                                    irec,  #ifdef AUTODIFF_TAMC_COMPATIBILITY
637       I                                    bi,        subroutine adactive_write_yz(
638       I                                    bj,       I                               active_var_file,
639       I                                    myOptimIter,       I                               irec,
640       I                                    mythid,       I                               myiter,
641       U                                    adactive_var       I                               mythid,
642       &                                  )       U                               adactive_var,
643         I                               dummy
644         &                             )
645    #else
646          subroutine adactive_write_yz(
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    
657    C     !DESCRIPTION: \bv
658  c     ==================================================================  c     ==================================================================
659  c     SUBROUTINE adactive_write_tile_xyz  c     SUBROUTINE adactive_write_yz
 c     ==================================================================  
 c  
 c     o Adjoint of active_write_tile_xyz.  
 c  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed suboutine argument list:  
 c                dropped mycurrentiter, mycurrenttime  
 c  
660  c     ==================================================================  c     ==================================================================
661  c     SUBROUTINE adactive_write_tile_xyz  c     o Adjoint of active_write_yz.
662    c     started: heimbach@mit.edu 05-Mar-2001
663  c     ==================================================================  c     ==================================================================
664    C     \ev
665    
666    C     !USES:
667        implicit none        implicit none
668    
669  c     == global variables ==  c     == global variables ==
   
670  #include "EEPARAMS.h"  #include "EEPARAMS.h"
671  #include "SIZE.h"  #include "SIZE.h"
672    
673  c     == routine arguments ==  c     == routine arguments ==
674    c     active_var_file: filename
675    c     adactive_var:    array
676    c     irec:            record number
677    c     myIter:          number of optimization iteration (default: 0)
678    c     mythid:          thread number for this instance
679        character*(*) active_var_file        character*(*) active_var_file
680        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
681        integer irec        integer irec
682        integer bi        integer myiter,mythid
683        integer bj        _RL dummy
       integer myOptimIter  
       integer mythid  
684    
685    C     !LOCAL VARIABLES:
686  c     == local variables ==  c     == local variables ==
   
687        integer mynr        integer mynr
688        integer il        integer il
689        integer ilnblnk        integer ilnblnk
# Line 719  c     == local variables == Line 692  c     == local variables ==
692        logical globalfile        logical globalfile
693    
694  c     == functions ==  c     == functions ==
   
695        external ilnblnk        external ilnblnk
696    
697  c     == end of interface ==  c     == end of interface ==
698    CEOP
699    
700        mynr   = nr        mynr   = nr
701        adpref = 'ad'        adpref = 'ad'
# Line 735  c     == end of interface == Line 708  c     == end of interface ==
708    
709        globalfile = .false.        globalfile = .false.
710    
711        call active_write_tile_rl(        call active_write_yz_rl( fname, adactive_var,
712       I                           fname,       &                      globalfile, irec, mynr,
713       U                           adactive_var,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
714    
715        end        end
716    
717    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22