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

Annotation of /MITgcm/pkg/autodiff/exch_z_ad.F

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


Revision 1.1 - (hide annotations) (download)
Fri Jul 13 13:33:50 2001 UTC (22 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46b_post, checkpoint57t_post, checkpoint58l_post, checkpoint48f_post, checkpoint46k_post, checkpoint51k_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint55c_post, icebear2, checkpoint46c_pre, checkpoint53b_pre, checkpoint48d_pre, checkpoint51l_post, checkpoint51j_post, branch-exfmods-tag, checkpoint47e_post, checkpoint57m_post, checkpoint44h_pre, release1_p12, checkpoint52l_pre, checkpoint48i_post, checkpoint52e_pre, hrcube4, checkpoint58e_post, release1_p10, checkpoint57v_post, release1_p16, checkpoint57g_pre, checkpoint52j_post, release1_p15, release1_p11, checkpoint47f_post, ecco_c44_e16, checkpoint48d_post, checkpoint51o_pre, checkpoint57f_post, checkpoint46j_post, checkpoint47c_post, checkpoint50e_post, checkpoint52e_post, checkpoint50c_post, checkpoint57s_post, checkpoint51n_pre, checkpoint47d_post, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint57j_post, checkpoint58b_post, checkpoint58m_post, checkpoint44f_pre, checkpoint45a_post, checkpoint47a_post, icebear3, checkpoint57b_post, checkpoint46f_post, checkpoint52d_pre, ecco_c50_e33a, checkpoint53c_post, checkpoint53d_post, checkpoint57f_pre, checkpoint46a_post, checkpoint48a_post, checkpoint55d_pre, checkpoint46n_post, checkpoint51f_pre, release1_p13_pre, checkpoint46d_pre, checkpoint57g_post, checkpoint48e_post, checkpoint46e_post, checkpoint45b_post, checkpoint57a_post, checkpoint48h_post, checkpoint55j_post, checkpoint56b_post, checkpoint50c_pre, release1-branch_tutorials, checkpoint57h_pre, checkpoint57y_post, ecco_c50_e28, release1_p14, checkpoint44g_post, branchpoint-genmake2, checkpoint46h_pre, checkpoint45c_post, checkpoint44h_post, release1_p12_pre, chkpt44c_post, checkpoint58g_post, checkpoint44e_post, checkpoint57x_post, checkpoint52j_pre, checkpoint54a_post, checkpoint46e_pre, ecco-branch-mod4, checkpoint43a-release1mods, branch-netcdf, ecco_c44_e22, checkpoint50d_pre, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint47i_post, checkpoint52b_pre, checkpoint52n_post, release1_p13, checkpoint54b_post, checkpoint46l_pre, checkpoint46j_pre, checkpoint58h_post, checkpoint46b_pre, checkpoint51i_post, checkpoint57e_post, checkpoint45d_post, checkpoint54d_post, checkpoint47h_post, checkpoint48c_post, checkpoint46l_post, chkpt44a_pre, release1-branch-end, checkpoint56c_post, checkpoint50b_pre, checkpoint54e_post, release1_final_v1, checkpoint58j_post, checkpoint55b_post, ecco_c44_e19, checkpoint51e_post, checkpoint51b_post, checkpoint46, checkpoint57h_post, checkpoint44f_post, ecco_c44_e20, checkpoint51l_pre, checkpoint52m_post, checkpoint51c_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, ecco_c50_e31, checkpoint55a_post, checkpoint57c_pre, checkpoint44, hrcube5, ecco_c44_e18, checkpoint48, checkpoint49, c49_autodiff, checkpoint47b_post, checkpoint40pre2, checkpoint40pre5, checkpoint53b_post, checkpoint57o_post, checkpoint40pre6, checkpoint55g_post, checkpoint57r_post, checkpoint51o_post, checkpoint40pre8, checkpoint48g_post, ecco_c44_e17, release1_p17, checkpoint57k_post, checkpoint57d_post, release1_b1, checkpoint44b_post, checkpoint55f_post, checkpoint57i_post, checkpoint51q_post, checkpoint52l_post, checkpoint52k_post, ecco_c51_e34, chkpt44d_post, ecco_c50_e29, checkpoint58, checkpoint42, release1_p9, checkpoint57a_pre, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, release1_p8, checkpoint50d_post, checkpoint43, checkpoint52d_post, checkpoint46m_post, checkpoint46g_pre, release1_p2, release1_p3, release1_p4, checkpoint51b_pre, release1_p6, checkpoint52a_post, checkpoint57h_done, checkpoint47g_post, checkpoint58f_post, checkpoint52b_post, checkpoint53g_post, chkpt44a_post, checkpoint52f_post, checkpoint44b_pre, checkpoint57n_post, checkpoint52c_post, release1_p1, checkpoint58d_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint40pre4, checkpoint51h_pre, checkpoint58a_post, checkpoint46a_pre, ecco_c51_e34e, ecco-branch-mod1, checkpoint40pre3, checkpoint50g_post, checkpoint58i_post, checkpoint57q_post, release1_p5, checkpoint44e_pre, checkpoint51g_post, ecco_c52_e35, chkpt44c_pre, checkpoint40pre9, ecco_ice2, ecco_ice1, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint46d_post, ecco-branch-mod2, checkpoint48b_post, checkpoint50b_post, eckpoint57e_pre, checkpoint46g_post, ecco_c51_e34c, checkpoint58c_post, ecco_c51_e34d, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, checkpoint58k_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, ecco_c50_e32, checkpoint50f_pre, checkpoint52a_pre, ecco-branch-mod3, ecco_c50_e33, checkpoint47d_pre, checkpoint51d_post, ecco_c50_e30, checkpoint48c_pre, ecco-branch-mod5, checkpoint46i_post, release1_beta1, ecco_c44_e23, checkpoint51m_post, checkpoint51t_post, checkpoint53d_pre, release1-branch_branchpoint, checkpoint47, checkpoint55e_post, checkpoint40pre7, checkpoint46c_post, checkpoint54c_post, checkpoint50h_post, checkpoint52i_post, checkpoint51a_post, checkpoint40, checkpoint45, checkpoint46h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51p_post, checkpoint51n_post, release1_chkpt44d_post, ecco_c44_e25, checkpoint55i_post, icebear5, checkpoint51i_pre, icebear4, checkpoint57l_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint41, release1_p7, checkpoint52f_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint56a_post, checkpoint51s_post, checkpoint55d_post
Branch point for: c24_e25_ice, netcdf-sm0, ecco-branch, branch-genmake2, release1_coupled, branch-nonh, icebear, tg2-branch, release1_final, checkpoint51n_branch, release1-branch, release1, release1_50yr, branch-exfmods-curt
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 heimbach 1.1 C /==========================================================\
2     C | SUBROUTINEs adexch_z_xy_rs adexch_z_xyz_rs |
3     C | adexch_z_xy_rl adexch_z_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_z_xy_rs(
22     I myThid
23     U , adphi
24     & )
25     C /==========================================================\
26     C | SUBROUTINE ADEXCH_Z_XY_RS adjoint of EXCH_Z_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 adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
39     INTEGER myThid
40     CEndOfInterface
41     C == Local variables ==
42     C OL[wens] - Overlap extents in west, east, north, south.
43     C exchWidth[XY] - Extent of regions that will be exchanged.
44     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
45     INTEGER mysNx, mysNy, myNz
46    
47     OLw = OLx
48     OLe = OLx
49     OLn = OLy
50     OLs = OLy
51     exchWidthX = OLx
52     exchWidthY = OLy
53     mysNx = sNx
54     mysNy = sNy
55     myNz = 1
56     C ** NOTE ** The exchange routine we use here does not
57     C require the preceeding and following barriers.
58     C However, the slow, simple exchange interface
59     C that is calling it here is meant to ensure
60     C that threads are synchronised before exchanges
61     C begine.
62     IF (useCubedSphereExchange) THEN
63     CALL EXCH_Z_RS_CUBE( adphi,
64     I OLw, OLe, OLs, OLn, myNz,
65     I exchWidthX, exchWidthY,
66     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
67     ELSE
68     CALL EXCH_RS( adphi,
69     I OLw, OLe, OLs, OLn, myNz,
70     I exchWidthX, exchWidthY,
71     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
72     ENDIF
73    
74     RETURN
75     END
76    
77    
78     CStartOfInterface
79     SUBROUTINE adexch_z_xy_rl(
80     I myThid
81     U , adphi
82     & )
83     C /==========================================================\
84     C | SUBROUTINE ADEXCH_Z_XY_RL adjoint of EXCH_Z_XY_RL |
85     C | o Handle exchanges for real*8, two-dimensional arrays. |
86     C |==========================================================|
87     C === Global data ===
88     #include "SIZE.h"
89     #include "EEPARAMS.h"
90     #include "EESUPPORT.h"
91    
92     C === Routine arguments ===
93     C phi - Array who's overlap regions are to be exchanged
94     C myThid - My thread id.
95     _RL adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96     INTEGER myThid
97     CEndOfInterface
98     C == Local variables ==
99     C OL[wens] - Overlap extents in west, east, north, south.
100     C exchWidth[XY] - Extent of regions that will be exchanged.
101     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
102     INTEGER mysNx, mysNy, myNz
103    
104     OLw = OLx
105     OLe = OLx
106     OLn = OLy
107     OLs = OLy
108     exchWidthX = OLx
109     exchWidthY = OLy
110     mysNx = sNx
111     mysNy = sNy
112     myNz = 1
113     C ** NOTE ** The exchange routine we use here does not
114     C require the preceeding and following barriers.
115     C However, the slow, simple exchange interface
116     C that is calling it here is meant to ensure
117     C that threads are synchronised before exchanges
118     C begine.
119     IF (useCubedSphereExchange) THEN
120     CALL EXCH_Z_RL_CUBE( adphi,
121     I OLw, OLe, OLs, OLn, myNz,
122     I exchWidthX, exchWidthY,
123     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
124     ELSE
125     CALL EXCH_RL( adphi,
126     I OLw, OLe, OLs, OLn, myNz,
127     I exchWidthX, exchWidthY,
128     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
129     ENDIF
130    
131     RETURN
132     END
133    
134    
135     CStartOfInterface
136     SUBROUTINE adexch_z_xyz_rs(
137     I myThid
138     U , adphi
139     & )
140     C /==========================================================\
141     C | SUBROUTINE ADEXCH_Z_XYZ_RS adjoint of EXCH_Z_XYZ_RS |
142     C | o Handle exchanges for real*4, two-dimensional arrays. |
143     C |==========================================================|
144     C === Global data ===
145     #include "SIZE.h"
146     #include "EEPARAMS.h"
147     #include "EESUPPORT.h"
148    
149     C === Routine arguments ===
150     C phi - Array who's overlap regions are to be exchanged
151     C myThid - My thread id.
152     _RS adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
153     INTEGER myThid
154     CEndOfInterface
155     C == Local variables ==
156     C OL[wens] - Overlap extents in west, east, north, south.
157     C exchWidth[XYZ] - Extent of regions that will be exchanged.
158     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
159     INTEGER mysNx, mysNy, myNz
160    
161     OLw = OLx
162     OLe = OLx
163     OLn = OLy
164     OLs = OLy
165     exchWidthX = OLx
166     exchWidthY = OLy
167     mysNx = sNx
168     mysNy = sNy
169     myNz = Nr
170     C ** NOTE ** The exchange routine we use here does not
171     C require the preceeding and following barriers.
172     C However, the slow, simple exchange interface
173     C that is calling it here is meant to ensure
174     C that threads are synchronised before exchanges
175     C begine.
176     IF (useCubedSphereExchange) THEN
177     CALL EXCH_Z_RS_CUBE( adphi,
178     I OLw, OLe, OLs, OLn, myNz,
179     I exchWidthX, exchWidthY,
180     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
181     ELSE
182     CALL EXCH_RS( adphi,
183     I OLw, OLe, OLs, OLn, myNz,
184     I exchWidthX, exchWidthY,
185     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
186     ENDIF
187    
188     RETURN
189     END
190    
191    
192     CStartOfInterface
193     SUBROUTINE adexch_z_xyz_rl(
194     I myThid
195     U , adphi
196     & )
197     C /==========================================================\
198     C | SUBROUTINE ADEXCH_Z_XYZ_RL adjoint of EXCH_Z_XYZ_RL |
199     C | o Handle exchanges for real*8, two-dimensional arrays. |
200     C |==========================================================|
201     C === Global data ===
202     #include "SIZE.h"
203     #include "EEPARAMS.h"
204     #include "EESUPPORT.h"
205    
206     C === Routine arguments ===
207     C phi - Array who's overlap regions are to be exchanged
208     C myThid - My thread id.
209     _RL adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
210     INTEGER myThid
211     CEndOfInterface
212     C == Local variables ==
213     C OL[wens] - Overlap extents in west, east, north, south.
214     C exchWidth[XYZ] - Extent of regions that will be exchanged.
215     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
216     INTEGER mysNx, mysNy, myNz
217    
218     OLw = OLx
219     OLe = OLx
220     OLn = OLy
221     OLs = OLy
222     exchWidthX = OLx
223     exchWidthY = OLy
224     mysNx = sNx
225     mysNy = sNy
226     myNz = Nr
227     C ** NOTE ** The exchange routine we use here does not
228     C require the preceeding and following barriers.
229     C However, the slow, simple exchange interface
230     C that is calling it here is meant to ensure
231     C that threads are synchronised before exchanges
232     C begine.
233     IF (useCubedSphereExchange) THEN
234     CALL EXCH_Z_RL_CUBE( adphi,
235     I OLw, OLe, OLs, OLn, myNz,
236     I exchWidthX, exchWidthY,
237     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
238     ELSE
239     CALL EXCH_RL( adphi,
240     I OLw, OLe, OLs, OLn, myNz,
241     I exchWidthX, exchWidthY,
242     I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
243     ENDIF
244    
245     RETURN
246     END

  ViewVC Help
Powered by ViewVC 1.1.22