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

Contents of /MITgcm/tools/OAD_support/ad_template.streamice_smooth_adjoint_field.F

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


Revision 1.1 - (show annotations) (download)
Tue Nov 29 12:37:52 2016 UTC (2 years, 7 months ago) by dgoldberg
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, HEAD
new AD templates for streamice_invert_surf_forthick and streamice_smooth_adjoint_field. ad_template.streamice_vel_phistage.F modified to allow for R_low as control

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

  ViewVC Help
Powered by ViewVC 1.1.22