Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit 73606979 on 2016-11-29 12:37:52 UTC
736069790d Dani*0001 #include "STREAMICE_OPTIONS.h"
                0002 
                0003       SUBROUTINE template()
                0004       use OAD_cp
                0005       use OAD_tape
                0006       use OAD_rev
                0007 
                0008 
                0009 !      integer :: cp_loop_variable_1,cp_loop_variable_2, cp_loop_variable
                0010 !     +_3,cp_loop_variable_4
                0011 
                0012 
                0013       if (our_rev_mode%plain) then
                0014       CALL OpenAD_exch_xy_rl (X, mythid)
                0015       end if
                0016       if (our_rev_mode%tape .and..not.our_rev_mode%strictAnonymous) then
                0017       CALL OpenAD_exch_xy_rl (X, mythid)
                0018       end if
                0019       if (our_rev_mode%tape .and. our_rev_mode%strictAnonymous) then
                0020       CALL OpenAD_exch_xy_rl (X, mythid)
                0021       end if
                0022       if (our_rev_mode%adjoint) then
                0023 
                0024       CALL OpenAD_exch_xy_rl (X, mythid)
                0025 
                0026       
                0027 
                0028       DO bj = myByLo(myThid), myByHi(myThid)
                0029        DO bi = myBxLo(myThid), myBxHi(myThid)
                0030         DO j=0,sNy+1
                0031          DO i=1,sNx
                0032           q_int1(i,j,bi,bj) = .25 * X(i-1,j,bi,bj)%d + 
                0033      &                        .50 * X(i,j,bi,bj)%d +
                0034      &                        .25 * X(i+1,j,bi,bj)%d
                0035          ENDDO
                0036         ENDDO
                0037        ENDDO
                0038       ENDDO
                0039 
                0040       DO bj = myByLo(myThid), myByHi(myThid)
                0041        DO bi = myBxLo(myThid), myBxHi(myThid)
                0042         DO j=1,sNy
                0043          DO i=1,sNx
                0044           q_int2(i,j,bi,bj) = .25 * q_int1(i,j+1,bi,bj) +  
                0045      &                        .50 * q_int1(i,j,bi,bj) +
                0046      &                        .25 * q_int1(i,j+1,bi,bj)
                0047          ENDDO
                0048         ENDDO
                0049        ENDDO
                0050       ENDDO
                0051 
                0052       CALL EXCH_XY_RL (q_int2, mythid)
                0053 
                0054       DO bj = myByLo(myThid), myByHi(myThid)
                0055        DO bi = myBxLo(myThid), myBxHi(myThid)
                0056         DO j=1,sNy
                0057          DO i=1,sNx
                0058           X(i,j,bi,bj)%d = .25 * q_int2(i,j+1,bi,bj) +  
                0059      &                        .50 * q_int2(i,j,bi,bj) +
                0060      &                        .25 * q_int2(i,j+1,bi,bj)
                0061          ENDDO
                0062         ENDDO
                0063        ENDDO
                0064       ENDDO
                0065 
                0066       
                0067       end if
                0068       end subroutine template