Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:45:03 UTC

view on githubraw file Latest commit 7fd2fa3b on 2016-08-20 03:10:02 UTC
7fd2fa3bc2 Patr*0001       subroutine template()
                0002       use OAD_rev
                0003 
                0004 !$TEMPLATE_PRAGMA_DECLARATIONS
                0005 
                0006       type(modeType) :: our_orig_mode
                0007 
                0008 c lovcal vars:
                0009 
                0010 #ifdef OAD_DEBUG_SPLIT2
                0011 
                0012       character*(80):: indentation='                                        
                0013      +                                         '
                0014       our_indent=our_indent+1
                0015 
                0016       write(standardmessageunit, '(A,A,A)', ADVANCE='NO') 
                0017      +'OAD:',indentation(1:our_indent), 'enter __SRNAME__:'
                0018       call oad_dump_revmod(); call oad_dump_tapestats()
                0019       write(standardmessageunit,*) 
                0020 #endif
                0021 
                0022       if (our_rev_mode%plain .OR. our_rev_mode%tape) then
                0023 #ifdef OAD_DEBUG_SPLIT2
                0024          write(standardmessageunit,'(A,A,A)') 
                0025      +'OAD:',indentation(1:our_indent), 
                0026      +' __SRNAME__: entering plain or tape'
                0027 #endif
                0028 c set up for plain execution
                0029          our_orig_mode=our_rev_mode
                0030          our_rev_mode%arg_store=.FALSE.
                0031          our_rev_mode%arg_restore=.FALSE.
                0032          our_rev_mode%plain=.TRUE.
                0033          our_rev_mode%tape=.FALSE.
                0034          our_rev_mode%adjoint=.FALSE.
                0035          call dummy_in_stepping( myTime, myIter, myThid )
                0036 c reset the mode
                0037          our_rev_mode=our_orig_mode
                0038 c copy back
                0039       end if
                0040       if (our_rev_mode%adjoint) then
                0041 #ifdef OAD_DEBUG_SPLIT2
                0042          write(standardmessageunit,'(A,A,A)') 
                0043      +'OAD:',indentation(1:our_indent), 
                0044      +' __SRNAME__: entering adjoint'
                0045 #endif
                0046 c set up for plain execution
                0047          our_orig_mode=our_rev_mode
                0048          our_rev_mode%arg_store=.FALSE.
                0049          our_rev_mode%arg_restore=.FALSE.
                0050          our_rev_mode%plain=.TRUE.
                0051          our_rev_mode%tape=.FALSE.
                0052          our_rev_mode%adjoint=.FALSE.
                0053          call addummy_in_stepping(myTime, myIter, myThid)
                0054 c reset the mode
                0055          our_rev_mode=our_orig_mode
                0056 c copy back
                0057       end if
                0058 
                0059 #ifdef OAD_DEBUG_SPLIT2
                0060       write(standardmessageunit,'(A,A,A)', ADVANCE='NO') 
                0061      +'OAD:',indentation(1:our_indent), 'leave __SRNAME__:'
                0062       call oad_dump_revmod(); call oad_dump_tapestats()
                0063       write(standardmessageunit,*) 
                0064 
                0065       our_indent=our_indent-1
                0066 #endif
                0067 
                0068       end subroutine template