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

Contents of /MITgcm/eesupp/src/exch1_rx_cube.template

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


Revision 1.1 - (show annotations) (download)
Wed May 19 01:47:29 2010 UTC (13 years, 11 months 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 remove argument "simulationMode"
(forgot this one)

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

  ViewVC Help
Powered by ViewVC 1.1.22