1 |
#include "STREAMICE_OPTIONS.h" |
2 |
|
3 |
SUBROUTINE template() |
4 |
use OAD_cp |
5 |
use OAD_tape |
6 |
use OAD_rev |
7 |
|
8 |
|
9 |
! integer :: cp_loop_variable_1,cp_loop_variable_2, cp_loop_variable |
10 |
! +_3,cp_loop_variable_4 |
11 |
|
12 |
|
13 |
if (our_rev_mode%plain) then |
14 |
CALL OpenAD_exch_xy_rl (X, mythid) |
15 |
end if |
16 |
if (our_rev_mode%tape .and..not.our_rev_mode%strictAnonymous) then |
17 |
CALL OpenAD_exch_xy_rl (X, mythid) |
18 |
end if |
19 |
if (our_rev_mode%tape .and. our_rev_mode%strictAnonymous) then |
20 |
CALL OpenAD_exch_xy_rl (X, mythid) |
21 |
end if |
22 |
if (our_rev_mode%adjoint) then |
23 |
|
24 |
CALL OpenAD_exch_xy_rl (X, mythid) |
25 |
|
26 |
|
27 |
|
28 |
DO bj = myByLo(myThid), myByHi(myThid) |
29 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
30 |
DO j=0,sNy+1 |
31 |
DO i=1,sNx |
32 |
q_int1(i,j,bi,bj) = .25 * X(i-1,j,bi,bj)%d + |
33 |
& .50 * X(i,j,bi,bj)%d + |
34 |
& .25 * X(i+1,j,bi,bj)%d |
35 |
ENDDO |
36 |
ENDDO |
37 |
ENDDO |
38 |
ENDDO |
39 |
|
40 |
DO bj = myByLo(myThid), myByHi(myThid) |
41 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
42 |
DO j=1,sNy |
43 |
DO i=1,sNx |
44 |
q_int2(i,j,bi,bj) = .25 * q_int1(i,j+1,bi,bj) + |
45 |
& .50 * q_int1(i,j,bi,bj) + |
46 |
& .25 * q_int1(i,j+1,bi,bj) |
47 |
ENDDO |
48 |
ENDDO |
49 |
ENDDO |
50 |
ENDDO |
51 |
|
52 |
CALL EXCH_XY_RL (q_int2, mythid) |
53 |
|
54 |
DO bj = myByLo(myThid), myByHi(myThid) |
55 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
56 |
DO j=1,sNy |
57 |
DO i=1,sNx |
58 |
X(i,j,bi,bj)%d = .25 * q_int2(i,j+1,bi,bj) + |
59 |
& .50 * q_int2(i,j,bi,bj) + |
60 |
& .25 * q_int2(i,j+1,bi,bj) |
61 |
ENDDO |
62 |
ENDDO |
63 |
ENDDO |
64 |
ENDDO |
65 |
|
66 |
|
67 |
end if |
68 |
end subroutine template |