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

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

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

revision 1.1 by heimbach, Thu Sep 20 23:12:47 2012 UTC revision 1.2 by utke, Thu Dec 19 23:38:20 2013 UTC
# Line 13  Line 13 
13        integer iaddr        integer iaddr
14        external iaddr        external iaddr
15    
16        INTEGER numItersHelper        INTEGER numItersHelper, myThidHelper, nIterMinHelper
       INTEGER myThidHelper  
17    
18        Real*8  cg2d_b_p(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        Real*8  cg2d_b_p(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
19        Real*8  cg2d_x_p(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        Real*8  cg2d_x_p(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
# Line 66  c reset the mode Line 65  c reset the mode
65    
66           numItersHelper=numiters           numItersHelper=numiters
67           mythidHelper=mythid           mythidHelper=mythid
68             nIterMinHelper=nIterMin
69  #ifdef OAD_DEBUG_JOINT  #ifdef OAD_DEBUG_JOINT
70           write(standardmessageunit,'(A,A,A)')           write(standardmessageunit,'(A,A,A)')
71       +'OAD:',indentation(1:our_indent),       +'OAD:',indentation(1:our_indent),
# Line 97  c set up for plain execution Line 97  c set up for plain execution
97          cg2d_x%v=cg2d_x_p                  cg2d_x%v=cg2d_x_p        
98  c reset the mode  c reset the mode
99           our_rev_mode=our_orig_mode           our_rev_mode=our_orig_mode
100  c manually push two integers to the tape:          c manually push integers to the tape:
101           if(oad_it_sz.lt. oad_it_ptr) call oad_it_grow()           call oad_tape_push(numItersHelper)
102           oad_it(oad_it_ptr)=numItersHelper; oad_it_ptr=oad_it_ptr+1           call oad_tape_push(nIterMinHelper)
103           if(oad_it_sz.lt. oad_it_ptr) call oad_it_grow()           call oad_tape_push(mythidHelper)
          oad_it(oad_it_ptr)=mythidHelper; oad_it_ptr=oad_it_ptr+1  
104        end if        end if
105        if (our_rev_mode%adjoint) then        if (our_rev_mode%adjoint) then
106  #ifdef OAD_DEBUG_JOINT  #ifdef OAD_DEBUG_JOINT
# Line 110  c manually push two integers to the tape Line 109  c manually push two integers to the tape
109       +' __SRNAME__: entering adjoint'       +' __SRNAME__: entering adjoint'
110  #endif  #endif
111  c manually pop two integers from the tape:          c manually pop two integers from the tape:        
112        oad_it_ptr=oad_it_ptr-1           call oad_tape_pop(mythid)
113        mythid=oad_it(oad_it_ptr)           call oad_tape_pop(nIterMin)
114        oad_it_ptr=oad_it_ptr-1           call oad_tape_pop(numiters)
       numiters=oad_it(oad_it_ptr)  
115  c selfadjoint:  c selfadjoint:
116  c the original is called with  c the original is called with
117  c  cg2d(b,x,...)  c  cg2d(b,x,...)

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

  ViewVC Help
Powered by ViewVC 1.1.22