1 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_swapffields.F,v 1.6 2007/10/11 01:29:16 dimitri Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
|
6 |
C-- File exf_swapffields.F: Routines to swap 2 fields |
7 |
C-- Contents |
8 |
C-- o EXF_SWAPFFIELDS |
9 |
C-- o EXF_SWAPFFIELDS_3D |
10 |
C-- o EXF_SWAPFFIELDS_XZ |
11 |
C-- o EXF_SWAPFFIELDS_YZ |
12 |
|
13 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
14 |
|
15 |
SUBROUTINE EXF_SWAPFFIELDS( |
16 |
O ffld0, |
17 |
U ffld1, |
18 |
I myThid ) |
19 |
|
20 |
C ================================================================== |
21 |
C SUBROUTINE exf_SwapFFields |
22 |
C ================================================================== |
23 |
C |
24 |
C o Copy a forcing field ffld1 to ffld0 and set ffld0 to zero. |
25 |
C |
26 |
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
27 |
C |
28 |
C changed: Christian Eckert eckert@mit.edu 14-Jan-2000 |
29 |
C |
30 |
C - Restructured the code in order to create a package |
31 |
C for the MITgcmUV. |
32 |
C |
33 |
C Christian Eckert eckert@mit.edu 12-Feb-2000 |
34 |
C |
35 |
C - Changed Routine names (package prefix: exf_) |
36 |
C |
37 |
C ================================================================== |
38 |
C SUBROUTINE exf_SwapFFields |
39 |
C ================================================================== |
40 |
|
41 |
IMPLICIT NONE |
42 |
|
43 |
C == global variables == |
44 |
#include "EEPARAMS.h" |
45 |
#include "SIZE.h" |
46 |
|
47 |
C == routine arguments == |
48 |
_RL ffld0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
49 |
_RL ffld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
50 |
INTEGER myThid |
51 |
|
52 |
C == local variables == |
53 |
INTEGER bi, bj |
54 |
INTEGER i, j |
55 |
|
56 |
C == end of interface == |
57 |
|
58 |
DO bj=myByLo(myThid),myByHi(myThid) |
59 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
60 |
DO j = 1,sNy |
61 |
DO i = 1,sNx |
62 |
ffld0(i,j,bi,bj) = ffld1(i,j,bi,bj) |
63 |
ffld1(i,j,bi,bj) = 0. _d 0 |
64 |
ENDDO |
65 |
ENDDO |
66 |
ENDDO |
67 |
ENDDO |
68 |
|
69 |
RETURN |
70 |
END |
71 |
|
72 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
73 |
|
74 |
SUBROUTINE EXF_SWAPFFIELDS_3D( |
75 |
O ffld0, |
76 |
U ffld1, |
77 |
I nNz, myThid ) |
78 |
|
79 |
C ================================================================== |
80 |
C SUBROUTINE exf_SwapFFields_3d |
81 |
C ================================================================== |
82 |
C |
83 |
C o Copy a forcing field ffld1 to ffld0 and set ffld0 to zero. |
84 |
C |
85 |
C ================================================================== |
86 |
C SUBROUTINE exf_SwapFFields |
87 |
C ================================================================== |
88 |
|
89 |
IMPLICIT NONE |
90 |
|
91 |
C == global variables == |
92 |
#include "EEPARAMS.h" |
93 |
#include "SIZE.h" |
94 |
|
95 |
C == routine arguments == |
96 |
C nNz :: number of levels to process |
97 |
INTEGER nNz |
98 |
_RL ffld0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) |
99 |
_RL ffld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) |
100 |
INTEGER myThid |
101 |
|
102 |
C == local variables == |
103 |
INTEGER bi, bj |
104 |
INTEGER i, j, k |
105 |
|
106 |
C == end of interface == |
107 |
|
108 |
DO bj=myByLo(myThid),myByHi(myThid) |
109 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
110 |
DO k = 1,nNz |
111 |
DO j = 1,sNy |
112 |
DO i = 1,sNx |
113 |
ffld0(i,j,k,bi,bj) = ffld1(i,j,k,bi,bj) |
114 |
ffld1(i,j,k,bi,bj) = 0. _d 0 |
115 |
ENDDO |
116 |
ENDDO |
117 |
ENDDO |
118 |
ENDDO |
119 |
ENDDO |
120 |
|
121 |
RETURN |
122 |
END |
123 |
|
124 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
125 |
|
126 |
SUBROUTINE EXF_SWAPFFIELDS_XZ( |
127 |
O ffld0, |
128 |
U ffld1, |
129 |
I nNz, myThid ) |
130 |
|
131 |
C ================================================================== |
132 |
C SUBROUTINE exf_swapffields_xz |
133 |
C ================================================================== |
134 |
C |
135 |
C o Copy a forcing field ffld1 to ffld0 and set ffld0 to zero. |
136 |
C |
137 |
C started: heimbach@mit.edu 01-May-2001 |
138 |
C |
139 |
C ================================================================== |
140 |
C SUBROUTINE exf_swapffields_xz |
141 |
C ================================================================== |
142 |
|
143 |
IMPLICIT NONE |
144 |
|
145 |
C == global variables == |
146 |
#include "EEPARAMS.h" |
147 |
#include "SIZE.h" |
148 |
|
149 |
C == routine arguments == |
150 |
C nNz :: number of levels to process |
151 |
INTEGER nNz |
152 |
_RL ffld0(1-OLx:sNx+OLx,nNz,nSx,nSy) |
153 |
_RL ffld1(1-OLx:sNx+OLx,nNz,nSx,nSy) |
154 |
INTEGER myThid |
155 |
|
156 |
C == local variables == |
157 |
INTEGER bi, bj |
158 |
INTEGER i, k |
159 |
|
160 |
C == end of interface == |
161 |
|
162 |
DO bj=myByLo(myThid),myByHi(myThid) |
163 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
164 |
DO k = 1,nNz |
165 |
DO i = 1,sNx |
166 |
ffld0(i,k,bi,bj) = ffld1(i,k,bi,bj) |
167 |
ffld1(i,k,bi,bj) = 0. _d 0 |
168 |
ENDDO |
169 |
ENDDO |
170 |
ENDDO |
171 |
ENDDO |
172 |
|
173 |
RETURN |
174 |
END |
175 |
|
176 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
177 |
|
178 |
SUBROUTINE EXF_SWAPFFIELDS_YZ( |
179 |
O ffld0, |
180 |
U ffld1, |
181 |
I nNz, myThid ) |
182 |
|
183 |
C ================================================================== |
184 |
C SUBROUTINE exf_swapffields_yz |
185 |
C ================================================================== |
186 |
C |
187 |
C o Copy a forcing field ffld1 to ffld0 and set ffld0 to zero. |
188 |
C |
189 |
C started: heimbach@mit.edu 01-May-2001 |
190 |
C |
191 |
C ================================================================== |
192 |
C SUBROUTINE exf_swapffields_yz |
193 |
C ================================================================== |
194 |
|
195 |
IMPLICIT NONE |
196 |
|
197 |
C == global variables == |
198 |
#include "EEPARAMS.h" |
199 |
#include "SIZE.h" |
200 |
|
201 |
C == routine arguments == |
202 |
C nNz :: number of levels to process |
203 |
INTEGER nNz |
204 |
_RL ffld0(1-OLy:sNy+OLy,nNz,nSx,nSy) |
205 |
_RL ffld1(1-OLy:sNy+OLy,nNz,nSx,nSy) |
206 |
INTEGER myThid |
207 |
|
208 |
C == local variables == |
209 |
INTEGER bi, bj |
210 |
INTEGER j, k |
211 |
|
212 |
C == end of interface == |
213 |
|
214 |
DO bj=myByLo(myThid),myByHi(myThid) |
215 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
216 |
DO k = 1,nNz |
217 |
DO j = 1,sNy |
218 |
ffld0(j,k,bi,bj) = ffld1(j,k,bi,bj) |
219 |
ffld1(j,k,bi,bj) = 0. _d 0 |
220 |
ENDDO |
221 |
ENDDO |
222 |
ENDDO |
223 |
ENDDO |
224 |
|
225 |
RETURN |
226 |
END |