1 |
C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_exf_load.F,v 1.4 2011/09/02 18:23:57 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
# include "OBCS_OPTIONS.h" |
5 |
|
6 |
C-- File obcs_exf_load.F: Routines to read of OBC fields with EXF |
7 |
C-- Contents |
8 |
C-- o OBCS_EXF_LOAD |
9 |
C-- o OBCS_EXF_READ_XZ |
10 |
C-- o OBCS_EXF_READ_YZ |
11 |
|
12 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
13 |
|
14 |
CBOP |
15 |
C !ROUTINE: OBCS_EXF_LOAD |
16 |
C !INTERFACE: |
17 |
SUBROUTINE OBCS_EXF_LOAD ( |
18 |
I myTime, myIter, myThid ) |
19 |
|
20 |
C !DESCRIPTION: |
21 |
C *==================================================================* |
22 |
C | SUBROUTINE OBCS_EXF_LOAD |
23 |
C *==================================================================* |
24 |
C | read open boundary conditions from file |
25 |
C | N.B.: * uses exf and cal routines for file/record handling |
26 |
C | * uses ctrl routines for control variable handling |
27 |
C *==================================================================* |
28 |
|
29 |
C !DESCRIPTION: |
30 |
C !USES: |
31 |
IMPLICIT NONE |
32 |
C == Global variables == |
33 |
#include "SIZE.h" |
34 |
#include "EEPARAMS.h" |
35 |
#include "PARAMS.h" |
36 |
#include "OBCS_PARAMS.h" |
37 |
c#include "OBCS_GRID.h" |
38 |
#include "OBCS_FIELDS.h" |
39 |
#include "OBCS_SEAICE.h" |
40 |
#ifdef ALLOW_EXF |
41 |
# include "EXF_PARAM.h" |
42 |
#endif |
43 |
#ifdef ALLOW_PTRACERS |
44 |
# include "PTRACERS_SIZE.h" |
45 |
# include "OBCS_PTRACERS.h" |
46 |
#endif /* ALLOW_PTRACERS */ |
47 |
|
48 |
C !INPUT/OUTPUT PARAMETERS: |
49 |
_RL myTime |
50 |
INTEGER myIter |
51 |
INTEGER myThid |
52 |
CEOP |
53 |
|
54 |
#if (defined (ALLOW_EXF) && defined (ALLOW_OBCS_PRESCRIBE)) |
55 |
C !LOCAL VARIABLES: |
56 |
|
57 |
C == end of interface == |
58 |
|
59 |
# ifdef ALLOW_OBCS_NORTH |
60 |
CALL OBCS_EXF_READ_XZ ( |
61 |
I obcsNstartdate, obcsNperiod, |
62 |
I useOBCSYearlyFields, |
63 |
U OBNu, OBNu0, OBNu1, OBNufile, |
64 |
U OBNv, OBNv0, OBNv1, OBNvfile, |
65 |
U OBNt, OBNt0, OBNt1, OBNtfile, |
66 |
U OBNs, OBNs0, OBNs1, OBNsfile, |
67 |
# ifdef NONLIN_FRSURF |
68 |
U OBNeta, OBNeta0, OBNeta1, OBNetafile, |
69 |
# endif |
70 |
# ifdef ALLOW_SEAICE |
71 |
I siobNstartdate, siobNperiod, |
72 |
U OBNa, OBNa0, OBNa1, OBNafile, |
73 |
U OBNh, OBNh0, OBNh1, OBNhfile, |
74 |
U OBNsl, OBNsl0, OBNsl1, OBNslfile, |
75 |
U OBNsn, OBNsn0, OBNsn1, OBNsnfile, |
76 |
U OBNuice,OBNuice0,OBNuice1,OBNuicefile, |
77 |
U OBNvice,OBNvice0,OBNvice1,OBNvicefile, |
78 |
# endif |
79 |
# ifdef ALLOW_PTRACERS |
80 |
U OBNptr ,OBNptr0, OBNptr1, OBNptrFile, |
81 |
# endif |
82 |
I myTime, myIter, myThid ) |
83 |
# endif /* ALLOW_OBCS_NORTH */ |
84 |
|
85 |
# ifdef ALLOW_OBCS_SOUTH |
86 |
CALL OBCS_EXF_READ_XZ ( |
87 |
I obcsSstartdate, obcsSperiod, |
88 |
I useOBCSYearlyFields, |
89 |
U OBSu, OBSu0, OBSu1, OBSufile, |
90 |
U OBSv, OBSv0, OBSv1, OBSvfile, |
91 |
U OBSt, OBSt0, OBSt1, OBStfile, |
92 |
U OBSs, OBSs0, OBSs1, OBSsfile, |
93 |
# ifdef NONLIN_FRSURF |
94 |
U OBSeta, OBSeta0, OBSeta1, OBSetafile, |
95 |
# endif |
96 |
# ifdef ALLOW_SEAICE |
97 |
I siobSstartdate, siobSperiod, |
98 |
U OBSa, OBSa0, OBSa1, OBSafile, |
99 |
U OBSh, OBSh0, OBSh1, OBShfile, |
100 |
U OBSsl, OBSsl0, OBSsl1, OBSslfile, |
101 |
U OBSsn, OBSsn0, OBSsn1, OBSsnfile, |
102 |
U OBSuice,OBSuice0,OBSuice1,OBSuicefile, |
103 |
U OBSvice,OBSvice0,OBSvice1,OBSvicefile, |
104 |
# endif |
105 |
# ifdef ALLOW_PTRACERS |
106 |
U OBSptr ,OBSptr0, OBSptr1, OBSptrFile, |
107 |
# endif |
108 |
I myTime, myIter, myThid ) |
109 |
# endif /* ALLOW_OBCS_SOUTH */ |
110 |
|
111 |
# ifdef ALLOW_OBCS_EAST |
112 |
CALL OBCS_EXF_READ_YZ ( |
113 |
I obcsEstartdate, obcsEperiod, |
114 |
I useOBCSYearlyFields, |
115 |
U OBEu, OBEu0, OBEu1, OBEufile, |
116 |
U OBEv, OBEv0, OBEv1, OBEvfile, |
117 |
U OBEt, OBEt0, OBEt1, OBEtfile, |
118 |
U OBEs, OBEs0, OBEs1, OBEsfile, |
119 |
# ifdef NONLIN_FRSURF |
120 |
U OBEeta, OBEeta0, OBEeta1, OBEetafile, |
121 |
# endif |
122 |
# ifdef ALLOW_SEAICE |
123 |
I siobEstartdate, siobEperiod, |
124 |
U OBEa, OBEa0, OBEa1, OBEafile, |
125 |
U OBEh, OBEh0, OBEh1, OBEhfile, |
126 |
U OBEsl, OBEsl0, OBEsl1, OBEslfile, |
127 |
U OBEsn, OBEsn0, OBEsn1, OBEsnfile, |
128 |
U OBEuice,OBEuice0,OBEuice1,OBEuicefile, |
129 |
U OBEvice,OBEvice0,OBEvice1,OBEvicefile, |
130 |
# endif |
131 |
# ifdef ALLOW_PTRACERS |
132 |
U OBEptr ,OBEptr0, OBEptr1, OBEptrFile, |
133 |
# endif |
134 |
I myTime, myIter, myThid ) |
135 |
# endif /* ALLOW_OBCS_EAST */ |
136 |
|
137 |
# ifdef ALLOW_OBCS_WEST |
138 |
CALL OBCS_EXF_READ_YZ ( |
139 |
I obcsWstartdate, obcsWperiod, |
140 |
I useOBCSYearlyFields, |
141 |
U OBWu, OBWu0, OBWu1, OBWufile, |
142 |
U OBWv, OBWv0, OBWv1, OBWvfile, |
143 |
U OBWt, OBWt0, OBWt1, OBWtfile, |
144 |
U OBWs, OBWs0, OBWs1, OBWsfile, |
145 |
# ifdef NONLIN_FRSURF |
146 |
U OBWeta, OBWeta0, OBWeta1, OBWetafile, |
147 |
# endif |
148 |
# ifdef ALLOW_SEAICE |
149 |
I siobWstartdate, siobWperiod, |
150 |
U OBWa, OBWa0, OBWa1, OBWafile, |
151 |
U OBWh, OBWh0, OBWh1, OBWhfile, |
152 |
U OBWsl, OBWsl0, OBWsl1, OBWslfile, |
153 |
U OBWsn, OBWsn0, OBWsn1, OBWsnfile, |
154 |
U OBWuice,OBWuice0,OBWuice1,OBWuicefile, |
155 |
U OBWvice,OBWvice0,OBWvice1,OBWvicefile, |
156 |
# endif |
157 |
# ifdef ALLOW_PTRACERS |
158 |
U OBWptr ,OBWptr0, OBWptr1, OBWptrFile, |
159 |
# endif |
160 |
I myTime, myIter, myThid ) |
161 |
# endif /* ALLOW_OBCS_WEST */ |
162 |
|
163 |
#endif /* ALLOW_EXF and ALLOW_OBCS_PRESCRIBE */ |
164 |
|
165 |
RETURN |
166 |
END |
167 |
|
168 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
169 |
|
170 |
CBOP |
171 |
C !ROUTINE: OBCS_EXF_READ_XZ |
172 |
C !INTERFACE: |
173 |
SUBROUTINE OBCS_EXF_READ_XZ ( |
174 |
I obcsstartdate, obcsperiod, |
175 |
I useYearlyFields, |
176 |
U OBu, OBu0, OBu1, OBufile, |
177 |
U OBv, OBv0, OBv1, OBvfile, |
178 |
U OBt, OBt0, OBt1, OBtfile, |
179 |
U OBs, OBs0, OBs1, OBsfile, |
180 |
#ifdef NONLIN_FRSURF |
181 |
U OBeta, OBeta0, OBeta1, OBetafile, |
182 |
#endif |
183 |
#ifdef ALLOW_SEAICE |
184 |
I siobstartdate, siobperiod, |
185 |
U OBa, OBa0, OBa1, OBafile, |
186 |
U OBh, OBh0, OBh1, OBhfile, |
187 |
U OBsl, OBsl0, OBsl1, OBslfile, |
188 |
U OBsn, OBsn0, OBsn1, OBsnfile, |
189 |
U OBuice,OBuice0,OBuice1,OBuicefile, |
190 |
U OBvice,OBvice0,OBvice1,OBvicefile, |
191 |
#endif |
192 |
#ifdef ALLOW_PTRACERS |
193 |
U OBptr ,OBptr0, OBptr1, OBptrFile, |
194 |
#endif |
195 |
I myTime, myIter, myThid ) |
196 |
|
197 |
C !DESCRIPTION: |
198 |
C *==================================================================* |
199 |
C | SUBROUTINE OBCS_EXF_READ_XZ |
200 |
C *==================================================================* |
201 |
C | read open boundary conditions from file |
202 |
C | N.B.: * uses exf and cal routines for file/record handling |
203 |
C | * uses ctrl routines for control variable handling |
204 |
C *==================================================================* |
205 |
|
206 |
C !USES: |
207 |
IMPLICIT NONE |
208 |
C == Global variables == |
209 |
#include "SIZE.h" |
210 |
#include "EEPARAMS.h" |
211 |
#include "PARAMS.h" |
212 |
#ifdef ALLOW_EXF |
213 |
# include "EXF_PARAM.h" |
214 |
#endif |
215 |
#ifdef ALLOW_PTRACERS |
216 |
# include "PTRACERS_SIZE.h" |
217 |
# include "PTRACERS_PARAMS.h" |
218 |
#endif /* ALLOW_PTRACERS */ |
219 |
|
220 |
C !INPUT/OUTPUT PARAMETERS: |
221 |
_RL obcsstartdate |
222 |
_RL obcsperiod |
223 |
LOGICAL useYearlyFields |
224 |
_RL OBu (1-Olx:sNx+Olx,Nr,nSx,nSy) |
225 |
_RL OBv (1-Olx:sNx+Olx,Nr,nSx,nSy) |
226 |
_RL OBt (1-Olx:sNx+Olx,Nr,nSx,nSy) |
227 |
_RL OBs (1-Olx:sNx+Olx,Nr,nSx,nSy) |
228 |
_RL OBu0 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
229 |
_RL OBv0 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
230 |
_RL OBt0 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
231 |
_RL OBs0 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
232 |
_RL OBu1 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
233 |
_RL OBv1 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
234 |
_RL OBt1 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
235 |
_RL OBs1 (1-Olx:sNx+Olx,Nr,nSx,nSy) |
236 |
CHARACTER*(MAX_LEN_FNAM) OBuFile,OBvFile,OBtFile,OBsFile |
237 |
#ifdef NONLIN_FRSURF |
238 |
_RL OBeta (1-Olx:sNx+Olx,nSx,nSy) |
239 |
_RL OBeta0 (1-Olx:sNx+Olx,nSx,nSy) |
240 |
_RL OBeta1 (1-Olx:sNx+Olx,nSx,nSy) |
241 |
CHARACTER*(MAX_LEN_FNAM) OBetaFile |
242 |
#endif |
243 |
#ifdef ALLOW_SEAICE |
244 |
_RL siobstartdate |
245 |
_RL siobperiod |
246 |
_RL OBa (1-Olx:sNx+Olx,nSx,nSy) |
247 |
_RL OBh (1-Olx:sNx+Olx,nSx,nSy) |
248 |
_RL OBa0 (1-Olx:sNx+Olx,nSx,nSy) |
249 |
_RL OBh0 (1-Olx:sNx+Olx,nSx,nSy) |
250 |
_RL OBa1 (1-Olx:sNx+Olx,nSx,nSy) |
251 |
_RL OBh1 (1-Olx:sNx+Olx,nSx,nSy) |
252 |
_RL OBsl (1-Olx:sNx+Olx,nSx,nSy) |
253 |
_RL OBsn (1-Olx:sNx+Olx,nSx,nSy) |
254 |
_RL OBsl0 (1-Olx:sNx+Olx,nSx,nSy) |
255 |
_RL OBsn0 (1-Olx:sNx+Olx,nSx,nSy) |
256 |
_RL OBsl1 (1-Olx:sNx+Olx,nSx,nSy) |
257 |
_RL OBsn1 (1-Olx:sNx+Olx,nSx,nSy) |
258 |
_RL OBuice (1-Olx:sNx+Olx,nSx,nSy) |
259 |
_RL OBvice (1-Olx:sNx+Olx,nSx,nSy) |
260 |
_RL OBuice0 (1-Olx:sNx+Olx,nSx,nSy) |
261 |
_RL OBvice0 (1-Olx:sNx+Olx,nSx,nSy) |
262 |
_RL OBuice1 (1-Olx:sNx+Olx,nSx,nSy) |
263 |
_RL OBvice1 (1-Olx:sNx+Olx,nSx,nSy) |
264 |
CHARACTER*(MAX_LEN_FNAM) |
265 |
& OBaFile,OBhFile,OBslFile,OBsnFile,OBuiceFile,OBviceFile |
266 |
#endif /* ALLOW_SEAICE */ |
267 |
#ifdef ALLOW_PTRACERS |
268 |
_RL OBptr (1-Olx:sNx+Olx,Nr,nSx,nSy,PTRACERS_num) |
269 |
_RL OBptr0(1-Olx:sNx+Olx,Nr,nSx,nSy,PTRACERS_num) |
270 |
_RL OBptr1(1-Olx:sNx+Olx,Nr,nSx,nSy,PTRACERS_num) |
271 |
CHARACTER*(MAX_LEN_FNAM) OBptrFile(PTRACERS_num) |
272 |
#endif /* ALLOW_PTRACERS */ |
273 |
_RL myTime |
274 |
INTEGER myIter |
275 |
INTEGER myThid |
276 |
CEOP |
277 |
|
278 |
#if defined ALLOW_OBCS && defined ALLOW_OBCS_PRESCRIBE \ |
279 |
&& defined ALLOW_EXF |
280 |
|
281 |
C !LOCAL VARIABLES: |
282 |
logical first, changed |
283 |
integer count0, count1 |
284 |
integer year0, year1 |
285 |
_RL fac |
286 |
# ifdef ALLOW_PTRACERS |
287 |
integer iTracer |
288 |
# endif /* ALLOW_PTRACERS */ |
289 |
C == end of interface == |
290 |
|
291 |
if ( obcsperiod .eq. -12. _d 0 ) then |
292 |
c obcsperiod=-12 means input file contains 12 monthly means |
293 |
c record numbers are assumed 1 to 12 corresponding to |
294 |
c Jan. through Dec. |
295 |
call cal_GetMonthsRec( |
296 |
O fac, first, changed, |
297 |
O count0, count1, |
298 |
I myTime, myIter, myThid ) |
299 |
|
300 |
elseif ( obcsperiod .lt. 0. _d 0 ) then |
301 |
print *, 'obcsperiod is out of range' |
302 |
STOP 'ABNORMAL END: S/R OBCS_PRESCIBE_EXF_XZ' |
303 |
else |
304 |
c get record numbers and interpolation factor |
305 |
call exf_GetFFieldRec( |
306 |
I obcsstartdate, obcsperiod, |
307 |
I useYearlyFields, |
308 |
O fac, first, changed, |
309 |
O count0, count1, year0, year1, |
310 |
I myTime, myIter, myThid ) |
311 |
endif |
312 |
CALL EXF_SET_OBCS_XZ( OBu, OBu0, OBu1, OBufile, 'u', Nr |
313 |
I , fac, first, changed, useYearlyFields |
314 |
I , obcsperiod, count0, count1, year0, year1 |
315 |
I , myTime, myIter, myThid ) |
316 |
CALL EXF_SET_OBCS_XZ( OBv, OBv0, OBv1, OBvfile, 'v', Nr |
317 |
I , fac, first, changed, useYearlyFields |
318 |
I , obcsperiod, count0, count1, year0, year1 |
319 |
I , myTime, myIter, myThid ) |
320 |
CALL EXF_SET_OBCS_XZ( OBt, OBt0, OBt1, OBtfile, 's', Nr |
321 |
I , fac, first, changed, useYearlyFields |
322 |
I , obcsperiod, count0, count1, year0, year1 |
323 |
I , myTime, myIter, myThid ) |
324 |
CALL EXF_SET_OBCS_XZ( OBs, OBs0, OBs1, OBsfile, 's', Nr |
325 |
I , fac, first, changed, useYearlyFields |
326 |
I , obcsperiod, count0, count1, year0, year1 |
327 |
I , myTime, myIter, myThid ) |
328 |
# ifdef NONLIN_FRSURF |
329 |
CALL EXF_SET_OBCS_XZ( OBeta, OBeta0, OBeta1, OBetaFile, 's', 1 |
330 |
I , fac, first, changed, useYearlyFields |
331 |
I , obcsperiod, count0, count1, year0, year1 |
332 |
I , myTime, myIter, myThid ) |
333 |
# endif /* NONLIN_FRSURF */ |
334 |
# ifdef ALLOW_PTRACERS |
335 |
if ( usePTRACERS ) then |
336 |
do iTracer = 1, PTRACERS_numInUse |
337 |
CALL EXF_SET_OBCS_XZ( OBptr (1-Olx,1,1,1,iTracer) |
338 |
I , OBptr0(1-Olx,1,1,1,iTracer) |
339 |
I , OBptr1(1-Olx,1,1,1,iTracer) |
340 |
I , OBptrFile(iTracer), 's', Nr |
341 |
I , fac, first, changed, useYearlyFields |
342 |
I , obcsperiod, count0, count1, year0, year1 |
343 |
I , myTime, myIter, myThid ) |
344 |
enddo |
345 |
endif |
346 |
# endif /* ALLOW_PTRACERS */ |
347 |
# ifdef ALLOW_SEAICE |
348 |
IF (useSEAICE) THEN |
349 |
if ( siobperiod .eq. -12. _d 0 ) then |
350 |
c siobperiod=-12 means input file contains 12 monthly means |
351 |
c record numbers are assumed 1 to 12 corresponding to |
352 |
c Jan. through Dec. |
353 |
call cal_GetMonthsRec( |
354 |
O fac, first, changed, |
355 |
O count0, count1, |
356 |
I myTime, myIter, myThid ) |
357 |
|
358 |
elseif ( siobperiod .lt. 0. _d 0 ) then |
359 |
print *, 'siobperiod is out of range' |
360 |
STOP 'ABNORMAL END: S/R OBCS_PRESCIBE_EXF_XZ' |
361 |
else |
362 |
c get record numbers and interpolation factor |
363 |
call exf_GetFFieldRec( |
364 |
I siobstartdate, siobperiod, |
365 |
I useYearlyFields, |
366 |
O fac, first, changed, |
367 |
O count0, count1, year0, year1, |
368 |
I myTime, myIter, myThid ) |
369 |
endif |
370 |
CALL EXF_SET_OBCS_XZ( OBa, OBa0, OBa1, OBafile, 's', 1 |
371 |
I , fac, first, changed, useYearlyFields |
372 |
I , siobperiod, count0, count1, year0, year1 |
373 |
I , myTime, myIter, myThid ) |
374 |
CALL EXF_SET_OBCS_XZ( OBh, OBh0, OBh1, OBhfile, 's', 1 |
375 |
I , fac, first, changed, useYearlyFields |
376 |
I , siobperiod, count0, count1, year0, year1 |
377 |
I , myTime, myIter, myThid ) |
378 |
CALL EXF_SET_OBCS_XZ( OBsl, OBsl0, OBsl1, OBslfile, 's', 1 |
379 |
I , fac, first, changed, useYearlyFields |
380 |
I , siobperiod, count0, count1, year0, year1 |
381 |
I , myTime, myIter, myThid ) |
382 |
CALL EXF_SET_OBCS_XZ( OBsn, OBsn0, OBsn1, OBsnfile, 's', 1 |
383 |
I , fac, first, changed, useYearlyFields |
384 |
I , siobperiod, count0, count1, year0, year1 |
385 |
I , myTime, myIter, myThid ) |
386 |
CALL EXF_SET_OBCS_XZ( OBuice,OBuice0,OBuice1,OBuicefile,'u', 1 |
387 |
I , fac, first, changed, useYearlyFields |
388 |
I , siobperiod, count0, count1, year0, year1 |
389 |
I , myTime, myIter, myThid ) |
390 |
CALL EXF_SET_OBCS_XZ( OBvice,OBvice0,OBvice1,OBvicefile,'v', 1 |
391 |
I , fac, first, changed, useYearlyFields |
392 |
I , siobperiod, count0, count1, year0, year1 |
393 |
I , myTime, myIter, myThid ) |
394 |
ENDIF |
395 |
# endif /* ALLOW_SEAICE */ |
396 |
|
397 |
#endif /* ALLOW_OBCS and ALLOW_OBCS_PRESCRIBE and ALLOW_EXF */ |
398 |
RETURN |
399 |
END |
400 |
|
401 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
402 |
|
403 |
CBOP |
404 |
C !ROUTINE: OBCS_EXF_READ_YZ |
405 |
C !INTERFACE: |
406 |
SUBROUTINE OBCS_EXF_READ_YZ ( |
407 |
I obcsstartdate, obcsperiod, |
408 |
I useYearlyFields, |
409 |
U OBu, OBu0, OBu1, OBufile, |
410 |
U OBv, OBv0, OBv1, OBvfile, |
411 |
U OBt, OBt0, OBt1, OBtfile, |
412 |
U OBs, OBs0, OBs1, OBsfile, |
413 |
#ifdef NONLIN_FRSURF |
414 |
U OBeta, OBeta0, OBeta1, OBetafile, |
415 |
#endif |
416 |
#ifdef ALLOW_SEAICE |
417 |
I siobstartdate, siobperiod, |
418 |
U OBa, OBa0, OBa1, OBafile, |
419 |
U OBh, OBh0, OBh1, OBhfile, |
420 |
U OBsl, OBsl0, OBsl1, OBslfile, |
421 |
U OBsn, OBsn0, OBsn1, OBsnfile, |
422 |
U OBuice,OBuice0,OBuice1,OBuicefile, |
423 |
U OBvice,OBvice0,OBvice1,OBvicefile, |
424 |
#endif |
425 |
#ifdef ALLOW_PTRACERS |
426 |
U OBptr ,OBptr0, OBptr1, OBptrFile, |
427 |
#endif |
428 |
I myTime, myIter, myThid ) |
429 |
|
430 |
C !DESCRIPTION: |
431 |
C *==================================================================* |
432 |
C | SUBROUTINE OBCS_EXF_READ_YZ |
433 |
C *==================================================================* |
434 |
C | read open boundary conditions from file |
435 |
C | N.B.: * uses exf and cal routines for file/record handling |
436 |
C | * uses ctrl routines for control variable handling |
437 |
C *==================================================================* |
438 |
|
439 |
C !USES: |
440 |
IMPLICIT NONE |
441 |
C == Global variables == |
442 |
#include "SIZE.h" |
443 |
#include "EEPARAMS.h" |
444 |
#include "PARAMS.h" |
445 |
#ifdef ALLOW_EXF |
446 |
# include "EXF_PARAM.h" |
447 |
#endif |
448 |
#ifdef ALLOW_PTRACERS |
449 |
# include "PTRACERS_SIZE.h" |
450 |
# include "PTRACERS_PARAMS.h" |
451 |
#endif /* ALLOW_PTRACERS */ |
452 |
|
453 |
C !INPUT/OUTPUT PARAMETERS: |
454 |
_RL obcsstartdate |
455 |
_RL obcsperiod |
456 |
LOGICAL useYearlyFields |
457 |
_RL OBu (1-Oly:sNy+Oly,Nr,nSx,nSy) |
458 |
_RL OBv (1-Oly:sNy+Oly,Nr,nSx,nSy) |
459 |
_RL OBt (1-Oly:sNy+Oly,Nr,nSx,nSy) |
460 |
_RL OBs (1-Oly:sNy+Oly,Nr,nSx,nSy) |
461 |
_RL OBu0 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
462 |
_RL OBv0 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
463 |
_RL OBt0 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
464 |
_RL OBs0 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
465 |
_RL OBu1 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
466 |
_RL OBv1 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
467 |
_RL OBt1 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
468 |
_RL OBs1 (1-Oly:sNy+Oly,Nr,nSx,nSy) |
469 |
CHARACTER*(MAX_LEN_FNAM) OBuFile,OBvFile,OBtFile,OBsFile |
470 |
#ifdef NONLIN_FRSURF |
471 |
_RL OBeta (1-Oly:sNy+Oly,nSx,nSy) |
472 |
_RL OBeta0 (1-Oly:sNy+Oly,nSx,nSy) |
473 |
_RL OBeta1 (1-Oly:sNy+Oly,nSx,nSy) |
474 |
CHARACTER*(MAX_LEN_FNAM) OBetaFile |
475 |
#endif |
476 |
#ifdef ALLOW_SEAICE |
477 |
_RL siobstartdate |
478 |
_RL siobperiod |
479 |
_RL OBa (1-Oly:sNy+Oly,nSx,nSy) |
480 |
_RL OBh (1-Oly:sNy+Oly,nSx,nSy) |
481 |
_RL OBa0 (1-Oly:sNy+Oly,nSx,nSy) |
482 |
_RL OBh0 (1-Oly:sNy+Oly,nSx,nSy) |
483 |
_RL OBa1 (1-Oly:sNy+Oly,nSx,nSy) |
484 |
_RL OBh1 (1-Oly:sNy+Oly,nSx,nSy) |
485 |
_RL OBsl (1-Oly:sNy+Oly,nSx,nSy) |
486 |
_RL OBsn (1-Oly:sNy+Oly,nSx,nSy) |
487 |
_RL OBsl0 (1-Oly:sNy+Oly,nSx,nSy) |
488 |
_RL OBsn0 (1-Oly:sNy+Oly,nSx,nSy) |
489 |
_RL OBsl1 (1-Oly:sNy+Oly,nSx,nSy) |
490 |
_RL OBsn1 (1-Oly:sNy+Oly,nSx,nSy) |
491 |
_RL OBuice (1-Oly:sNy+Oly,nSx,nSy) |
492 |
_RL OBvice (1-Oly:sNy+Oly,nSx,nSy) |
493 |
_RL OBuice0 (1-Oly:sNy+Oly,nSx,nSy) |
494 |
_RL OBvice0 (1-Oly:sNy+Oly,nSx,nSy) |
495 |
_RL OBuice1 (1-Oly:sNy+Oly,nSx,nSy) |
496 |
_RL OBvice1 (1-Oly:sNy+Oly,nSx,nSy) |
497 |
CHARACTER*(MAX_LEN_FNAM) |
498 |
& OBaFile,OBhFile,OBslFile,OBsnFile,OBuiceFile,OBviceFile |
499 |
#endif /* ALLOW_SEAICE */ |
500 |
#ifdef ALLOW_PTRACERS |
501 |
_RL OBptr (1-Oly:sNy+Oly,Nr,nSx,nSy,PTRACERS_num) |
502 |
_RL OBptr0(1-Oly:sNy+Oly,Nr,nSx,nSy,PTRACERS_num) |
503 |
_RL OBptr1(1-Oly:sNy+Oly,Nr,nSx,nSy,PTRACERS_num) |
504 |
CHARACTER*(MAX_LEN_FNAM) OBptrFile(PTRACERS_num) |
505 |
#endif /* ALLOW_PTRACERS */ |
506 |
_RL myTime |
507 |
INTEGER myIter |
508 |
INTEGER myThid |
509 |
CEOP |
510 |
|
511 |
#if defined ALLOW_OBCS && defined ALLOW_OBCS_PRESCRIBE \ |
512 |
&& defined ALLOW_EXF |
513 |
|
514 |
C !LOCAL VARIABLES: |
515 |
logical first, changed |
516 |
integer count0, count1 |
517 |
integer year0, year1 |
518 |
_RL fac |
519 |
# ifdef ALLOW_PTRACERS |
520 |
integer iTracer |
521 |
# endif /* ALLOW_PTRACERS */ |
522 |
|
523 |
c == end of interface == |
524 |
|
525 |
if ( obcsperiod .eq. -12. _d 0 ) then |
526 |
c obcsperiod=-12 means input file contains 12 monthly means |
527 |
c record numbers are assumed 1 to 12 corresponding to |
528 |
c Jan. through Dec. |
529 |
call cal_GetMonthsRec( |
530 |
O fac, first, changed, |
531 |
O count0, count1, |
532 |
I myTime, myIter, myThid ) |
533 |
|
534 |
elseif ( obcsperiod .lt. 0. _d 0 ) then |
535 |
print *, 'obcsperiod is out of range' |
536 |
STOP 'ABNORMAL END: S/R OBCS_PRESCIBE_EXF_YZ' |
537 |
else |
538 |
c get record numbers and interpolation factor |
539 |
call exf_GetFFieldRec( |
540 |
I obcsstartdate, obcsperiod, |
541 |
I useYearlyFields, |
542 |
O fac, first, changed, |
543 |
O count0, count1, year0, year1, |
544 |
I myTime, myIter, myThid ) |
545 |
endif |
546 |
CALL EXF_SET_OBCS_YZ( OBu, OBu0, OBu1, OBufile, 'u', Nr |
547 |
I , fac, first, changed, useYearlyFields |
548 |
I , obcsperiod, count0, count1, year0, year1 |
549 |
I , myTime, myIter, myThid ) |
550 |
CALL EXF_SET_OBCS_YZ( OBv, OBv0, OBv1, OBvfile, 'v', Nr |
551 |
I , fac, first, changed, useYearlyFields |
552 |
I , obcsperiod, count0, count1, year0, year1 |
553 |
I , myTime, myIter, myThid ) |
554 |
CALL EXF_SET_OBCS_YZ( OBt, OBt0, OBt1, OBtfile, 's', Nr |
555 |
I , fac, first, changed, useYearlyFields |
556 |
I , obcsperiod, count0, count1, year0, year1 |
557 |
I , myTime, myIter, myThid ) |
558 |
CALL EXF_SET_OBCS_YZ( OBs, OBs0, OBs1, OBsfile, 's', Nr |
559 |
I , fac, first, changed, useYearlyFields |
560 |
I , obcsperiod, count0, count1, year0, year1 |
561 |
I , myTime, myIter, myThid ) |
562 |
# ifdef NONLIN_FRSURF |
563 |
CALL EXF_SET_OBCS_YZ( OBeta, OBeta0, OBeta1, OBetaFile, 's', 1 |
564 |
I , fac, first, changed, useYearlyFields |
565 |
I , obcsperiod, count0, count1, year0, year1 |
566 |
I , myTime, myIter, myThid ) |
567 |
# endif /* NONLIN_FRSURF */ |
568 |
# ifdef ALLOW_PTRACERS |
569 |
if ( usePTRACERS ) then |
570 |
do iTracer = 1, PTRACERS_numInUse |
571 |
CALL EXF_SET_OBCS_YZ( OBptr (1-Olx,1,1,1,iTracer) |
572 |
I , OBptr0(1-Olx,1,1,1,iTracer) |
573 |
I , OBptr1(1-Olx,1,1,1,iTracer) |
574 |
I , OBptrFile(iTracer), 's', Nr |
575 |
I , fac, first, changed, useYearlyFields |
576 |
I , obcsperiod, count0, count1, year0, year1 |
577 |
I , myTime, myIter, myThid ) |
578 |
enddo |
579 |
endif |
580 |
# endif /* ALLOW_PTRACERS */ |
581 |
# ifdef ALLOW_SEAICE |
582 |
IF (useSEAICE) THEN |
583 |
if ( siobperiod .eq. -12. _d 0 ) then |
584 |
c siobperiod=-12 means input file contains 12 monthly means |
585 |
c record numbers are assumed 1 to 12 corresponding to |
586 |
c Jan. through Dec. |
587 |
call cal_GetMonthsRec( |
588 |
O fac, first, changed, |
589 |
O count0, count1, |
590 |
I myTime, myIter, myThid |
591 |
& ) |
592 |
|
593 |
elseif ( siobperiod .lt. 0. _d 0 ) then |
594 |
print *, 'siobperiod is out of range' |
595 |
STOP 'ABNORMAL END: S/R OBCS_PRESCIBE_EXF_XZ' |
596 |
else |
597 |
c get record numbers and interpolation factor |
598 |
call exf_GetFFieldRec( |
599 |
I siobstartdate, siobperiod, |
600 |
I useYearlyFields, |
601 |
O fac, first, changed, |
602 |
O count0, count1, year0, year1, |
603 |
I myTime, myIter, myThid ) |
604 |
endif |
605 |
CALL EXF_SET_OBCS_YZ( OBa, OBa0, OBa1, OBafile, 's', 1 |
606 |
I , fac, first, changed, useYearlyFields |
607 |
I , siobperiod, count0, count1, year0, year1 |
608 |
I , myTime, myIter, myThid ) |
609 |
CALL EXF_SET_OBCS_YZ( OBh, OBh0, OBh1, OBhfile, 's', 1 |
610 |
I , fac, first, changed, useYearlyFields |
611 |
I , siobperiod, count0, count1, year0, year1 |
612 |
I , myTime, myIter, myThid ) |
613 |
CALL EXF_SET_OBCS_YZ( OBsl, OBsl0, OBsl1, OBslfile, 's', 1 |
614 |
I , fac, first, changed, useYearlyFields |
615 |
I , siobperiod, count0, count1, year0, year1 |
616 |
I , myTime, myIter, myThid ) |
617 |
CALL EXF_SET_OBCS_YZ( OBsn, OBsn0, OBsn1, OBsnfile, 's', 1 |
618 |
I , fac, first, changed, useYearlyFields |
619 |
I , siobperiod, count0, count1, year0, year1 |
620 |
I , myTime, myIter, myThid ) |
621 |
CALL EXF_SET_OBCS_YZ( OBuice,OBuice0,OBuice1,OBuicefile,'u', 1 |
622 |
I , fac, first, changed, useYearlyFields |
623 |
I , siobperiod, count0, count1, year0, year1 |
624 |
I , myTime, myIter, myThid ) |
625 |
CALL EXF_SET_OBCS_YZ( OBvice,OBvice0,OBvice1,OBvicefile,'v', 1 |
626 |
I , fac, first, changed, useYearlyFields |
627 |
I , siobperiod, count0, count1, year0, year1 |
628 |
I , myTime, myIter, myThid ) |
629 |
ENDIF |
630 |
# endif /* ALLOW_SEAICE */ |
631 |
|
632 |
#endif /* ALLOW_OBCS and ALLOW_OBCS_PRESCRIBE and ALLOW_EXF */ |
633 |
RETURN |
634 |
END |