/[MITgcm]/MITgcm/eesupp/src/exch_z_rx_cube.template
ViewVC logotype

Annotation of /MITgcm/eesupp/src/exch_z_rx_cube.template

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


Revision 1.1.2.2 - (hide annotations) (download)
Tue Apr 3 02:36:54 2001 UTC (23 years, 2 months ago) by adcroft
Branch: pre38
Changes since 1.1.2.1: +20 -8 lines
Hacked loop ranges to deal with lack of sufficient I/O system for
initializing edges/corners. Still requires hacks in initialization though.

1 adcroft 1.1.2.2 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/Attic/exch_z_rx_cube.template,v 1.1.2.1 2001/03/28 19:48:52 adcroft Exp $
2     C $Name: $
3 adcroft 1.1.2.1
4     #include "CPP_EEOPTIONS.h"
5    
6     SUBROUTINE EXCH_Z_RX_CUBE(
7     U array,
8     I myOLw, myOLe, myOLn, myOLs, myNz,
9     I exchWidthX, exchWidthY,
10     I simulationMode, cornerMode, myThid )
11     C /==========================================================\
12     C | SUBROUTINE EXCH_Z_RX_CUBE |
13     C | o Control edge exchanges for RX array. |
14     C |==========================================================|
15     C | |
16     C | Controlling routine for exchange of XY edges of an array |
17     C | distributed in X and Y. The routine interfaces to |
18     C | communication routines that can use messages passing |
19     C | exchanges, put type exchanges or get type exchanges. |
20     C | This allows anything from MPI to raw memory channel to |
21     C | memmap segments to be used as a inter-process and/or |
22     C | inter-thread communiation and synchronisation |
23     C | mechanism. |
24     C | Notes -- |
25     C | 1. Some low-level mechanisms such as raw memory-channel |
26     C | or SGI/CRAY shmem put do not have direct Fortran bindings|
27     C | and are invoked through C stub routines. |
28     C | 2. Although this routine is fairly general but it does |
29     C | require nSx and nSy are the same for all innvocations. |
30     C | There are many common data structures ( myByLo, |
31     C | westCommunicationMode, mpiIdW etc... ) tied in with |
32     C | (nSx,nSy). To support arbitray nSx and nSy would require |
33     C | general forms of these. |
34     C | |
35     C \==========================================================/
36     IMPLICIT NONE
37    
38     C == Global data ==
39     #include "SIZE.h"
40     #include "EEPARAMS.h"
41     #include "EESUPPORT.h"
42     #include "EXCH.h"
43    
44     C == Routine arguments ==
45     C array - Array with edges to exchange.
46     C myOLw - West, East, North and South overlap region sizes.
47     C myOLe
48     C myOLn
49     C myOLs
50     C exchWidthX - Width of data region exchanged in X.
51     C exchWidthY - Width of data region exchanged in Y.
52     C Note --
53     C 1. In theory one could have a send width and
54     C a receive width for each face of each tile. The only
55     C restriction woul be that the send width of one
56     C face should equal the receive width of the sent to
57     C tile face. Dont know if this would be useful. I
58     C have left it out for now as it requires additional
59     C bookeeping.
60     C simulationMode - Forward or reverse mode exchange ( provides
61     C support for adjoint integration of code. )
62     C cornerMode - Flag indicating whether corner updates are
63     C needed.
64     C myThid - Thread number of this instance of S/R EXCH...
65     INTEGER myOLw
66     INTEGER myOLe
67     INTEGER myOLs
68     INTEGER myOLn
69     INTEGER myNz
70     INTEGER exchWidthX
71     INTEGER exchWidthY
72     INTEGER simulationMode
73     INTEGER cornerMode
74     INTEGER myThid
75     _RX array(1-myOLw:sNx+myOLe,
76     & 1-myOLs:sNy+myOLn,
77     & myNZ, nSx, nSy)
78    
79     C == Local variables ==
80     C theSimulationMode - Holds working copy of simulation mode
81     C theCornerMode - Holds working copy of corner mode
82     INTEGER theSimulationMode
83     INTEGER theCornerMode
84     INTEGER I,J,K
85     INTEGER bl,bt,bn,bs,be,bw
86    
87     C == Statement function ==
88     INTEGER tilemod
89     tilemod(I)=1+mod(I-1+6,6)
90    
91     theSimulationMode = simulationMode
92     theCornerMode = cornerMode
93    
94     DO bl = 1, 5, 2
95    
96     bt = bl
97     bn=tilemod(bt+2)
98     bs=tilemod(bt-1)
99     be=tilemod(bt+1)
100     bw=tilemod(bt-2)
101    
102     DO K = 1, myNz
103     DO J = 1, sNy+1
104 adcroft 1.1.2.2 DO I = 0, exchWidthX-1
105 adcroft 1.1.2.1
106     C Tile Odd:Odd+2 [get] [North<-West]
107     array(J,sNy+I+1,K,bt,1) = array(I+1,sNy+2-J,K,bn,1)
108     C Tile Odd:Odd+1 [get] [East<-West]
109     array(sNx+I+1,J,K,bt,1) = array(I+1,J,K,be,1)
110 adcroft 1.1.2.2
111     cs- these above loop should really have the same range the lower one
112     ENDDO
113     DO I = 1, exchWidthX-0
114     cs- but this replaces the missing I/O routines for now
115    
116     C Tile Odd:Odd-1 [get] [South<-North]
117     array(J,1-I,K,bt,1) = array(J,sNy+1-I,K,bs,1)
118 adcroft 1.1.2.1 C Tile Odd:Odd-2 [get] [West<-North]
119     array(1-I,J,K,bt,1) = array(sNx+2-J,sNy+1-I,K,bw,1)
120    
121     ENDDO
122     ENDDO
123     ENDDO
124    
125     bt = bl+1
126     bn=tilemod(bt+1)
127     bs=tilemod(bt-2)
128     be=tilemod(bt+2)
129     bw=tilemod(bt-1)
130    
131     DO K = 1, myNz
132     DO J = 1, sNy+1
133 adcroft 1.1.2.2 DO I = 0, exchWidthX-1
134 adcroft 1.1.2.1
135     C Tile Even:Even+1 [get] [North<-South]
136     array(J,sNy+I+1,K,bt,1) = array(J,I+1,K,bn,1)
137     C Tile Even:Even+2 [get] [East<-South]
138     array(sNx+I+1,J,K,bt,1) = array(sNx+2-J,I+1,K,be,1)
139 adcroft 1.1.2.2
140     cs- these above loop should really have the same range the lower one
141     ENDDO
142     DO I = 1, exchWidthX-0
143     cs- but this replaces the missing I/O routines for now
144    
145     C Tile Even:Even-2 [get] [South<-East]
146     array(J,1-I,K,bt,1) = array(sNx+1-I,sNy+2-J,K,bs,1)
147 adcroft 1.1.2.1 C Tile Even:Even-1 [get] [West<-East]
148     array(1-I,J,K,bt,1) = array(sNx+1-I,J,K,bw,1)
149    
150     ENDDO
151     ENDDO
152     ENDDO
153    
154     ENDDO
155    
156     RETURN
157     END

  ViewVC Help
Powered by ViewVC 1.1.22