/[MITgcm]/MITgcm/pkg/autodiff/exch_uv_ad.F
ViewVC logotype

Contents of /MITgcm/pkg/autodiff/exch_uv_ad.F

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


Revision 1.1 - (show annotations) (download)
Fri Jul 13 13:33:49 2001 UTC (22 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint57m_post, checkpoint52l_pre, checkpoint44e_post, hrcube4, hrcube5, checkpoint46l_post, checkpoint57g_pre, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint50c_post, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint46f_post, checkpoint52d_pre, checkpoint57g_post, checkpoint48e_post, checkpoint56b_post, checkpoint50g_post, checkpoint57y_post, checkpoint46b_post, checkpoint52j_pre, checkpoint43a-release1mods, checkpoint51o_pre, checkpoint44g_post, checkpoint54d_post, checkpoint48c_post, checkpoint54e_post, ecco_c50_e32, ecco_c50_e33, ecco_c50_e30, ecco_c50_e31, release1_p13, checkpoint40pre3, checkpoint51l_post, checkpoint40pre7, checkpoint40pre6, checkpoint48i_post, checkpoint57r_post, checkpoint40pre9, checkpoint40pre8, checkpoint46l_pre, checkpoint57d_post, checkpoint57i_post, checkpoint50d_pre, checkpoint52k_post, chkpt44d_post, checkpoint59, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint53, checkpoint52, release1_p8, release1_p9, checkpoint50d_post, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint58f_post, checkpoint52f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint50b_pre, checkpoint44e_pre, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, release1_b1, ecco_c51_e34d, ecco_c51_e34e, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, ecco_c51_e34c, checkpoint58y_post, checkpoint48b_post, checkpoint43, checkpoint51d_post, checkpoint48c_pre, checkpoint55a_post, checkpoint51t_post, checkpoint58t_post, c49_autodiff, checkpoint51n_post, release1_chkpt44d_post, checkpoint55i_post, checkpoint57l_post, checkpoint52i_pre, checkpoint57h_post, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint57t_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint53d_post, checkpoint46d_pre, checkpoint40pre2, checkpoint57a_post, checkpoint48d_post, release1-branch_tutorials, checkpoint57h_pre, checkpoint57x_post, checkpoint48f_post, checkpoint45d_post, checkpoint52b_pre, checkpoint54b_post, checkpoint46j_pre, checkpoint58w_post, ecco_c50_e28, checkpoint51l_pre, checkpoint52m_post, checkpoint47d_pre, checkpoint57y_pre, chkpt44a_post, checkpoint55g_post, checkpoint44h_pre, checkpoint48h_post, checkpoint51q_post, checkpoint40pre4, ecco_c50_e29, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint46b_pre, chkpt44c_pre, checkpoint58o_post, checkpoint52h_pre, checkpoint45a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, hrcube_1, checkpoint58p_post, checkpoint58q_post, checkpoint51m_post, checkpoint55d_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, checkpoint58e_post, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint58m_post, checkpoint47a_post, ecco_c50_e33a, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, branchpoint-genmake2, checkpoint54a_post, checkpoint46e_pre, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint45b_post, checkpoint51i_post, checkpoint57e_post, release1-branch-end, release1_final_v1, checkpoint55b_post, checkpoint51b_post, release1_p12_pre, checkpoint46c_pre, checkpoint53a_post, checkpoint44f_post, checkpoint47b_post, checkpoint44b_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59h, ecco_c51_e34, checkpoint46h_pre, checkpoint52d_post, checkpoint53g_post, checkpoint46m_post, checkpoint57p_post, checkpint57u_post, checkpoint46a_pre, checkpoint50c_pre, checkpoint45c_post, checkpoint57q_post, ecco_ice2, ecco_ice1, checkpoint44h_post, eckpoint57e_pre, checkpoint46g_post, checkpoint51c_post, checkpoint58k_post, checkpoint52a_pre, checkpoint46i_post, checkpoint58v_post, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, ecco_c44_e25, checkpoint51i_pre, checkpoint48a_post, checkpoint56a_post, checkpoint58l_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint53b_pre, branch-exfmods-tag, checkpoint40pre5, checkpoint57h_done, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, ecco_c44_e22, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint57j_post, checkpoint57f_pre, checkpoint46c_post, checkpoint58g_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint52n_post, checkpoint46e_post, release1_beta1, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint51e_post, checkpoint44b_pre, checkpoint42, checkpoint57a_pre, checkpoint40, checkpoint41, checkpoint46, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint57o_post, checkpoint46h_post, checkpoint51o_post, checkpoint50, checkpoint57k_post, checkpoint51f_pre, chkpt44c_post, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint57w_post, checkpoint44f_pre, checkpoint58i_post, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, checkpoint58c_post, checkpoint58u_post, release1-branch_branchpoint, checkpoint52f_pre, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_coupled, release1_final, release1-branch, branch-genmake2, release1, branch-nonh, tg2-branch, ecco-branch, release1_50yr, netcdf-sm0, icebear, checkpoint51n_branch
o Modified some flow directives
o Added new flow directives
o Added new adjoint support routines, in particular for
  new exchange routines and new packages debug/, monitor/

1 C /==========================================================\
2 C | SUBROUTINEs adexch_uv_xy_rs adexch_uv_xyz_rs |
3 C | adexch_uv_xy_rl adexch_uv_xyz_rl |
4 C | o adjoint routines to exchange routines |
5 C |==========================================================|
6 C | These routines essentially are calling the original |
7 C | routines in reverse mode. |
8 C | These are regular adjoint routines with no innermost |
9 C | dimension added. |
10 C | Calls to these routines will be generated automatically |
11 C | by TAMC if correct flow directives are given |
12 C | tamc -reverse .... |
13 C | |
14 C | written and tested by Ralf Giering, Jan. 14th 1999 |
15 C | added new S/R's for _xz_ , _yz_ heimbach@mit.edu May-01 |
16 C \==========================================================/
17
18 #include "CPP_EEOPTIONS.h"
19
20 CStartOfInterface
21 SUBROUTINE adexch_uv_xy_rs(
22 I withSigns, myThid,
23 U aduphi, advphi
24 & )
25 C /==========================================================\
26 C | SUBROUTINE ADEXCH_UV_XY_RS adjoint of EXCH_UV_XY_RS |
27 C | o Handle exchanges for real*4, two-dimensional arrays. |
28 C |==========================================================|
29 C === Global data ===
30 implicit none
31 #include "SIZE.h"
32 #include "EEPARAMS.h"
33 #include "EESUPPORT.h"
34
35 C === Routine arguments ===
36 C phi - Array who's overlap regions are to be exchanged
37 C myThid - My thread id.
38 _RS aduphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
39 _RS advphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
40 LOGICAL withSigns
41 INTEGER myThid
42 CEndOfInterface
43 C == Local variables ==
44 C OL[wens] - Overlap extents in west, east, north, south.
45 C exchWidth[XY] - Extent of regions that will be exchanged.
46 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
47 INTEGER mysNx, mysNy, myNz
48
49 OLw = OLx
50 OLe = OLx
51 OLn = OLy
52 OLs = OLy
53 exchWidthX = OLx
54 exchWidthY = OLy
55 mysNx = sNx
56 mysNy = sNy
57 myNz = 1
58 C ** NOTE ** The exchange routine we use here does not
59 C require the preceeding and following barriers.
60 C However, the slow, simple exchange interface
61 C that is calling it here is meant to ensure
62 C that threads are synchronised before exchanges
63 C begine.
64 IF (useCubedSphereExchange) THEN
65 CALL EXCH_UV_RS_CUBE( aduphi, advphi, withSigns,
66 I OLw, OLe, OLs, OLn, myNz,
67 I exchWidthX, exchWidthY,
68 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
69 ELSE
70 CALL EXCH_RS( aduphi,
71 I OLw, OLe, OLs, OLn, myNz,
72 I exchWidthX, exchWidthY,
73 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
74 CALL EXCH_RS( advphi,
75 I OLw, OLe, OLs, OLn, myNz,
76 I exchWidthX, exchWidthY,
77 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
78 c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
79 c _EXCH_XY_RS( aduphi, myThid )
80 c _EXCH_XY_RS( advphi, myThid )
81 ENDIF
82
83 RETURN
84 END
85
86
87 CStartOfInterface
88 SUBROUTINE adexch_uv_xy_rl(
89 I withSigns, myThid,
90 U aduphi, advphi
91 & )
92 C /==========================================================\
93 C | SUBROUTINE ADEXCH_UV_XY_RL adjoint of EXCH_UV_XY_RL |
94 C | o Handle exchanges for real*8, two-dimensional arrays. |
95 C |==========================================================|
96 C === Global data ===
97 #include "SIZE.h"
98 #include "EEPARAMS.h"
99 #include "EESUPPORT.h"
100
101 C === Routine arguments ===
102 C phi - Array who's overlap regions are to be exchanged
103 C myThid - My thread id.
104 _RL aduphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
105 _RL advphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
106 LOGICAL withSigns
107 INTEGER myThid
108 CEndOfInterface
109 C == Local variables ==
110 C OL[wens] - Overlap extents in west, east, north, south.
111 C exchWidth[XY] - Extent of regions that will be exchanged.
112 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
113 INTEGER mysNx, mysNy, myNz
114
115 OLw = OLx
116 OLe = OLx
117 OLn = OLy
118 OLs = OLy
119 exchWidthX = OLx
120 exchWidthY = OLy
121 mysNx = sNx
122 mysNy = sNy
123 myNz = 1
124 C ** NOTE ** The exchange routine we use here does not
125 C require the preceeding and following barriers.
126 C However, the slow, simple exchange interface
127 C that is calling it here is meant to ensure
128 C that threads are synchronised before exchanges
129 C begine.
130 IF (useCubedSphereExchange) THEN
131 CALL EXCH_UV_RL_CUBE( aduphi, advphi, withSigns,
132 I OLw, OLe, OLs, OLn, myNz,
133 I exchWidthX, exchWidthY,
134 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
135 ELSE
136 CALL EXCH_RL( aduphi,
137 I OLw, OLe, OLs, OLn, myNz,
138 I exchWidthX, exchWidthY,
139 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
140 CALL EXCH_RL( advphi,
141 I OLw, OLe, OLs, OLn, myNz,
142 I exchWidthX, exchWidthY,
143 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
144 c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
145 c _EXCH_XY_RL( aduphi, myThid )
146 c _EXCH_XY_RL( advphi, myThid )
147 ENDIF
148
149 RETURN
150 END
151
152
153 CStartOfInterface
154 SUBROUTINE adexch_uv_xyz_rs(
155 I withSigns, myThid,
156 U aduphi, advphi
157 & )
158 C /==========================================================\
159 C | SUBROUTINE ADEXCH_UV_XYZ_RS adjoint of EXCH_UV_XYZ_RS |
160 C | o Handle exchanges for real*4, two-dimensional arrays. |
161 C |==========================================================|
162 C === Global data ===
163 #include "SIZE.h"
164 #include "EEPARAMS.h"
165 #include "EESUPPORT.h"
166
167 C === Routine arguments ===
168 C phi - Array who's overlap regions are to be exchanged
169 C myThid - My thread id.
170 _RS aduphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
171 _RS advphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
172 LOGICAL withSigns
173 INTEGER myThid
174 CEndOfInterface
175 C == Local variables ==
176 C OL[wens] - Overlap extents in west, east, north, south.
177 C exchWidth[XYZ] - Extent of regions that will be exchanged.
178 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
179 INTEGER mysNx, mysNy, myNz
180
181 OLw = OLx
182 OLe = OLx
183 OLn = OLy
184 OLs = OLy
185 exchWidthX = OLx
186 exchWidthY = OLy
187 mysNx = sNx
188 mysNy = sNy
189 myNz = Nr
190 C ** NOTE ** The exchange routine we use here does not
191 C require the preceeding and following barriers.
192 C However, the slow, simple exchange interface
193 C that is calling it here is meant to ensure
194 C that threads are synchronised before exchanges
195 C begine.
196 IF (useCubedSphereExchange) THEN
197 CALL EXCH_UV_RS_CUBE( aduphi, advphi, withSigns,
198 I OLw, OLe, OLs, OLn, myNz,
199 I exchWidthX, exchWidthY,
200 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
201 ELSE
202 CALL EXCH_RS( aduphi,
203 I OLw, OLe, OLs, OLn, myNz,
204 I exchWidthX, exchWidthY,
205 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
206 CALL EXCH_RS( advphi,
207 I OLw, OLe, OLs, OLn, myNz,
208 I exchWidthX, exchWidthY,
209 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
210 c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
211 c _EXCH_XY_RS( aduphi, myThid )
212 c _EXCH_XY_RS( advphi, myThid )
213 ENDIF
214
215 RETURN
216 END
217
218
219 CStartOfInterface
220 SUBROUTINE adexch_uv_xyz_rl(
221 I withSigns, myThid,
222 U aduphi, advphi
223 & )
224 C /==========================================================\
225 C | SUBROUTINE ADEXCH_UV_XYZ_RL adjoint of EXCH_UV_XYZ_RL |
226 C | o Handle exchanges for real*8, two-dimensional arrays. |
227 C |==========================================================|
228 C === Global data ===
229 #include "SIZE.h"
230 #include "EEPARAMS.h"
231 #include "EESUPPORT.h"
232
233 C === Routine arguments ===
234 C phi - Array who's overlap regions are to be exchanged
235 C myThid - My thread id.
236 _RL aduphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
237 _RL advphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
238 LOGICAL withSigns
239 INTEGER myThid
240 CEndOfInterface
241 C == Local variables ==
242 C OL[wens] - Overlap extents in west, east, north, south.
243 C exchWidth[XYZ] - Extent of regions that will be exchanged.
244 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
245 INTEGER mysNx, mysNy, myNz
246
247 OLw = OLx
248 OLe = OLx
249 OLn = OLy
250 OLs = OLy
251 exchWidthX = OLx
252 exchWidthY = OLy
253 mysNx = sNx
254 mysNy = sNy
255 myNz = Nr
256 C ** NOTE ** The exchange routine we use here does not
257 C require the preceeding and following barriers.
258 C However, the slow, simple exchange interface
259 C that is calling it here is meant to ensure
260 C that threads are synchronised before exchanges
261 C begine.
262 IF (useCubedSphereExchange) THEN
263 CALL EXCH_UV_RL_CUBE( aduphi, advphi, withSigns,
264 I OLw, OLe, OLs, OLn, myNz,
265 I exchWidthX, exchWidthY,
266 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
267 ELSE
268 CALL EXCH_RL( aduphi,
269 I OLw, OLe, OLs, OLn, myNz,
270 I exchWidthX, exchWidthY,
271 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
272 CALL EXCH_RL( advphi,
273 I OLw, OLe, OLs, OLn, myNz,
274 I exchWidthX, exchWidthY,
275 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
276 c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
277 c _EXCH_XY_RL( aduphi, myThid )
278 c _EXCH_XY_RL( advphi, myThid )
279 ENDIF
280
281 RETURN
282 END
283

  ViewVC Help
Powered by ViewVC 1.1.22