/[MITgcm]/MITgcm/eesupp/src/fill_cs_corner_uv_rs.F
ViewVC logotype

Annotation of /MITgcm/eesupp/src/fill_cs_corner_uv_rs.F

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


Revision 1.4 - (hide annotations) (download)
Sun Jun 28 01:02:17 2009 UTC (14 years, 10 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, checkpoint62, 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, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61s, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.3: +7 -7 lines
add bj in exch2 arrays and S/R

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/eesupp/src/fill_cs_corner_uv_rs.F,v 1.3 2009/05/12 19:53:03 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "PACKAGES_CONFIG.h"
5     #include "CPP_EEOPTIONS.h"
6    
7     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
8     CBOP
9     C !ROUTINE: FILL_CS_CORNER_UV_RS
10    
11     C !INTERFACE:
12     SUBROUTINE FILL_CS_CORNER_UV_RS(
13     I withSigns,
14     U uFld, vFld,
15     I bi,bj, myThid)
16     IMPLICIT NONE
17    
18     C !DESCRIPTION:
19     C *==========================================================*
20     C | SUBROUTINE FILL_CS_CORNER_UV_RS
21 jmc 1.4 C | o Fill the corner-halo region of CS-grid,
22 jmc 1.1 C | for a 2 components, C-grid vector field
23     C *==========================================================*
24     C | o the corner halo region is filled with valid values
25     C | in order to extend in X and Y direction calculations
26     C | of fluxes, on a wide stencil.
27     C *==========================================================*
28    
29     C !USES:
30     C == Global variables ==
31    
32     #include "SIZE.h"
33     #include "EEPARAMS.h"
34     #ifdef ALLOW_EXCH2
35 jmc 1.3 #include "W2_EXCH2_SIZE.h"
36 jmc 1.1 #include "W2_EXCH2_TOPOLOGY.h"
37     #endif /* ALLOW_EXCH2 */
38    
39     C !INPUT/OUTPUT PARAMETERS:
40     C == Routine arguments ==
41 jmc 1.4 C
42 jmc 1.1 C withSigns :: uFld,vFld are vector components
43     C uFld :: u-component, at C-grid West point location
44     C vFld :: v-component, at C-grid SOuth point location
45     C bi,bj :: tile indices
46     C myThid :: thread number
47     LOGICAL withSigns
48     _RS uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49     _RS vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50     INTEGER bi,bj
51     INTEGER myThid
52    
53     C !LOCAL VARIABLES:
54     C == Local variables ==
55     C i,j :: loop indices
56     C myTile :: tile number
57     INTEGER i,j
58     LOGICAL southWestCorner
59     LOGICAL southEastCorner
60     LOGICAL northWestCorner
61     LOGICAL northEastCorner
62     _RL negOne
63 jmc 1.2 #ifdef ALLOW_EXCH2
64     INTEGER myTile
65     #endif
66 jmc 1.1 CEOP
67    
68     IF (useCubedSphereExchange) THEN
69    
70     negOne = 1. _d 0
71     IF (withSigns) negOne = -1. _d 0
72    
73     #ifdef ALLOW_EXCH2
74 jmc 1.4 myTile = W2_myTileList(bi,bj)
75 jmc 1.1 southWestCorner = exch2_isWedge(myTile).EQ.1
76     & .AND. exch2_isSedge(myTile).EQ.1
77     southEastCorner = exch2_isEedge(myTile).EQ.1
78     & .AND. exch2_isSedge(myTile).EQ.1
79     northEastCorner = exch2_isEedge(myTile).EQ.1
80     & .AND. exch2_isNedge(myTile).EQ.1
81     northWestCorner = exch2_isWedge(myTile).EQ.1
82     & .AND. exch2_isNedge(myTile).EQ.1
83     #else
84     southWestCorner = .TRUE.
85     southEastCorner = .TRUE.
86     northWestCorner = .TRUE.
87     northEastCorner = .TRUE.
88     #endif
89    
90     C-- To extend calculations in X direction, fill uFld array
91     C with valid value in the corner.
92     C e.g., NW corner: copy V( 0,sNy ) into U( -1,sNy+1)
93     C copy V( 0,sNy-1) into U( -2,sNy+1)
94     C copy V( -1,sNy ) into U( -1,sNy+2)
95     C copy V( -1,sNy-1) into U( -2,sNy+2)
96     C | |
97     C U(-1,sNy+1) U(1,sNy+1) U(2,sNy+1)
98     C | ^ | |
99     C -----|--\--------corner----------|
100     C | \ | |
101 jmc 1.4 C | \ |
102     C | \ |
103 jmc 1.1 C -----|---V(0,sNy)--|---------------
104     C | |
105     C
106     C-- to extend calculations in Y direction, fill vFld array
107     C with valid value in the corner.
108     C e.g., NW corner: copy U( 2,sNy+1) into V( 0,sNy+2)
109     C copy U( 3,sNy+1) into V( 0,sNy+3)
110     C copy U( 2,sNy+2) into V( -1,sNy+2)
111     C copy U( 3,sNy+2) into V( -1,sNy+3)
112     C | | |
113     C -----|--V(0,sNy+2)--|--------------|
114     C | ^====================\
115     C U(-1,sNy+1) U(1,sNy+1) U(2,sNy+1)
116     C | | |
117     C -----|--V(0,sNy+1)--o--------------|
118     C | |\ |
119     C | | \=corner
120 jmc 1.4 C | |
121 jmc 1.1 C -----|--V(0,sNy)----|--
122     C | |
123     C
124    
125     IF ( southWestCorner ) THEN
126     C- prepare for direction X:
127     DO j=1,OLy
128     DO i=1,OLx
129     uFld( 1-i , 1-j ) = negOne*vFld( 1-j , 1+i )
130     ENDDO
131     ENDDO
132     C- prepare for direction Y:
133     DO j=1,OLy
134     DO i=1,OLx
135     vFld( 1-i , 1-j ) = negOne*uFld( 1+j , 1-i )
136     ENDDO
137     ENDDO
138     ENDIF
139    
140     IF ( southEastCorner ) THEN
141     C- prepare for direction X:
142     DO j=1,OLy
143     DO i=2,OLx
144     uFld(sNx+i, 1-j ) = vFld(sNx+j, i )
145     ENDDO
146     ENDDO
147     C- prepare for direction Y:
148     DO j=1,OLy
149     DO i=1,OLx
150     vFld(sNx+i, 1-j ) = uFld(sNx+1-j, 1-i )
151     ENDDO
152     ENDDO
153     ENDIF
154    
155     IF ( northWestCorner ) THEN
156     C- prepare for direction X:
157     DO j=1,OLy
158     DO i=1,OLx
159     uFld( 1-i ,sNy+j) = vFld( 1-j , sNy+1-i )
160     ENDDO
161     ENDDO
162     C- prepare for direction Y:
163     DO j=2,OLy
164     DO i=1,OLx
165     vFld( 1-i ,sNy+j) = uFld( j , sNy+i )
166     ENDDO
167     ENDDO
168     ENDIF
169    
170     IF ( northEastCorner ) THEN
171     C- prepare for direction X:
172     DO j=1,OLy
173     DO i=2,OLx
174     uFld(sNx+i,sNy+j) = negOne*vFld(sNx+j, sNy+2-i )
175     ENDDO
176     ENDDO
177     C- prepare for direction Y:
178     DO j=2,OLy
179     DO i=1,OLx
180     vFld(sNx+i,sNy+j) = negOne*uFld(sNx+2-j, sNy+i )
181     ENDDO
182     ENDDO
183     ENDIF
184    
185     C-- End useCubedSphereExchange
186     ENDIF
187    
188     RETURN
189     END

  ViewVC Help
Powered by ViewVC 1.1.22