/[MITgcm]/MITgcm/tools/OAD_support/ad_template.active_read_xy.F
ViewVC logotype

Diff of /MITgcm/tools/OAD_support/ad_template.active_read_xy.F

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

revision 1.2 by heimbach, Sat Dec 27 20:37:57 2014 UTC revision 1.5 by dgoldberg, Sun Apr 5 07:06:45 2015 UTC
# Line 32  C     !FUNCTIONS Line 32  C     !FUNCTIONS
32        INTEGER  ILNBLNK        INTEGER  ILNBLNK
33        EXTERNAL ILNBLNK        EXTERNAL ILNBLNK
34    
35  #ifdef ALLOW_OPENAD_ACTIVE_FILE  #ifdef ALLOW_OPENAD_ACTIVE_READ_XY
36    
37        myNr = 1        myNr = 1
38        useCurrentDir = .FALSE.        useCurrentDir = .FALSE.
# Line 42  C     !FUNCTIONS Line 42  C     !FUNCTIONS
42  ! original function  ! original function
43           active_var_p = active_var%v           active_var_p = active_var%v
44  ! set up for plain execution  ! set up for plain execution
          our_orig_mode=our_rev_mode  
45           our_rev_mode%arg_store=.FALSE.           our_rev_mode%arg_store=.FALSE.
46           our_rev_mode%arg_restore=.FALSE.           our_rev_mode%arg_restore=.FALSE.
47           our_rev_mode%plain=.TRUE.           our_rev_mode%plain=.TRUE.
# Line 61  C     !FUNCTIONS Line 60  C     !FUNCTIONS
60        if (our_rev_mode%tape) then        if (our_rev_mode%tape) then
61  ! taping  ! taping
62           our_orig_mode=our_rev_mode           our_orig_mode=our_rev_mode
63    ! original function
64             active_var_p = active_var%v
65           our_rev_mode%arg_store=.FALSE.           our_rev_mode%arg_store=.FALSE.
66           our_rev_mode%arg_restore=.FALSE.           our_rev_mode%arg_restore=.FALSE.
67           our_rev_mode%plain=.TRUE.           our_rev_mode%plain=.TRUE.
68           our_rev_mode%tape=.FALSE.           our_rev_mode%tape=.FALSE.
69           our_rev_mode%adjoint=.FALSE.           our_rev_mode%adjoint=.FALSE.
70             if (oad_st_sz.lt.oad_st_ptr) call oad_st_grow()
71             oad_st(oad_st_ptr) = active_var_file
72             oad_st_ptr = oad_st_ptr+1
73             if (oad_it_sz.lt.oad_it_ptr) call oad_it_grow()
74             oad_it(oad_it_ptr) = iRec
75             oad_it_ptr = oad_it_ptr+1
76           call ACTIVE_READ_3D_RL(           call ACTIVE_READ_3D_RL(
77       &        active_var_file, active_var, doglobalread,       &        active_var_file, active_var_p, doglobalread,
78       &        useCurrentDir, lAdInit, iRec, myNr,       &        useCurrentDir, lAdInit, iRec, myNr,
79       &        FORWARD_SIMULATION, myOptimIter, myThid )       &        FORWARD_SIMULATION, myOptimIter, myThid )
80             our_rev_mode=our_orig_mode
81    ! copy back
82             active_var%v = active_var_p
83        end if        end if
84    
85        if (our_rev_mode%adjoint) then        if (our_rev_mode%adjoint) then
86  ! adjoint  ! adjoint
87             oad_st_ptr = oad_st_ptr-1
88             active_var_file = oad_st(oad_st_ptr)
89             oad_it_ptr = oad_it_ptr-1
90             iRec = oad_it(oad_it_ptr)
91           adpref = 'ad'           adpref = 'ad'
92           il   = ILNBLNK( active_var_file )           il   = ILNBLNK( active_var_file )
93           WRITE(fname(1:80),'(A)') ' '           WRITE(fname(1:80),'(A)') ' '
94  !         WRITE(fname(1:2+il),'(2A)') adpref, active_var_file(1:il)           WRITE(fname(1:2+il),'(2A)') adpref, active_var_file(1:il)
95           WRITE(fname(1:2+il),'(2A)') adpref, active_var_file  !         WRITE(fname(1:2+il),'(2A)') adpref, active_var_file
96           active_var_p = active_var%d           active_var_p = active_var%d
97  ! set up for plain execution  ! set up for plain execution
98           our_orig_mode=our_rev_mode           our_orig_mode=our_rev_mode
# Line 97  C     !FUNCTIONS Line 111  C     !FUNCTIONS
111           active_var%d = active_var_p           active_var%d = active_var_p
112        end if        end if
113    
114  #endif /* ALLOW_OPENAD_ACTIVE_FILE */  #endif /* ALLOW_OPENAD_ACTIVE_READ_XY */
115    
116        end        end

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

  ViewVC Help
Powered by ViewVC 1.1.22