1 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_set_obcs.F,v 1.16 2009/09/01 19:37:46 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
|
6 |
C-- File exf_set_obcs.F: |
7 |
C-- Contents |
8 |
C-- o EXF_SET_OBCS_XZ |
9 |
C-- o EXF_SET_OBCS_YZ |
10 |
C-- o EXF_SET_OBCS_X <- no longer maintained ; use SET_OBCS_XZ with nNz=1 |
11 |
C-- o EXF_SET_OBCS_Y <- no longer maintained ; use SET_OBCS_YZ with nNz=1 |
12 |
|
13 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
14 |
|
15 |
SUBROUTINE EXF_SET_OBCS_XZ ( |
16 |
U obcs_fld_xz, obcs_xz_0, obcs_xz_1, |
17 |
I obcs_file, obcsmask, nNz, |
18 |
I fac, first, changed, useYearlyFields, obcs_period, |
19 |
I count0, count1, year0, year1, |
20 |
I myTime, myIter, myThid ) |
21 |
|
22 |
C ================================================================== |
23 |
C SUBROUTINE EXF_SET_OBCS_XZ |
24 |
C ================================================================== |
25 |
C |
26 |
C o set open boundary conditions |
27 |
C |
28 |
C started: heimbach@mit.edu 01-May-2001 |
29 |
C mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002 |
30 |
|
31 |
C ================================================================== |
32 |
C SUBROUTINE EXF_SET_OBCS_XZ |
33 |
C ================================================================== |
34 |
|
35 |
IMPLICIT NONE |
36 |
|
37 |
C == global variables == |
38 |
#include "EEPARAMS.h" |
39 |
#include "SIZE.h" |
40 |
#include "GRID.h" |
41 |
#include "EXF_PARAM.h" |
42 |
#include "EXF_CONSTANTS.h" |
43 |
|
44 |
C == routine arguments == |
45 |
C nNz :: number of levels to process |
46 |
INTEGER nNz |
47 |
_RL obcs_fld_xz(1-OLx:sNx+OLx,nNz,nSx,nSy) |
48 |
_RL obcs_xz_0(1-OLx:sNx+OLx,nNz,nSx,nSy) |
49 |
_RL obcs_xz_1(1-OLx:sNx+OLx,nNz,nSx,nSy) |
50 |
|
51 |
CHARACTER*(128) obcs_file |
52 |
CHARACTER*1 obcsmask |
53 |
LOGICAL first, changed |
54 |
LOGICAL useYearlyFields |
55 |
_RL obcs_period |
56 |
INTEGER count0, count1, year0, year1 |
57 |
_RL fac |
58 |
_RL myTime |
59 |
INTEGER myIter |
60 |
INTEGER myThid |
61 |
|
62 |
#ifdef ALLOW_OBCS |
63 |
|
64 |
C == local variables == |
65 |
|
66 |
CHARACTER*(128) obcs_file0, obcs_file1 |
67 |
INTEGER bi, bj |
68 |
INTEGER i, k |
69 |
|
70 |
C == end of interface == |
71 |
|
72 |
IF ( obcs_file .NE. ' ' ) THEN |
73 |
|
74 |
IF ( first ) THEN |
75 |
|
76 |
CALL exf_GetYearlyFieldName( |
77 |
I useYearlyFields, twoDigitYear, obcs_period, year0, |
78 |
I obcs_file, |
79 |
O obcs_file0, |
80 |
I myTime, myIter, myThid ) |
81 |
|
82 |
_BARRIER |
83 |
CALL READ_REC_XZ_RL( obcs_file0, exf_iprec_obcs, nNz, |
84 |
& obcs_xz_1, count0, myIter, myThid ) |
85 |
_BARRIER |
86 |
ENDIF |
87 |
|
88 |
IF ( first .OR. changed ) THEN |
89 |
CALL exf_swapffields_xz( obcs_xz_0, obcs_xz_1, nNz,myThid ) |
90 |
|
91 |
CALL exf_GetYearlyFieldName( |
92 |
I useYearlyFields, twoDigitYear, obcs_period, year1, |
93 |
I obcs_file, |
94 |
O obcs_file1, |
95 |
I myTime, myIter, myThid ) |
96 |
|
97 |
_BARRIER |
98 |
CALL READ_REC_XZ_RL( obcs_file1, exf_iprec_obcs, nNz, |
99 |
& obcs_xz_1, count1, myIter, myThid ) |
100 |
_BARRIER |
101 |
ENDIF |
102 |
|
103 |
DO bj = myByLo(myThid),myByHi(myThid) |
104 |
DO bi = myBxLo(myThid),myBxHi(myThid) |
105 |
DO k = 1,nNz |
106 |
DO i = 1,sNx |
107 |
obcs_fld_xz(i,k,bi,bj) = |
108 |
& fac * obcs_xz_0(i,k,bi,bj) + |
109 |
& (exf_one - fac) * obcs_xz_1(i,k,bi,bj) |
110 |
ENDDO |
111 |
ENDDO |
112 |
ENDDO |
113 |
ENDDO |
114 |
|
115 |
ENDIF |
116 |
|
117 |
#endif /* ALLOW_OBCS */ |
118 |
|
119 |
RETURN |
120 |
END |
121 |
|
122 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
123 |
|
124 |
SUBROUTINE EXF_SET_OBCS_YZ ( |
125 |
U obcs_fld_yz, obcs_yz_0, obcs_yz_1, |
126 |
I obcs_file, obcsmask, nNz, |
127 |
I fac, first, changed, useYearlyFields, obcs_period, |
128 |
I count0, count1, year0, year1, |
129 |
I myTime, myIter, myThid) |
130 |
|
131 |
C ================================================================== |
132 |
C SUBROUTINE EXF_SET_OBCS_YZ |
133 |
C ================================================================== |
134 |
C |
135 |
C o set open boundary conditions |
136 |
C |
137 |
C started: heimbach@mit.edu 01-May-2001 |
138 |
|
139 |
C ================================================================== |
140 |
C SUBROUTINE EXF_SET_OBCS_YZ |
141 |
C ================================================================== |
142 |
|
143 |
IMPLICIT NONE |
144 |
|
145 |
C == global variables == |
146 |
#include "EEPARAMS.h" |
147 |
#include "SIZE.h" |
148 |
#include "GRID.h" |
149 |
#include "EXF_PARAM.h" |
150 |
#include "EXF_CONSTANTS.h" |
151 |
|
152 |
C == routine arguments == |
153 |
C nNz :: number of levels to process |
154 |
INTEGER nNz |
155 |
_RL obcs_fld_yz(1-OLy:sNy+OLy,nNz,nSx,nSy) |
156 |
_RL obcs_yz_0(1-OLy:sNy+OLy,nNz,nSx,nSy) |
157 |
_RL obcs_yz_1(1-OLy:sNy+OLy,nNz,nSx,nSy) |
158 |
CHARACTER*(MAX_LEN_FNAM) obcs_file |
159 |
CHARACTER*1 obcsmask |
160 |
LOGICAL first, changed |
161 |
LOGICAL useYearlyFields |
162 |
_RL obcs_period |
163 |
INTEGER count0, count1, year0, year1 |
164 |
_RL fac |
165 |
_RL myTime |
166 |
INTEGER myIter |
167 |
INTEGER myThid |
168 |
|
169 |
#ifdef ALLOW_OBCS |
170 |
|
171 |
C == local variables == |
172 |
|
173 |
CHARACTER*(128) obcs_file0, obcs_file1 |
174 |
INTEGER bi, bj |
175 |
INTEGER j, k |
176 |
|
177 |
C == end of interface == |
178 |
|
179 |
IF ( obcs_file .NE. ' ' ) THEN |
180 |
|
181 |
IF ( first ) THEN |
182 |
|
183 |
CALL exf_GetYearlyFieldName( |
184 |
I useYearlyFields, twoDigitYear, obcs_period, year0, |
185 |
I obcs_file, |
186 |
O obcs_file0, |
187 |
I myTime, myIter, myThid ) |
188 |
|
189 |
_BARRIER |
190 |
CALL READ_REC_YZ_RL( obcs_file0, exf_iprec_obcs, nNz, |
191 |
& obcs_yz_1, count0, myIter, myThid ) |
192 |
_BARRIER |
193 |
ENDIF |
194 |
|
195 |
IF ( first .OR. changed ) THEN |
196 |
CALL exf_swapffields_yz( obcs_yz_0, obcs_yz_1, nNz,myThid ) |
197 |
|
198 |
CALL exf_GetYearlyFieldName( |
199 |
I useYearlyFields, twoDigitYear, obcs_period, year1, |
200 |
I obcs_file, |
201 |
O obcs_file1, |
202 |
I myTime, myIter, myThid ) |
203 |
|
204 |
_BARRIER |
205 |
CALL READ_REC_YZ_RL( obcs_file1, exf_iprec_obcs, nNz, |
206 |
& obcs_yz_1, count1, myIter, myThid ) |
207 |
_BARRIER |
208 |
ENDIF |
209 |
|
210 |
DO bj = myByLo(myThid),myByHi(myThid) |
211 |
DO bi = myBxLo(myThid),myBxHi(myThid) |
212 |
DO k = 1,nNz |
213 |
DO j = 1,sNy |
214 |
obcs_fld_yz(j,k,bi,bj) = |
215 |
& fac *obcs_yz_0(j,k,bi,bj) + |
216 |
& (exf_one - fac) *obcs_yz_1(j,k,bi,bj) |
217 |
ENDDO |
218 |
ENDDO |
219 |
ENDDO |
220 |
ENDDO |
221 |
|
222 |
ENDIF |
223 |
|
224 |
#endif /* ALLOW_OBCS */ |
225 |
|
226 |
RETURN |
227 |
END |
228 |
|
229 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
230 |
|
231 |
SUBROUTINE EXF_SET_OBCS_X ( |
232 |
U obcs_fld_x, obcs_x_0, obcs_x_1, |
233 |
I obcs_file, obcsmask, |
234 |
I fac, first, changed, useYearlyFields, obcs_period, |
235 |
I count0, count1, year0, year1, |
236 |
I myTime, myIter, myThid ) |
237 |
|
238 |
C ================================================================== |
239 |
C SUBROUTINE EXF_SET_OBCS_X |
240 |
C ================================================================== |
241 |
C |
242 |
C o set open boundary conditions |
243 |
C same as EXF_SET_OBCS_XZ but for Nr=1 |
244 |
C |
245 |
C ================================================================== |
246 |
C SUBROUTINE EXF_SET_OBCS_X |
247 |
C ================================================================== |
248 |
|
249 |
IMPLICIT NONE |
250 |
|
251 |
C == global variables == |
252 |
|
253 |
#include "EEPARAMS.h" |
254 |
#include "SIZE.h" |
255 |
#include "GRID.h" |
256 |
#include "EXF_PARAM.h" |
257 |
#include "EXF_CONSTANTS.h" |
258 |
|
259 |
C == routine arguments == |
260 |
|
261 |
_RL obcs_fld_x(1-OLx:sNx+OLx,nSx,nSy) |
262 |
_RL obcs_x_0(1-OLx:sNx+OLx,nSx,nSy) |
263 |
_RL obcs_x_1(1-OLx:sNx+OLx,nSx,nSy) |
264 |
|
265 |
CHARACTER*(128) obcs_file |
266 |
CHARACTER*1 obcsmask |
267 |
LOGICAL first, changed |
268 |
LOGICAL useYearlyFields |
269 |
_RL obcs_period |
270 |
INTEGER count0, count1, year0, year1 |
271 |
_RL fac |
272 |
_RL myTime |
273 |
INTEGER myIter |
274 |
INTEGER myThid |
275 |
|
276 |
#ifdef ALLOW_OBCS |
277 |
|
278 |
C == local variables == |
279 |
|
280 |
CHARACTER*(128) obcs_file0, obcs_file1 |
281 |
INTEGER bi, bj, i |
282 |
|
283 |
C == end of interface == |
284 |
|
285 |
STOP 'S/R EXF_SET_OBCS_X no longer maintained' |
286 |
|
287 |
IF ( obcs_file .NE. ' ' ) THEN |
288 |
|
289 |
IF ( first ) THEN |
290 |
|
291 |
CALL exf_GetYearlyFieldName( |
292 |
I useYearlyFields, twoDigitYear, obcs_period, year0, |
293 |
I obcs_file, |
294 |
O obcs_file0, |
295 |
I myTime, myIter, myThid ) |
296 |
|
297 |
CALL READ_REC_XZ_RL( obcs_file0, exf_iprec_obcs, 1, |
298 |
& obcs_x_1, count0, myIter, myThid ) |
299 |
ENDIF |
300 |
|
301 |
IF (( first ) .OR. ( changed )) THEN |
302 |
CALL exf_swapffields_xz( obcs_x_0, obcs_x_1, 1,myThid ) |
303 |
|
304 |
CALL exf_GetYearlyFieldName( |
305 |
I useYearlyFields, twoDigitYear, obcs_period, year1, |
306 |
I obcs_file, |
307 |
O obcs_file1, |
308 |
I myTime, myIter, myThid ) |
309 |
|
310 |
CALL READ_REC_XZ_RL( obcs_file1, exf_iprec_obcs, 1, |
311 |
& obcs_x_1, count1, myIter, myThid ) |
312 |
ENDIF |
313 |
|
314 |
DO bj = myByLo(myThid),myByHi(myThid) |
315 |
DO bi = myBxLo(myThid),myBxHi(myThid) |
316 |
DO i = 1,sNx |
317 |
obcs_fld_x(i,bi,bj) = |
318 |
& fac * obcs_x_0(i,bi,bj) + |
319 |
& (exf_one - fac) * obcs_x_1(i,bi,bj) |
320 |
ENDDO |
321 |
ENDDO |
322 |
ENDDO |
323 |
|
324 |
ENDIF |
325 |
|
326 |
#endif /* ALLOW_OBCS */ |
327 |
|
328 |
RETURN |
329 |
END |
330 |
|
331 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
332 |
|
333 |
SUBROUTINE EXF_SET_OBCS_Y ( |
334 |
U obcs_fld_y, obcs_y_0, obcs_y_1, |
335 |
I obcs_file, obcsmask, |
336 |
I fac, first, changed, useYearlyFields, obcs_period, |
337 |
I count0, count1, year0, year1, |
338 |
I myTime, myIter, myThid ) |
339 |
|
340 |
C ================================================================== |
341 |
C SUBROUTINE EXF_SET_OBCS_Y |
342 |
C ================================================================== |
343 |
C |
344 |
C o set open boundary conditions |
345 |
C same as EXF_SET_OBCS_YZ but for Nr=1 |
346 |
C |
347 |
C ================================================================== |
348 |
C SUBROUTINE EXF_SET_OBCS_Y |
349 |
C ================================================================== |
350 |
|
351 |
IMPLICIT NONE |
352 |
|
353 |
C == global variables == |
354 |
|
355 |
#include "EEPARAMS.h" |
356 |
#include "SIZE.h" |
357 |
#include "GRID.h" |
358 |
#include "EXF_PARAM.h" |
359 |
#include "EXF_CONSTANTS.h" |
360 |
|
361 |
C == routine arguments == |
362 |
|
363 |
_RL obcs_fld_y(1-OLy:sNy+OLy,nSx,nSy) |
364 |
_RL obcs_y_0(1-OLy:sNy+OLy,nSx,nSy) |
365 |
_RL obcs_y_1(1-OLy:sNy+OLy,nSx,nSy) |
366 |
CHARACTER*(MAX_LEN_FNAM) obcs_file |
367 |
CHARACTER*1 obcsmask |
368 |
LOGICAL first, changed |
369 |
LOGICAL useYearlyFields |
370 |
_RL obcs_period |
371 |
INTEGER count0, count1, year0, year1 |
372 |
_RL fac |
373 |
_RL myTime |
374 |
INTEGER myIter |
375 |
INTEGER myThid |
376 |
|
377 |
#ifdef ALLOW_OBCS |
378 |
|
379 |
C == local variables == |
380 |
|
381 |
CHARACTER*(128) obcs_file0, obcs_file1 |
382 |
INTEGER bi, bj, j |
383 |
|
384 |
C == end of interface == |
385 |
|
386 |
STOP 'S/R EXF_SET_OBCS_X no longer maintained' |
387 |
|
388 |
IF ( obcs_file .NE. ' ' ) THEN |
389 |
|
390 |
IF ( first ) THEN |
391 |
|
392 |
CALL exf_GetYearlyFieldName( |
393 |
I useYearlyFields, twoDigitYear, obcs_period, year0, |
394 |
I obcs_file, |
395 |
O obcs_file0, |
396 |
I myTime, myIter, myThid ) |
397 |
|
398 |
CALL READ_REC_YZ_RL( obcs_file0, exf_iprec_obcs, 1, |
399 |
& obcs_y_1, count0, myIter, myThid ) |
400 |
ENDIF |
401 |
|
402 |
IF (( first ) .OR. ( changed )) THEN |
403 |
CALL exf_swapffields_yz( obcs_y_0, obcs_y_1, 1,myThid ) |
404 |
|
405 |
CALL exf_GetYearlyFieldName( |
406 |
I useYearlyFields, twoDigitYear, obcs_period, year1, |
407 |
I obcs_file, |
408 |
O obcs_file1, |
409 |
I myTime, myIter, myThid ) |
410 |
|
411 |
CALL READ_REC_YZ_RL( obcs_file1, exf_iprec_obcs, 1, |
412 |
& obcs_y_1, count1, myIter, myThid ) |
413 |
ENDIF |
414 |
|
415 |
DO bj = myByLo(myThid),myByHi(myThid) |
416 |
DO bi = myBxLo(myThid),myBxHi(myThid) |
417 |
DO j = 1,sNy |
418 |
obcs_fld_y(j,bi,bj) = |
419 |
& fac *obcs_y_0(j,bi,bj) + |
420 |
& (exf_one - fac) *obcs_y_1(j,bi,bj) |
421 |
ENDDO |
422 |
ENDDO |
423 |
ENDDO |
424 |
|
425 |
ENDIF |
426 |
|
427 |
#endif /* ALLOW_OBCS */ |
428 |
|
429 |
RETURN |
430 |
END |