/[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.2 by heimbach, Fri Sep 28 04:19:27 2001 UTC revision 1.9 by jmc, Sat Aug 2 23:16:58 2008 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "AUTODIFF_OPTIONS.h"
5    
6  c     ==================================================================  c     ==================================================================
7  c  c
# Line 14  c     o  adactive_read_xyz        - Adjo Line 16  c     o  adactive_read_xyz        - Adjo
16  c     o  adactive_write_xy        - Adjoint of active_write_xy  c     o  adactive_write_xy        - Adjoint of active_write_xy
17  c     o  adactive_write_xyz       - Adjoint of active_write_xyz  c     o  adactive_write_xyz       - Adjoint of active_write_xyz
18  c  c
19  c     o  adactive_read_tile_xy    - Adjoint of active_read_tile_xy  c     o  adactive_read_xz         - Adjoint of active_read_xz
20  c     o  adactive_read_tile_xyz   - Adjoint of active_read_tile_xyz  c     o  adactive_read_yz         - Adjoint of active_read_yz
21  c     o  adactive_write_tile_xy   - Adjoint of active_write_tile_xy  c     o  adactive_write_xz        - Adjoint of active_write_xz
22  c     o  adactive_write_tile_xyz  - Adjoint of active_write_tile_xyz  c     o  adactive_write_yz        - Adjoint of active_write_yz
 c  
23  c  c
24  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000
25  c                 - Added routines that do active writes on tiles  c                 - Added routines that do active writes on tiles
26  c                   instead of a whole thread.  c                   instead of a whole thread.
27  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
28  c                 - changed suboutine argument list:  c                 - changed suboutine argument list:
29  c                   dropped mycurrentiter, mycurrenttime  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  c
33  c     ==================================================================  c     ==================================================================
34    
35  CBOP  CBOP
36  C     !ROUTINE: adactive_read_xy  C     !ROUTINE: adactive_read_xy
37  C     !INTERFACE:  C     !INTERFACE:
38    #ifdef AUTODIFF_TAMC_COMPATIBILITY
39        subroutine adactive_read_xy(        subroutine adactive_read_xy(
40       I                             active_var_file,       I                             active_var_file,
41       I                             irec,       I                             irec,
# Line 41  C     !INTERFACE: Line 45  C     !INTERFACE:
45       I                             mythid,       I                             mythid,
46       I                             adactive_var       I                             adactive_var
47       &                           )       &                           )
48    #else
49          subroutine adactive_read_xy(
50         I                             active_var_file,
51         I                             adactive_var,
52         I                             irec,
53         I                             doglobalread,
54         I                             lAdInit,
55         I                             myiter,
56         I                             mythid
57         &                           )
58    #endif
59    
60  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
61  c     ==================================================================  c     ==================================================================
# Line 49  c     ================================== Line 64  c     ==================================
64  c     o Adjoint of active_read_xy.  c     o Adjoint of active_read_xy.
65  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
66  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_read_xy  
 c     ==================================================================  
67  C     \ev  C     \ev
68    
69  C     !USES:  C     !USES:
# Line 110  CEOP Line 123  CEOP
123  CBOP  CBOP
124  C     !ROUTINE: adactive_read_xyz  C     !ROUTINE: adactive_read_xyz
125  C     !INTERFACE:  C     !INTERFACE:
126    #ifdef AUTODIFF_TAMC_COMPATIBILITY
127        subroutine adactive_read_xyz(        subroutine adactive_read_xyz(
128       I                              active_var_file,       I                              active_var_file,
129       I                              irec,       I                              irec,
# Line 119  C     !INTERFACE: Line 133  C     !INTERFACE:
133       I                              mythid,       I                              mythid,
134       I                              adactive_var       I                              adactive_var
135       &                            )       &                            )
136    #else
137          subroutine adactive_read_xyz(
138         I                              active_var_file,
139         I                              adactive_var,
140         I                              irec,
141         I                              doglobalread,
142         I                              lAdInit,
143         I                              myiter,
144         I                              mythid
145         &                            )
146    #endif
147    
148  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
149  c     ==================================================================  c     ==================================================================
# Line 127  c     ================================== Line 152  c     ==================================
152  c     o Adjoint of active_read_xyz.  c     o Adjoint of active_read_xyz.
153  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
154  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_read_xyz  
 c     ==================================================================  
155  C     \ev  C     \ev
156    
157  C     !USES:  C     !USES:
# Line 185  CEOP Line 208  CEOP
208        end        end
209    
210  CBOP  CBOP
211  C     !ROUTINE: adactive_read_xy  C     !ROUTINE: adactive_read_xz
212  C     !INTERFACE:  C     !INTERFACE:
213        subroutine adactive_write_xy(  #ifdef AUTODIFF_TAMC_COMPATIBILITY
214          subroutine adactive_read_xz(
215       I                              active_var_file,       I                              active_var_file,
216       I                              irec,       I                              irec,
217         I                              doglobalread,
218         I                              lAdInit,
219       I                              myiter,       I                              myiter,
220       I                              mythid,       I                              mythid,
221       U                              adactive_var,       I                              adactive_var
      I                              dummy  
222       &                            )       &                            )
223    #else
224          subroutine adactive_read_xz(
225         I                              active_var_file,
226         I                              adactive_var,
227         I                              irec,
228         I                              doglobalread,
229         I                              lAdInit,
230         I                              myiter,
231         I                              mythid
232         &                            )
233    #endif
234    
235  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
236  c     ==================================================================  c     ==================================================================
237  c     SUBROUTINE adactive_write_xy  c     SUBROUTINE adactive_read_xz
 c     ==================================================================  
 c     o Adjoint of active_write_xy.  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
238  c     ==================================================================  c     ==================================================================
239  c     SUBROUTINE adactive_write_xy  c     o Adjoint of active_read_xz.
240    c     started: heimbach@mit.edu 05-Mar-2001
241  c     ==================================================================  c     ==================================================================
242  C     \ev  C     \ev
243    
# Line 221  c     adactive_var:    array Line 254  c     adactive_var:    array
254  c     irec:            record number  c     irec:            record number
255  c     myIter:          number of optimization iteration (default: 0)  c     myIter:          number of optimization iteration (default: 0)
256  c     mythid:          thread number for this instance  c     mythid:          thread number for this instance
257    c     doglobalread:    flag for global or local read/write
258    c                      (default: .false.)
259    c     lAdInit:         initialisation of corresponding adjoint
260    c                      variable and write to active file
261        character*(*) active_var_file        character*(*) active_var_file
262        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
263        integer irec        integer irec
264        integer myiter,mythid        integer myiter,mythid
265        _RL     dummy        logical doglobalread
266          logical lAdInit
267    
268  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
269  c     == local variables ==  c     == local variables ==
# Line 234  c     == local variables == Line 272  c     == local variables ==
272        integer ilnblnk        integer ilnblnk
273        character*(2) adpref        character*(2) adpref
274        character*(80) fname        character*(80) fname
       logical globalfile  
275    
276  c     == functions ==  c     == functions ==
277        external ilnblnk        external ilnblnk
# Line 242  c     == functions == Line 279  c     == functions ==
279  c     == end of interface ==  c     == end of interface ==
280  CEOP  CEOP
281    
282        mynr   = 1        mynr   = nr
283        adpref = 'ad'        adpref = 'ad'
284        write(fname(1:80),'(a)') ' '        write(fname(1:80),'(a)') ' '
285    
# Line 251  CEOP Line 288  CEOP
288        write(fname(1:2),'(a)') adpref        write(fname(1:2),'(a)') adpref
289        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
290    
291        globalfile = .false.        call active_read_xz_rl( fname, adactive_var,
292         &                     doglobalread, lAdInit, irec, mynr,
293        call active_write_rl( fname, adactive_var,       &                     REVERSE_SIMULATION, myiter, mythid )
      &                      globalfile, irec, mynr,  
      &                      REVERSE_SIMULATION, myiter, mythid )  
294    
295        end        end
296    
   
297  CBOP  CBOP
298  C     !ROUTINE: adactive_read_xyz  C     !ROUTINE: adactive_read_yz
299  C     !INTERFACE:  C     !INTERFACE:
300        subroutine adactive_write_xyz(  #ifdef AUTODIFF_TAMC_COMPATIBILITY
301       I                               active_var_file,        subroutine adactive_read_yz(
302       I                               irec,       I                              active_var_file,
303       I                               myiter,       I                              irec,
304       I                               mythid,       I                              doglobalread,
305       U                               adactive_var,       I                              lAdInit,
306       I                               dummy       I                              myiter,
307       &                             )       I                              mythid,
308         I                              adactive_var
309         &                            )
310    #else
311          subroutine adactive_read_yz(
312         I                              active_var_file,
313         I                              adactive_var,
314         I                              irec,
315         I                              doglobalread,
316         I                              lAdInit,
317         I                              myiter,
318         I                              mythid
319         &                            )
320    #endif
321    
322  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
323  c     ==================================================================  c     ==================================================================
324  c     SUBROUTINE adactive_write_xyz  c     SUBROUTINE adactive_read_yz
 c     ==================================================================  
 c     o Adjoint of active_write_xyz.  
 c     started: Christian Eckert eckert@mit.edu 24-May-1999  
325  c     ==================================================================  c     ==================================================================
326  c     SUBROUTINE adactive_write_xyz  c     o Adjoint of active_read_yz.
327    c     started: heimbach@mit.edu 05-Mar-2001
328  c     ==================================================================  c     ==================================================================
329  C     \ev  C     \ev
330    
# Line 297  c     adactive_var:    array Line 341  c     adactive_var:    array
341  c     irec:            record number  c     irec:            record number
342  c     myIter:          number of optimization iteration (default: 0)  c     myIter:          number of optimization iteration (default: 0)
343  c     mythid:          thread number for this instance  c     mythid:          thread number for this instance
344    c     doglobalread:    flag for global or local read/write
345    c                      (default: .false.)
346    c     lAdInit:         initialisation of corresponding adjoint
347    c                      variable and write to active file
348        character*(*) active_var_file        character*(*) active_var_file
349        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
350        integer irec        integer irec
351        integer myiter,mythid        integer myiter,mythid
352        _RL dummy        logical doglobalread
353          logical lAdInit
354    
355  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
356  c     == local variables ==  c     == local variables ==
# Line 310  c     == local variables == Line 359  c     == local variables ==
359        integer ilnblnk        integer ilnblnk
360        character*(2) adpref        character*(2) adpref
361        character*(80) fname        character*(80) fname
       logical globalfile  
362    
363  c     == functions ==  c     == functions ==
364        external ilnblnk        external ilnblnk
# Line 327  CEOP Line 375  CEOP
375        write(fname(1:2),'(a)') adpref        write(fname(1:2),'(a)') adpref
376        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
377    
378        globalfile = .false.        call active_read_yz_rl( fname, adactive_var,
379         &                     doglobalread, lAdInit, irec, mynr,
380        call active_write_rl( fname, adactive_var,       &                     REVERSE_SIMULATION, myiter, mythid )
      &                      globalfile, irec, mynr,  
      &                      REVERSE_SIMULATION, myiter, mythid )  
381    
382        end        end
383    
384    CBOP
385    C     !ROUTINE: adactive_read_xy
386    C     !INTERFACE:
387    #ifdef AUTODIFF_TAMC_COMPATIBILITY
388          subroutine adactive_write_xy(
389         I                              active_var_file,
390         I                              irec,
391         I                              myiter,
392         I                              mythid,
393         U                              adactive_var,
394         I                              dummy
395         &                            )
396    #else
397          subroutine adactive_write_xy(
398         I                              active_var_file,
399         U                              adactive_var,
400         I                              irec,
401         I                              myiter,
402         I                              mythid,
403         I                              dummy
404         &                            )
405    #endif
406    
407    
408        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  
      &                                )  
   
409  c     ==================================================================  c     ==================================================================
410  c     SUBROUTINE active_read_tile_xy  c     SUBROUTINE adactive_write_xy
411  c     ==================================================================  c     ==================================================================
412  c  c     o Adjoint of active_write_xy.
 c     o Adjoint of active_read_tile_xy.  
 c  
413  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  
414  c     ==================================================================  c     ==================================================================
415    C     \ev
416    
417    C     !USES:
418        implicit none        implicit none
419    
420  c     == global variables ==  c     == global variables ==
   
421  #include "EEPARAMS.h"  #include "EEPARAMS.h"
422  #include "SIZE.h"  #include "SIZE.h"
423    
424  c     == routine arguments ==  c     == routine arguments ==
425    c     active_var_file: filename
426    c     adactive_var:    array
427    c     irec:            record number
428    c     myIter:          number of optimization iteration (default: 0)
429    c     mythid:          thread number for this instance
430        character*(*) active_var_file        character*(*) active_var_file
431        _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)
432        integer irec        integer irec
433        integer myOptimIter        integer myiter,mythid
434        integer mythid        _RL     dummy
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
435    
436    C     !LOCAL VARIABLES:
437  c     == local variables ==  c     == local variables ==
   
438        integer mynr        integer mynr
439        integer il        integer il
440        integer ilnblnk        integer ilnblnk
441        character*(2) adpref        character*(2) adpref
442        character*(80) fname        character*(80) fname
443          logical globalfile
444    
445  c     == functions ==  c     == functions ==
   
446        external ilnblnk        external ilnblnk
447    
448  c     == end of interface ==  c     == end of interface ==
449    CEOP
450    
451        mynr   = 1        mynr   = 1
452        adpref = 'ad'        adpref = 'ad'
# Line 415  c     == end of interface == Line 454  c     == end of interface ==
454    
455        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
456    
457        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
458        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
459    
460        call active_read_tile_rl(        globalfile = .false.
461       I                          fname,  
462       U                          adactive_var,        call active_write_rl( fname, adactive_var,
463       I                          doglobalread,       &                      globalfile, irec, mynr,
464       I                          lAdInit,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                          irec,  
      I                          mynr,  
      I                          bi,  
      I                          bj,  
      I                          REVERSE_SIMULATION,  
      I                          myOptimIter,  
      I                          mythid  
      &                        )  
465    
466        end        end
467    
468    CBOP
469    C     !ROUTINE: adactive_read_xyz
470    C     !INTERFACE:
471    #ifdef AUTODIFF_TAMC_COMPATIBILITY
472          subroutine adactive_write_xyz(
473         I                               active_var_file,
474         I                               irec,
475         I                               myiter,
476         I                               mythid,
477         U                               adactive_var,
478         I                               dummy
479         &                             )
480    #else
481          subroutine adactive_write_xyz(
482         I                               active_var_file,
483         U                               adactive_var,
484         I                               irec,
485         I                               myiter,
486         I                               mythid,
487         I                               dummy
488         &                             )
489    #endif
490    
       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  
      &                                 )  
491    
492    C     !DESCRIPTION: \bv
493  c     ==================================================================  c     ==================================================================
494  c     SUBROUTINE adactive_read_tile_xyz  c     SUBROUTINE adactive_write_xyz
495  c     ==================================================================  c     ==================================================================
496  c  c     o Adjoint of active_write_xyz.
 c     o Adjoint of active_read_tile_xyz.  
 c  
497  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  
498  c     ==================================================================  c     ==================================================================
499    C     \ev
500    
501    C     !USES:
502        implicit none        implicit none
503    
504  c     == global variables ==  c     == global variables ==
   
505  #include "EEPARAMS.h"  #include "EEPARAMS.h"
506  #include "SIZE.h"  #include "SIZE.h"
507    
508  c     == routine arguments ==  c     == routine arguments ==
509    c     active_var_file: filename
510    c     adactive_var:    array
511    c     irec:            record number
512    c     myIter:          number of optimization iteration (default: 0)
513    c     mythid:          thread number for this instance
514        character*(*) active_var_file        character*(*) active_var_file
515        _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)
516        integer irec        integer irec
517        integer myOptimIter        integer myiter,mythid
518        integer mythid        _RL dummy
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
519    
520    C     !LOCAL VARIABLES:
521  c     == local variables ==  c     == local variables ==
   
522        integer mynr        integer mynr
523        integer il        integer il
524        integer ilnblnk        integer ilnblnk
525        character*(2) adpref        character*(2) adpref
526        character*(80) fname        character*(80) fname
527          logical globalfile
528    
529  c     == functions ==  c     == functions ==
   
530        external ilnblnk        external ilnblnk
531    
532  c     == end of interface ==  c     == end of interface ==
533    CEOP
534    
535        mynr   = nr        mynr   = nr
536        adpref = 'ad'        adpref = 'ad'
# Line 513  c     == end of interface == Line 538  c     == end of interface ==
538    
539        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
540    
541        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
542        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
543    
544        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  
545    
546          call active_write_rl( fname, adactive_var,
547         &                      globalfile, irec, mynr,
548         &                      REVERSE_SIMULATION, myiter, mythid )
549    
550        subroutine adactive_write_tile_xy(        end
      I                                   active_var_file,  
      I                                   irec,  
      I                                   bi,  
      I                                   bj,  
      I                                   myOptimIter,  
      I                                   mythid,  
      U                                   adactive_var  
      &                                 )  
551    
552    CBOP
553    C     !ROUTINE: adactive_read_xz
554    C     !INTERFACE:
555    #ifdef AUTODIFF_TAMC_COMPATIBILITY
556          subroutine adactive_write_xz(
557         I                               active_var_file,
558         I                               irec,
559         I                               myiter,
560         I                               mythid,
561         U                               adactive_var,
562         I                               dummy
563         &                             )
564    #else
565          subroutine adactive_write_xz(
566         I                               active_var_file,
567         U                               adactive_var,
568         I                               irec,
569         I                               myiter,
570         I                               mythid,
571         I                               dummy
572         &                             )
573    #endif
574    
575    C     !DESCRIPTION: \bv
576  c     ==================================================================  c     ==================================================================
577  c     SUBROUTINE adactive_write_tile_xy  c     SUBROUTINE adactive_write_xz
578  c     ==================================================================  c     ==================================================================
579  c  c     o Adjoint of active_write_xz.
580  c     o Adjoint of active_write_tile_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  
 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_write_tile_xy  
581  c     ==================================================================  c     ==================================================================
582    C     \ev
583    
584    C     !USES:
585        implicit none        implicit none
586    
587  c     == global variables ==  c     == global variables ==
   
588  #include "EEPARAMS.h"  #include "EEPARAMS.h"
589  #include "SIZE.h"  #include "SIZE.h"
590    
591  c     == routine arguments ==  c     == routine arguments ==
592    c     active_var_file: filename
593    c     adactive_var:    array
594    c     irec:            record number
595    c     myIter:          number of optimization iteration (default: 0)
596    c     mythid:          thread number for this instance
597        character*(*) active_var_file        character*(*) active_var_file
598        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)        _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
599        integer irec        integer irec
600        integer bi        integer myiter,mythid
601        integer bj        _RL dummy
       integer myOptimIter  
       integer mythid  
602    
603    C     !LOCAL VARIABLES:
604  c     == local variables ==  c     == local variables ==
   
605        integer mynr        integer mynr
606        integer il        integer il
607        integer ilnblnk        integer ilnblnk
# Line 598  c     == local variables == Line 610  c     == local variables ==
610        logical globalfile        logical globalfile
611    
612  c     == functions ==  c     == functions ==
   
613        external ilnblnk        external ilnblnk
614    
615  c     == end of interface ==  c     == end of interface ==
616    CEOP
617    
618        mynr   = 1        mynr   = nr
619        adpref = 'ad'        adpref = 'ad'
620        write(fname(1:80),'(a)') ' '        write(fname(1:80),'(a)') ' '
621    
622        il     = ilnblnk(active_var_file)        il     = ilnblnk(active_var_file)
623    
624        write(fname(1:2),   '(a)') adpref        write(fname(1:2),'(a)') adpref
625        write(fname(3:2+il),'(a)') active_var_file(1:il)        write(fname(3:2+il),'(a)') active_var_file(1:il)
626    
627        globalfile = .false.        globalfile = .false.
628    
629        call active_write_tile_rl(        call active_write_xz_rl( fname, adactive_var,
630       I                           fname,       &                      globalfile, irec, mynr,
631       U                           adactive_var,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
632    
633        end        end
634    
635    CBOP
636        subroutine adactive_write_tile_xyz(  C     !ROUTINE: adactive_read_yz
637       I                                    active_var_file,  C     !INTERFACE:
638       I                                    irec,  #ifdef AUTODIFF_TAMC_COMPATIBILITY
639       I                                    bi,        subroutine adactive_write_yz(
640       I                                    bj,       I                               active_var_file,
641       I                                    myOptimIter,       I                               irec,
642       I                                    mythid,       I                               myiter,
643       U                                    adactive_var       I                               mythid,
644       &                                  )       U                               adactive_var,
645         I                               dummy
646         &                             )
647    #else
648          subroutine adactive_write_yz(
649         I                               active_var_file,
650         U                               adactive_var,
651         I                               irec,
652         I                               myiter,
653         I                               mythid,
654         I                               dummy
655         &                             )
656    #endif
657    
658    
659    C     !DESCRIPTION: \bv
660  c     ==================================================================  c     ==================================================================
661  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  
662  c     ==================================================================  c     ==================================================================
663  c     SUBROUTINE adactive_write_tile_xyz  c     o Adjoint of active_write_yz.
664    c     started: heimbach@mit.edu 05-Mar-2001
665  c     ==================================================================  c     ==================================================================
666    C     \ev
667    
668    C     !USES:
669        implicit none        implicit none
670    
671  c     == global variables ==  c     == global variables ==
   
672  #include "EEPARAMS.h"  #include "EEPARAMS.h"
673  #include "SIZE.h"  #include "SIZE.h"
674    
675  c     == routine arguments ==  c     == routine arguments ==
676    c     active_var_file: filename
677    c     adactive_var:    array
678    c     irec:            record number
679    c     myIter:          number of optimization iteration (default: 0)
680    c     mythid:          thread number for this instance
681        character*(*) active_var_file        character*(*) active_var_file
682        _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
683        integer irec        integer irec
684        integer bi        integer myiter,mythid
685        integer bj        _RL dummy
       integer myOptimIter  
       integer mythid  
686    
687    C     !LOCAL VARIABLES:
688  c     == local variables ==  c     == local variables ==
   
689        integer mynr        integer mynr
690        integer il        integer il
691        integer ilnblnk        integer ilnblnk
# Line 695  c     == local variables == Line 694  c     == local variables ==
694        logical globalfile        logical globalfile
695    
696  c     == functions ==  c     == functions ==
   
697        external ilnblnk        external ilnblnk
698    
699  c     == end of interface ==  c     == end of interface ==
700    CEOP
701    
702        mynr   = nr        mynr   = nr
703        adpref = 'ad'        adpref = 'ad'
# Line 711  c     == end of interface == Line 710  c     == end of interface ==
710    
711        globalfile = .false.        globalfile = .false.
712    
713        call active_write_tile_rl(        call active_write_yz_rl( fname, adactive_var,
714       I                           fname,       &                      globalfile, irec, mynr,
715       U                           adactive_var,       &                      REVERSE_SIMULATION, myiter, mythid )
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
716    
717        end        end
718    
719    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22