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

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

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


Revision 1.4 - (show annotations) (download)
Wed Sep 6 18:16:06 2006 UTC (17 years, 8 months ago) by heimbach
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
FILE REMOVED
o Common exch_3d_ad.F and exch_3d_ad.flow file
  for all exch*3d*.F routines (removed old ones).

1 C /==========================================================\
2 C | SUBROUTINEs adexch_z_3d_rs |
3 C | adexch_z_3d_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_3d_rs(
22 I myNz, myThid
23 U , adphi
24 & )
25 C /==========================================================\
26 C | SUBROUTINE ADEXCH_Z_3D_RS adjoint of EXCH_Z_3D_RS |
27 C | o Handle exchanges for real*4, two-dimensional arrays. |
28 C |==========================================================|
29 C === Global data ===
30 #include "SIZE.h"
31 #include "EEPARAMS.h"
32 #include "EESUPPORT.h"
33
34 C === Routine arguments ===
35 C phi - Array who's overlap regions are to be exchanged
36 C myThid - My thread id.
37 INTEGER myNz
38 _RS adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,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[XYZ] - Extent of regions that will be exchanged.
44 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
45
46 OLw = OLx
47 OLe = OLx
48 OLn = OLy
49 OLs = OLy
50 exchWidthX = OLx
51 exchWidthY = OLy
52 C ** NOTE ** The exchange routine we use here does not
53 C require the preceeding and following barriers.
54 C However, the slow, simple exchange interface
55 C that is calling it here is meant to ensure
56 C that threads are synchronised before exchanges
57 C begine.
58 IF (useCubedSphereExchange) THEN
59 CALL EXCH_Z_RS_CUBE( adphi,
60 I OLw, OLe, OLs, OLn, myNz,
61 I exchWidthX, exchWidthY,
62 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
63 ELSE
64 CALL EXCH_RS( adphi,
65 I OLw, OLe, OLs, OLn, myNz,
66 I exchWidthX, exchWidthY,
67 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
68 ENDIF
69
70 RETURN
71 END
72
73
74 CStartOfInterface
75 SUBROUTINE adexch_z_3d_rl(
76 I myNz, myThid
77 U , adphi
78 & )
79 C /==========================================================\
80 C | SUBROUTINE ADEXCH_Z_3D_RL adjoint of EXCH_Z_3D_RL |
81 C | o Handle exchanges for real*8, two-dimensional arrays. |
82 C |==========================================================|
83 C === Global data ===
84 #include "SIZE.h"
85 #include "EEPARAMS.h"
86 #include "EESUPPORT.h"
87
88 C === Routine arguments ===
89 C phi - Array who's overlap regions are to be exchanged
90 C myThid - My thread id.
91 INTEGER myNz
92 _RL adphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
93 INTEGER myThid
94 CEndOfInterface
95 C == Local variables ==
96 C OL[wens] - Overlap extents in west, east, north, south.
97 C exchWidth[XYZ] - Extent of regions that will be exchanged.
98 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
99
100 OLw = OLx
101 OLe = OLx
102 OLn = OLy
103 OLs = OLy
104 exchWidthX = OLx
105 exchWidthY = OLy
106 C ** NOTE ** The exchange routine we use here does not
107 C require the preceeding and following barriers.
108 C However, the slow, simple exchange interface
109 C that is calling it here is meant to ensure
110 C that threads are synchronised before exchanges
111 C begine.
112 IF (useCubedSphereExchange) THEN
113 CALL EXCH_Z_RL_CUBE( adphi,
114 I OLw, OLe, OLs, OLn, myNz,
115 I exchWidthX, exchWidthY,
116 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
117 ELSE
118 CALL EXCH_RL( adphi,
119 I OLw, OLe, OLs, OLn, myNz,
120 I exchWidthX, exchWidthY,
121 I REVERSE_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
122 ENDIF
123
124 RETURN
125 END

  ViewVC Help
Powered by ViewVC 1.1.22