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

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

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


Revision 1.1 - (hide annotations) (download)
Wed May 19 01:46:11 2010 UTC (14 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62g, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
rename all exch_*rx_cube.F to exch1_*rx_cube.F and remove argument "simulationMode"

1 jmc 1.1 C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_z_rx_cube.template,v 1.5 2010/05/04 00:39:52 jmc Exp $
2     C $Name: $
3    
4     #include "CPP_EEOPTIONS.h"
5    
6     CBOP
7    
8     C !ROUTINE: EXCH1_Z_RX_CUBE
9    
10     C !INTERFACE:
11     SUBROUTINE EXCH1_Z_RX_CUBE(
12     U array,
13     I withSigns,
14     I myOLw, myOLe, myOLs, myOLn, myNz,
15     I exchWidthX, exchWidthY,
16     I cornerMode, myThid )
17    
18     C !DESCRIPTION:
19     C *==========================================================*
20     C | SUBROUTINE EXCH1_Z_RX_CUBE
21     C | o Forward-mode edge exchanges for RX array on CS config:
22     C | Fill overlap region through tile exchanges,
23     C | according to CS topology,
24     C | for a Zeta-located, scalar field RX arrays.
25     C *==========================================================*
26     C | Controlling routine for exchange of XY edges of an array
27     C | distributed in X and Y. The routine interfaces to
28     C | communication routines that can use messages passing
29     C | exchanges, put type exchanges or get type exchanges.
30     C | This allows anything from MPI to raw memory channel to
31     C | memmap segments to be used as a inter-process and/or
32     C | inter-thread communiation and synchronisation
33     C | mechanism.
34     C | Notes --
35     C | 1. Some low-level mechanisms such as raw memory-channel
36     C | or SGI/CRAY shmem put do not have direct Fortran bindings
37     C | and are invoked through C stub routines.
38     C | 2. Although this routine is fairly general but it does
39     C | require nSx and nSy are the same for all innvocations.
40     C | There are many common data structures ( myByLo,
41     C | westCommunicationMode, mpiIdW etc... ) tied in with
42     C | (nSx,nSy). To support arbitray nSx and nSy would require
43     C | general forms of these.
44     C | 3. zeta coord exchange operation for cube sphere grid
45     C *==========================================================*
46    
47     C !USES:
48     IMPLICIT NONE
49    
50     C == Global data ==
51     #include "SIZE.h"
52     #include "EEPARAMS.h"
53    
54     C !INPUT/OUTPUT PARAMETERS:
55     C == Routine arguments ==
56     C array :: Array with edges to exchange.
57     C withSigns :: Flag controlling whether field sign depends on orientation
58     C :: (signOption not yet implemented but needed for SM exch)
59     C myOLw,myOLe :: West and East overlap region sizes.
60     C myOLs,myOLn :: South and North overlap region sizes.
61     C exchWidthX :: Width of data region exchanged in X.
62     C exchWidthY :: Width of data region exchanged in Y.
63     C Note --
64     C 1. In theory one could have a send width and
65     C a receive width for each face of each tile. The only
66     C restriction would be that the send width of one
67     C face should equal the receive width of the sent to
68     C tile face. Dont know if this would be useful. I
69     C have left it out for now as it requires additional
70     C bookeeping.
71     C cornerMode :: Flag indicating whether corner updates are needed.
72     C myThid :: my Thread Id number
73    
74     INTEGER myOLw, myOLe, myOLs, myOLn, myNz
75     _RX array( 1-myOLw:sNx+myOLe,
76     & 1-myOLs:sNy+myOLn,
77     & myNz, nSx, nSy )
78     LOGICAL withSigns
79     INTEGER exchWidthX
80     INTEGER exchWidthY
81     INTEGER cornerMode
82     INTEGER myThid
83    
84     C !LOCAL VARIABLES:
85     C == Local variables ==
86     C theSimulationMode :: Holds working copy of simulation mode
87     C theCornerMode :: Holds working copy of corner mode
88     C I,J,K,repeat :: Loop counters and index
89     C bl,bt,bn,bs,be,bw :: tile indices
90     c INTEGER theSimulationMode
91     c INTEGER theCornerMode
92     INTEGER I,J,K,repeat
93     INTEGER bl,bt,bn,bs,be,bw
94     CHARACTER*(MAX_LEN_MBUF) msgBuf
95    
96     C == Statement function ==
97     INTEGER tilemod
98     tilemod(I)=1+mod(I-1+6,6)
99     CEOP
100    
101     c theSimulationMode = FORWARD_SIMULATION
102     c theCornerMode = cornerMode
103    
104     c IF ( simulationMode.EQ.REVERSE_SIMULATION ) THEN
105     c WRITE(msgBuf,'(A)')'EXCH1_Z_RX_CUBE: AD mode not implemented'
106     c CALL PRINT_ERROR( msgBuf, myThid )
107     c STOP 'ABNORMAL END: EXCH1_Z_RX_CUBE: no AD code'
108     c ENDIF
109     IF ( sNx.NE.sNy .OR.
110     & nSx.NE.6 .OR. nSy.NE.1 .OR.
111     & nPx.NE.1 .OR. nPy.NE.1 ) THEN
112     WRITE(msgBuf,'(2A)') 'EXCH1_Z_RX_CUBE: Wrong Tiling'
113     CALL PRINT_ERROR( msgBuf, myThid )
114     WRITE(msgBuf,'(2A)') 'EXCH1_Z_RX_CUBE: ',
115     & 'works only with sNx=sNy & nSx=6 & nSy=nPx=nPy=1'
116     CALL PRINT_ERROR( msgBuf, myThid )
117     STOP 'ABNORMAL END: EXCH1_Z_RX_CUBE: Wrong Tiling'
118     ENDIF
119    
120     C For now tile<->tile exchanges are sequentialised through
121     C thread 1. This is a temporary feature for preliminary testing until
122     C general tile decomposistion is in place (CNH April 11, 2001)
123     CALL BAR2( myThid )
124     IF ( myThid .EQ. 1 ) THEN
125    
126     DO repeat=1,2
127    
128     DO bl = 1, 5, 2
129    
130     bt = bl
131     bn=tilemod(bt+2)
132     bs=tilemod(bt-1)
133     be=tilemod(bt+1)
134     bw=tilemod(bt-2)
135    
136     DO K = 1, myNz
137     DO J = 1, sNy+1
138     DO I = 0, exchWidthX-1
139    
140     C Tile Odd:Odd+2 [get] [North<-West]
141     array(J,sNy+I+1,K,bt,1) = array(I+1,sNy+2-J,K,bn,1)
142     C Tile Odd:Odd+1 [get] [East<-West]
143     array(sNx+I+1,J,K,bt,1) = array(I+1,J,K,be,1)
144    
145     cs- these above loop should really have the same range the lower one
146     ENDDO
147     DO I = 1, exchWidthX-0
148     cs- but this replaces the missing I/O routines for now
149    
150     C Tile Odd:Odd-1 [get] [South<-North]
151     array(J,1-I,K,bt,1) = array(J,sNy+1-I,K,bs,1)
152     C Tile Odd:Odd-2 [get] [West<-North]
153     array(1-I,J,K,bt,1) = array(sNx+2-J,sNy+1-I,K,bw,1)
154    
155     ENDDO
156     ENDDO
157     ENDDO
158    
159     bt = bl+1
160     bn=tilemod(bt+1)
161     bs=tilemod(bt-2)
162     be=tilemod(bt+2)
163     bw=tilemod(bt-1)
164    
165     DO K = 1, myNz
166     DO J = 1, sNy+1
167     DO I = 0, exchWidthX-1
168    
169     C Tile Even:Even+1 [get] [North<-South]
170     array(J,sNy+I+1,K,bt,1) = array(J,I+1,K,bn,1)
171     C Tile Even:Even+2 [get] [East<-South]
172     array(sNx+I+1,J,K,bt,1) = array(sNx+2-J,I+1,K,be,1)
173    
174     cs- these above loop should really have the same range the lower one
175     ENDDO
176     DO I = 1, exchWidthX-0
177     cs- but this replaces the missing I/O routines for now
178    
179     C Tile Even:Even-2 [get] [South<-East]
180     array(J,1-I,K,bt,1) = array(sNx+1-I,sNy+2-J,K,bs,1)
181     C Tile Even:Even-1 [get] [West<-East]
182     array(1-I,J,K,bt,1) = array(sNx+1-I,J,K,bw,1)
183    
184     ENDDO
185     ENDDO
186     ENDDO
187    
188     ENDDO
189    
190     ENDDO
191    
192     ENDIF
193     CALL BAR2(myThid)
194    
195     RETURN
196     END

  ViewVC Help
Powered by ViewVC 1.1.22