/[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.7 by jmc, Mon Oct 8 23:50:52 2007 UTC revision 1.9 by jmc, Sat Aug 2 23:16:58 2008 UTC
# Line 21  c     o  adactive_read_yz         - Adjo Line 21  c     o  adactive_read_yz         - Adjo
21  c     o  adactive_write_xz        - Adjoint of active_write_xz  c     o  adactive_write_xz        - Adjoint of active_write_xz
22  c     o  adactive_write_yz        - Adjoint of active_write_yz  c     o  adactive_write_yz        - Adjoint of active_write_yz
23  c  c
 c     o  adactive_read_tile_xy    - Adjoint of active_read_tile_xy  
 c     o  adactive_read_tile_xyz   - Adjoint of active_read_tile_xyz  
 c     o  adactive_write_tile_xy   - Adjoint of active_write_tile_xy  
 c     o  adactive_write_tile_xyz  - Adjoint of active_write_tile_xyz  
 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.
# Line 40  c     ================================== Line 35  c     ==================================
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 49  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 57  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 118  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 127  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 135  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 195  CEOP Line 210  CEOP
210  CBOP  CBOP
211  C     !ROUTINE: adactive_read_xz  C     !ROUTINE: adactive_read_xz
212  C     !INTERFACE:  C     !INTERFACE:
213    #ifdef AUTODIFF_TAMC_COMPATIBILITY
214        subroutine adactive_read_xz(        subroutine adactive_read_xz(
215       I                              active_var_file,       I                              active_var_file,
216       I                              irec,       I                              irec,
# Line 204  C     !INTERFACE: Line 220  C     !INTERFACE:
220       I                              mythid,       I                              mythid,
221       I                              adactive_var       I                              adactive_var
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     ==================================================================
# Line 212  c     ================================== Line 239  c     ==================================
239  c     o Adjoint of active_read_xz.  c     o Adjoint of active_read_xz.
240  c     started: heimbach@mit.edu 05-Mar-2001  c     started: heimbach@mit.edu 05-Mar-2001
241  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_read_xz  
 c     ==================================================================  
242  C     \ev  C     \ev
243    
244  C     !USES:  C     !USES:
# Line 272  CEOP Line 297  CEOP
297  CBOP  CBOP
298  C     !ROUTINE: adactive_read_yz  C     !ROUTINE: adactive_read_yz
299  C     !INTERFACE:  C     !INTERFACE:
300    #ifdef AUTODIFF_TAMC_COMPATIBILITY
301        subroutine adactive_read_yz(        subroutine adactive_read_yz(
302       I                              active_var_file,       I                              active_var_file,
303       I                              irec,       I                              irec,
# Line 281  C     !INTERFACE: Line 307  C     !INTERFACE:
307       I                              mythid,       I                              mythid,
308       I                              adactive_var       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     ==================================================================
# Line 289  c     ================================== Line 326  c     ==================================
326  c     o Adjoint of active_read_yz.  c     o Adjoint of active_read_yz.
327  c     started: heimbach@mit.edu 05-Mar-2001  c     started: heimbach@mit.edu 05-Mar-2001
328  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_read_yz  
 c     ==================================================================  
329  C     \ev  C     \ev
330    
331  C     !USES:  C     !USES:
# Line 349  CEOP Line 384  CEOP
384  CBOP  CBOP
385  C     !ROUTINE: adactive_read_xy  C     !ROUTINE: adactive_read_xy
386  C     !INTERFACE:  C     !INTERFACE:
387    #ifdef AUTODIFF_TAMC_COMPATIBILITY
388        subroutine adactive_write_xy(        subroutine adactive_write_xy(
389       I                              active_var_file,       I                              active_var_file,
390       I                              irec,       I                              irec,
# Line 357  C     !INTERFACE: Line 393  C     !INTERFACE:
393       U                              adactive_var,       U                              adactive_var,
394       I                              dummy       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  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
# Line 366  c     ================================== Line 412  c     ==================================
412  c     o Adjoint of active_write_xy.  c     o Adjoint of active_write_xy.
413  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
414  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_write_xy  
 c     ==================================================================  
415  C     \ev  C     \ev
416    
417  C     !USES:  C     !USES:
# Line 424  CEOP Line 468  CEOP
468  CBOP  CBOP
469  C     !ROUTINE: adactive_read_xyz  C     !ROUTINE: adactive_read_xyz
470  C     !INTERFACE:  C     !INTERFACE:
471    #ifdef AUTODIFF_TAMC_COMPATIBILITY
472        subroutine adactive_write_xyz(        subroutine adactive_write_xyz(
473       I                               active_var_file,       I                               active_var_file,
474       I                               irec,       I                               irec,
# Line 432  C     !INTERFACE: Line 477  C     !INTERFACE:
477       U                               adactive_var,       U                               adactive_var,
478       I                               dummy       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    
491    
492  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
# Line 441  c     ================================== Line 496  c     ==================================
496  c     o Adjoint of active_write_xyz.  c     o Adjoint of active_write_xyz.
497  c     started: Christian Eckert eckert@mit.edu 24-May-1999  c     started: Christian Eckert eckert@mit.edu 24-May-1999
498  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_write_xyz  
 c     ==================================================================  
499  C     \ev  C     \ev
500    
501  C     !USES:  C     !USES:
# Line 499  CEOP Line 552  CEOP
552  CBOP  CBOP
553  C     !ROUTINE: adactive_read_xz  C     !ROUTINE: adactive_read_xz
554  C     !INTERFACE:  C     !INTERFACE:
555    #ifdef AUTODIFF_TAMC_COMPATIBILITY
556        subroutine adactive_write_xz(        subroutine adactive_write_xz(
557       I                               active_var_file,       I                               active_var_file,
558       I                               irec,       I                               irec,
# Line 507  C     !INTERFACE: Line 561  C     !INTERFACE:
561       U                               adactive_var,       U                               adactive_var,
562       I                               dummy       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  C     !DESCRIPTION: \bv
576  c     ==================================================================  c     ==================================================================
# Line 516  c     ================================== Line 579  c     ==================================
579  c     o Adjoint of active_write_xz.  c     o Adjoint of active_write_xz.
580  c     started: heimbach@mit.edu 05-Mar-2001  c     started: heimbach@mit.edu 05-Mar-2001
581  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_write_xz  
 c     ==================================================================  
582  C     \ev  C     \ev
583    
584  C     !USES:  C     !USES:
# Line 574  CEOP Line 635  CEOP
635  CBOP  CBOP
636  C     !ROUTINE: adactive_read_yz  C     !ROUTINE: adactive_read_yz
637  C     !INTERFACE:  C     !INTERFACE:
638    #ifdef AUTODIFF_TAMC_COMPATIBILITY
639        subroutine adactive_write_yz(        subroutine adactive_write_yz(
640       I                               active_var_file,       I                               active_var_file,
641       I                               irec,       I                               irec,
# Line 582  C     !INTERFACE: Line 644  C     !INTERFACE:
644       U                               adactive_var,       U                               adactive_var,
645       I                               dummy       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  C     !DESCRIPTION: \bv
# Line 591  c     ================================== Line 663  c     ==================================
663  c     o Adjoint of active_write_yz.  c     o Adjoint of active_write_yz.
664  c     started: heimbach@mit.edu 05-Mar-2001  c     started: heimbach@mit.edu 05-Mar-2001
665  c     ==================================================================  c     ==================================================================
 c     SUBROUTINE adactive_write_yz  
 c     ==================================================================  
666  C     \ev  C     \ev
667    
668  C     !USES:  C     !USES:
# Line 647  CEOP Line 717  CEOP
717        end        end
718    
719    
   
       subroutine adactive_read_tile_xy(  
      I                                  active_var_file,  
      I                                  irec,  
      I                                  doglobalread,  
      I                                  bi,  
      I                                  bj,  
      I                                  lAdInit,  
      I                                  myOptimIter,  
      I                                  mythid,  
      U                                  adactive_var  
      &                                )  
   
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xy  
 c     ==================================================================  
 c  
 c     o Adjoint of active_read_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  
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xy  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)  
       integer irec  
       integer myOptimIter  
       integer mythid  
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
   
 c     == local variables ==  
   
       integer mynr  
       integer il  
       integer ilnblnk  
       character*(2) adpref  
       character*(80) fname  
   
 c     == functions ==  
   
       external ilnblnk  
   
 c     == end of interface ==  
   
       mynr   = 1  
       adpref = 'ad'  
       write(fname(1:80),'(a)') ' '  
   
       il     = ilnblnk(active_var_file)  
   
       write(fname(1:2),   '(a)') adpref  
       write(fname(3:2+il),'(a)') active_var_file(1:il)  
   
       call active_read_tile_rl(  
      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  
   
   
       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  
      &                                 )  
   
 c     ==================================================================  
 c     SUBROUTINE adactive_read_tile_xyz  
 c     ==================================================================  
 c  
 c     o Adjoint of active_read_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  
 c     ==================================================================  
 c     SUBROUTINE adactive_read_tile_xyz  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)  
       integer irec  
       integer myOptimIter  
       integer mythid  
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
   
 c     == local variables ==  
   
       integer mynr  
       integer il  
       integer ilnblnk  
       character*(2) adpref  
       character*(80) fname  
   
 c     == functions ==  
   
       external ilnblnk  
   
 c     == end of interface ==  
   
       mynr   = nr  
       adpref = 'ad'  
       write(fname(1:80),'(a)') ' '  
   
       il     = ilnblnk(active_var_file)  
   
       write(fname(1:2),   '(a)') adpref  
       write(fname(3:2+il),'(a)') active_var_file(1:il)  
   
       call active_read_tile_rl(  
      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  
   
   
       subroutine adactive_write_tile_xy(  
      I                                   active_var_file,  
      I                                   irec,  
      I                                   bi,  
      I                                   bj,  
      I                                   myOptimIter,  
      I                                   mythid,  
      U                                   adactive_var  
      &                                 )  
   
   
 c     ==================================================================  
 c     SUBROUTINE adactive_write_tile_xy  
 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  
 c     ==================================================================  
 c     SUBROUTINE adactive_write_tile_xy  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)  
       integer irec  
       integer bi  
       integer bj  
       integer myOptimIter  
       integer mythid  
   
 c     == local variables ==  
   
       integer mynr  
       integer il  
       integer ilnblnk  
       character*(2) adpref  
       character*(80) fname  
       logical globalfile  
   
 c     == functions ==  
   
       external ilnblnk  
   
 c     == end of interface ==  
   
       mynr   = 1  
       adpref = 'ad'  
       write(fname(1:80),'(a)') ' '  
   
       il     = ilnblnk(active_var_file)  
   
       write(fname(1:2),   '(a)') adpref  
       write(fname(3:2+il),'(a)') active_var_file(1:il)  
   
       globalfile = .false.  
   
       call active_write_tile_rl(  
      I                           fname,  
      U                           adactive_var,  
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
   
       end  
   
   
       subroutine adactive_write_tile_xyz(  
      I                                    active_var_file,  
      I                                    irec,  
      I                                    bi,  
      I                                    bj,  
      I                                    myOptimIter,  
      I                                    mythid,  
      U                                    adactive_var  
      &                                  )  
   
   
 c     ==================================================================  
 c     SUBROUTINE adactive_write_tile_xyz  
 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  
 c     ==================================================================  
 c     SUBROUTINE adactive_write_tile_xyz  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)  
       integer irec  
       integer bi  
       integer bj  
       integer myOptimIter  
       integer mythid  
   
 c     == local variables ==  
   
       integer mynr  
       integer il  
       integer ilnblnk  
       character*(2) adpref  
       character*(80) fname  
       logical globalfile  
   
 c     == functions ==  
   
       external ilnblnk  
   
 c     == end of interface ==  
   
       mynr   = nr  
       adpref = 'ad'  
       write(fname(1:80),'(a)') ' '  
   
       il     = ilnblnk(active_var_file)  
   
       write(fname(1:2),'(a)') adpref  
       write(fname(3:2+il),'(a)') active_var_file(1:il)  
   
       globalfile = .false.  
   
       call active_write_tile_rl(  
      I                           fname,  
      U                           adactive_var,  
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           REVERSE_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
   
       end  

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

  ViewVC Help
Powered by ViewVC 1.1.22