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

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

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


Revision 1.7 - (show annotations) (download)
Wed Jul 25 21:19:44 2007 UTC (16 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint59e
Changes since 1.6: +15 -6 lines
add option not to use exch2_R2_cube (with #define W2_USE_R1_ONLY in W2_OPTIONS.h)

1 C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_xy_rx.template,v 1.6 2006/11/17 22:35:03 heimbach Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_EEOPTIONS.h"
6 #ifdef ALLOW_EXCH2
7 #include "W2_OPTIONS.h"
8 #endif
9
10 CBOP
11 C !ROUTINE: EXCH_UV_XY_RX
12
13 C !INTERFACE:
14 SUBROUTINE EXCH_UV_XY_RX(
15 U Uphi, Vphi,
16 I withSigns, myThid )
17 IMPLICIT NONE
18 C !DESCRIPTION:
19 C *==========================================================*
20 C | SUBROUTINE EXCH_UV_XY_RX
21 C | o Handle exchanges for _RX, two-dimensional arrays.
22 C *==========================================================*
23 C | Driver exchange routine which branches to cube sphere or
24 C | global, simple cartesian index grid. Exchange routine is
25 C | called with two arrays that are components of a vector.
26 C | These components are rotated and interchanged on the
27 C | rotated grid during cube exchanges.
28 C *==========================================================*
29
30 C !USES:
31 C === Global data ===
32 #include "SIZE.h"
33 #include "EEPARAMS.h"
34 #include "EESUPPORT.h"
35 #include "EXCH.h"
36
37 C !INPUT/OUTPUT PARAMETERS:
38 C === Routine arguments ===
39 C Uphi :: Arrays with overlap regions are to be exchanged
40 C Vphi Note - The interface to EXCH_ assumes that
41 C the standard Fortran 77 sequence association rules
42 C apply.
43 C myThid :: My thread id.
44 C withSigns :: Flag controlling whether vector is signed.
45 _RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
46 _RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
47 LOGICAL withSigns
48 INTEGER myThid
49
50 C !LOCAL VARIABLES:
51 C == Local variables ==
52 C OL[wens] :: Overlap extents in west, east, north, south.
53 C exchWidth[XY] :: Extent of regions that will be exchanged.
54 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz
55 CEOP
56
57 #ifdef ALLOW_EXCH2
58 #ifdef W2_USE_R1_ONLY
59 CALL EXCH2_UV_CGRID_3D_RX(
60 U Uphi, Vphi,
61 I withSigns, 1, myThid )
62 #else
63 CALL EXCH2_UV_XY_RX(
64 U Uphi, Vphi,
65 I withSigns, myThid )
66 #endif
67 RETURN
68 #else /* ALLOW_EXCH2 */
69
70 OLw = OLx
71 OLe = OLx
72 OLn = OLy
73 OLs = OLy
74 exchWidthX = OLx
75 exchWidthY = OLy
76 myNz = 1
77 C ** NOTE ** The exchange routine we use here does not
78 C require the preceeding and following barriers.
79 C However, the slow, simple exchange interface
80 C that is calling it here is meant to ensure
81 C that threads are synchronised before exchanges
82 C begine.
83 IF (useCubedSphereExchange) THEN
84 CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns,
85 I OLw, OLe, OLs, OLn, myNz,
86 I exchWidthX, exchWidthY,
87 I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
88 ELSE
89 c CALL EXCH_RX( Uphi,
90 c I OLw, OLe, OLs, OLn, myNz,
91 c I exchWidthX, exchWidthY,
92 c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
93 c CALL EXCH_RX( Vphi,
94 c I OLw, OLe, OLs, OLn, myNz,
95 c I exchWidthX, exchWidthY,
96 c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
97 c_jmc: for JAM compatibility, replace the 2 CALLs above by the 2 CPP_MACROs:
98 _EXCH_XY_RX( Uphi, myThid )
99 _EXCH_XY_RX( Vphi, myThid )
100 ENDIF
101
102 RETURN
103 #endif /* ALLOW_EXCH2 */
104 END
105
106 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
107
108 CEH3 ;;; Local Variables: ***
109 CEH3 ;;; mode:fortran ***
110 CEH3 ;;; End: ***

  ViewVC Help
Powered by ViewVC 1.1.22