/[MITgcm]/MITgcm_contrib/high_res_cube/code-mods/exch2_uv_xyz_rl.F
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/code-mods/exch2_uv_xyz_rl.F

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


Revision 1.3 - (hide annotations) (download)
Fri Feb 6 21:12:01 2004 UTC (21 years, 10 months ago) by dimitri
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
removed files that have been ported to pkg/exch2
added tile configuration with missing tiles

1 dimitri 1.3 C $Header: /usr/local/gcmpack/MITgcm_contrib/high_res_cube/code-mods/exch2_uv_xyz_rl.F,v 1.2 2003/11/22 01:16:18 dimitri Exp $
2 cnh 1.1 C $Name: $
3    
4     #include "CPP_EEOPTIONS.h"
5    
6     CBOP
7    
8     C !ROUTINE: EXCH2_UV_XYZ_RL
9    
10     C !INTERFACE:
11     SUBROUTINE EXCH2_UV_XYZ_RL(
12     U Uphi, Vphi, withSigns,
13     I myThid )
14     IMPLICIT NONE
15     C !DESCRIPTION:
16     C *==========================================================*
17     C | SUBROUTINE EXCH_UV_XYZ_RL
18     C | o Handle exchanges for _RL, 3-dimensional vector arrays.
19     C *==========================================================*
20     C | Vector arrays need to be rotated and interchaged for
21     C | exchange operations on some grids. This driver routine
22     C | branches to support this.
23     C *==========================================================*
24    
25     C !USES:
26     C === Global data ===
27     #include "SIZE.h"
28     #include "EEPARAMS.h"
29     #include "EESUPPORT.h"
30     #include "W2_EXCH2_TOPOLOGY.h"
31     #include "W2_EXCH2_PARAMS.h"
32    
33     C !INPUT/OUTPUT PARAMETERS:
34     C === Routine arguments ===
35     C phi :: Array with overlap regions are to be exchanged
36     C Note - The interface to EXCH_RL assumes that
37     C the standard Fortran 77 sequence association rules
38     C apply.
39     C myThid :: My thread id.
40     _RL Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
41     _RL Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
42     LOGICAL withSigns
43     INTEGER myThid
44    
45     C !LOCAL VARIABLES:
46     C == Local variables ==
47     C OL[wens] :: Overlap extents in west, east, north, south.
48     C exchWidth[XY] :: Extent of regions that will be exchanged.
49     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz
50 dimitri 1.2 INTEGER bi, bj, myTile, k
51 cnh 1.1
52     CEOP
53    
54     OLw = OLx
55     OLe = OLx
56     OLn = OLy
57     OLs = OLy
58     exchWidthX = OLx
59     exchWidthY = OLy
60     myNz = Nr
61     C ** NOTE ** The exchange routine we use here does not
62     C require the preceeding and following barriers.
63     C However, the slow, simple exchange interface
64     C that is calling it here is meant to ensure
65     C that threads are synchronised before exchanges
66     C begine.
67     IF (useCubedSphereExchange) THEN
68     CALL EXCH2_RL2_CUBE( Uphi, Vphi, withSigns, 'UV',
69     I OLw, OLe, OLs, OLn, myNz,
70     I exchWidthX, exchWidthY,
71     I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
72     CALL EXCH2_RL2_CUBE( Uphi, Vphi, withSigns, 'UV',
73     I OLw, OLe, OLs, OLn, myNz,
74     I exchWidthX, exchWidthY,
75     I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
76     CALL EXCH2_RL2_CUBE( Uphi, Vphi, withSigns, 'UV',
77     I OLw, OLe, OLs, OLn, myNz,
78     I exchWidthX, exchWidthY,
79     I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
80     CALL EXCH2_RL2_CUBE( Uphi, Vphi, withSigns, 'UV',
81     I OLw, OLe, OLs, OLn, myNz,
82     I exchWidthX, exchWidthY,
83     I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
84     DO bj=myByLo(myThid),myByHi(myThid)
85     DO bi=myBxLo(myThid),myBxHi(myThid)
86     myTile = W2_myTileList(bi)
87 dimitri 1.2 IF ( exch2_isEedge(myTile) .EQ. 1 .AND.
88     & exch2_isSedge(myTile) .EQ. 1 ) THEN
89     DO k=1,Nr
90     Uphi(snx+1, 0,k,bi,bj)= vPhi(snx+1, 1,k,bi,bj)
91     ENDDO
92 cnh 1.1 ENDIF
93     IF ( withSigns ) THEN
94 dimitri 1.2 IF ( exch2_isEedge(myTile) .EQ. 1 .AND.
95     & exch2_isNedge(myTile) .EQ. 1 ) THEN
96     DO k=1,Nr
97     Uphi(snx+1,sny+1,k,bi,bj)=-vPhi(snx+1,sny+1,k,bi,bj)
98     ENDDO
99 cnh 1.1 ENDIF
100     ELSE
101 dimitri 1.2 IF ( exch2_isEedge(myTile) .EQ. 1 .AND.
102     & exch2_isNedge(myTile) .EQ. 1 ) THEN
103     DO k=1,Nr
104     Uphi(snx+1,sny+1,k,bi,bj)= vPhi(snx+1,sny+1,k,bi,bj)
105     ENDDO
106 cnh 1.1 ENDIF
107     ENDIF
108     ENDDO
109     ENDDO
110    
111     ELSE
112     c CALL EXCH_RL( Uphi,
113     c I OLw, OLe, OLs, OLn, myNz,
114     c I exchWidthX, exchWidthY,
115     c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
116     c CALL EXCH_RL( Vphi,
117     c I OLw, OLe, OLs, OLn, myNz,
118     c I exchWidthX, exchWidthY,
119     c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
120     c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
121     _EXCH_XYZ_RL( Uphi, myThid )
122     _EXCH_XYZ_RL( Vphi, myThid )
123     ENDIF
124    
125     RETURN
126     END

  ViewVC Help
Powered by ViewVC 1.1.22