forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exch_uv_bgrid_3d_rx.template
113 lines (94 loc) · 3.29 KB
/
exch_uv_bgrid_3d_rx.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
C $Header: /u/gcmpack/MITgcm/eesupp/src/exch_uv_bgrid_3d_rx.template,v 1.3 2012/05/14 13:15:05 jmc Exp $
C $Name: $
#include "PACKAGES_CONFIG.h"
#include "CPP_EEOPTIONS.h"
CBOP
C !ROUTINE: EXCH_UV_BGRID_3D_RX
C !INTERFACE:
SUBROUTINE EXCH_UV_BGRID_3D_RX(
U uPhi, vPhi,
I withSigns, myNz, myThid )
C !DESCRIPTION:
C*=====================================================================*
C Purpose: SUBROUTINE EXCH_UV_BGRID_3D_RX
C handle exchanges for a 3D vector field on an B-grid.
C
C Input:
C uPhi(lon,lat,levs,bi,bj) :: first component of vector
C vPhi(lon,lat,levs,bi,bj) :: second component of vector
C withSigns (logical) :: true to use sign of components
C myNz :: 3rd dimension of input arrays uPhi,vPhi
C myThid :: my Thread Id number
C
C Output: uPhi and vPhi are updated (halo regions filled)
C
C Branch to appropriate exchange routine for B-grid vector field
C*=====================================================================*
C !USES:
IMPLICIT NONE
#include "SIZE.h"
#include "EEPARAMS.h"
C !INPUT/OUTPUT PARAMETERS:
C == Argument list variables ==
INTEGER myNz
_RX uPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
_RX vPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
LOGICAL withSigns
INTEGER myThid
C !LOCAL VARIABLES:
#ifndef ALLOW_EXCH2
C == Local variables ==
C OL[wens] :: Overlap extents in west, east, north, south.
C exchWidth[XY] :: Extent of regions that will be exchanged.
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
#endif
CEOP
#ifdef ALLOW_EXCH2
CALL EXCH2_UV_BGRID_3D_RX(
U uPhi, vPhi,
I withSigns, myNz, myThid )
#else /* ALLOW_EXCH2 */
OLw = OLx
OLe = OLx
OLn = OLy
OLs = OLy
exchWidthX = OLx
exchWidthY = OLy
IF ( useCubedSphereExchange ) THEN
C--- using CubedSphereExchange:
CALL EXCH1_BG_RX_CUBE(
U uPhi, vPhi,
I withSigns,
I OLw, OLe, OLs, OLn, myNz,
I exchWidthX, exchWidthY,
I EXCH_UPDATE_CORNERS, myThid )
ELSE
C--- not using CubedSphereExchange:
#ifdef DISCONNECTED_TILES
CALL EXCH0_RX( uPhi,
I OLw, OLe, OLs, OLn, myNz,
I exchWidthX, exchWidthY,
I EXCH_UPDATE_CORNERS, myThid )
CALL EXCH0_RX( vPhi,
I OLw, OLe, OLs, OLn, myNz,
I exchWidthX, exchWidthY,
I EXCH_UPDATE_CORNERS, myThid )
#else /* DISCONNECTED_TILES */
CALL EXCH1_RX( uPhi,
I OLw, OLe, OLs, OLn, myNz,
I exchWidthX, exchWidthY,
I EXCH_UPDATE_CORNERS, myThid )
CALL EXCH1_RX( vPhi,
I OLw, OLe, OLs, OLn, myNz,
I exchWidthX, exchWidthY,
I EXCH_UPDATE_CORNERS, myThid )
#endif /* DISCONNECTED_TILES */
C--- using or not using CubedSphereExchange: end
ENDIF
#endif /* ALLOW_EXCH2 */
RETURN
END
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
CEH3 ;;; Local Variables: ***
CEH3 ;;; mode:fortran ***
CEH3 ;;; End: ***