/[MITgcm]/MITgcm/pkg/obcs/obcs_exf_load.F
ViewVC logotype

Contents of /MITgcm/pkg/obcs/obcs_exf_load.F

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


Revision 1.6 - (show annotations) (download)
Sat Jun 7 17:51:46 2014 UTC (9 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64z, checkpoint65, checkpoint66c, checkpoint66b, checkpoint66a, 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
Changes since 1.5: +239 -162 lines
- move debug print (formerly active when exf_verbose=T) from EXF_getFFieldRec
  into S/R that calls it (i.e., exf_set_gen.F, exf_set_uv.F & obcs_exf_load.F)

1 C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_exf_load.F,v 1.5 2011/10/11 02:04:14 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 C msgBuf :: Informational/error message buffer
283 CHARACTER*(MAX_LEN_MBUF) msgBuf
284 logical first, changed
285 integer count0, count1
286 integer year0, year1
287 _RL fac
288 # ifdef ALLOW_PTRACERS
289 integer iTracer
290 # endif /* ALLOW_PTRACERS */
291 C == end of interface ==
292
293 IF ( obcsperiod .EQ. -12. _d 0 ) THEN
294 C- obcsperiod=-12 means input file contains 12 monthly means
295 C records, corresponding to Jan. (rec=1) through Dec. (rec=12)
296 CALL cal_GetMonthsRec(
297 O fac, first, changed,
298 O count0, count1,
299 I myTime, myIter, myThid )
300 ELSEIF ( obcsperiod .LT. 0. _d 0 ) THEN
301 WRITE(msgBuf,'(A,1PE16.8,2A)')
302 & 'OBCS_EXF_READ_XZ: Invalid obcsperiod=', obcsperiod,
303 & ' for OBCS files'
304 CALL PRINT_ERROR( msgBuf, myThid )
305 STOP 'ABNORMAL END: S/R OBCS_EXF_READ_XZ'
306 ELSE
307 C get record numbers and interpolation factor
308 CALL exf_GetFFieldRec(
309 I obcsstartdate, obcsperiod,
310 I useYearlyFields,
311 O fac, first, changed,
312 O count0, count1, year0, year1,
313 I myTime, myIter, myThid )
314 ENDIF
315 IF ( exf_debugLev.GE.debLevD ) THEN
316 _BEGIN_MASTER( myThid )
317 WRITE(msgBuf,'(3A)') ' OBCS_EXF_READ_XZ: ',
318 & 'processing OBCS files'
319 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
320 & SQUEEZE_RIGHT, myThid )
321 WRITE(msgBuf,'(2A,I10,2I7)') ' OBCS_EXF_READ_XZ: ',
322 & ' myIter, count0, count1:', myIter, count0, count1
323 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
324 & SQUEEZE_RIGHT, myThid )
325 WRITE(msgBuf,'(2A,2(L2,2X),E16.9)') ' OBCS_EXF_READ_XZ: ',
326 & ' first, changed, fac: ', first, changed, fac
327 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
328 & SQUEEZE_RIGHT, myThid )
329 _END_MASTER( myThid )
330 ENDIF
331
332 CALL EXF_SET_OBCS_XZ( OBu, OBu0, OBu1, OBufile, 'u', Nr
333 I , fac, first, changed, useYearlyFields
334 I , obcsperiod, count0, count1, year0, year1
335 I , myTime, myIter, myThid )
336 CALL EXF_SET_OBCS_XZ( OBv, OBv0, OBv1, OBvfile, 'v', Nr
337 I , fac, first, changed, useYearlyFields
338 I , obcsperiod, count0, count1, year0, year1
339 I , myTime, myIter, myThid )
340 CALL EXF_SET_OBCS_XZ( OBt, OBt0, OBt1, OBtfile, 's', Nr
341 I , fac, first, changed, useYearlyFields
342 I , obcsperiod, count0, count1, year0, year1
343 I , myTime, myIter, myThid )
344 CALL EXF_SET_OBCS_XZ( OBs, OBs0, OBs1, OBsfile, 's', Nr
345 I , fac, first, changed, useYearlyFields
346 I , obcsperiod, count0, count1, year0, year1
347 I , myTime, myIter, myThid )
348 # ifdef NONLIN_FRSURF
349 CALL EXF_SET_OBCS_XZ( OBeta, OBeta0, OBeta1, OBetaFile, 's', 1
350 I , fac, first, changed, useYearlyFields
351 I , obcsperiod, count0, count1, year0, year1
352 I , myTime, myIter, myThid )
353 # endif /* NONLIN_FRSURF */
354 # ifdef ALLOW_PTRACERS
355 if ( usePTRACERS ) then
356 do iTracer = 1, PTRACERS_numInUse
357 CALL EXF_SET_OBCS_XZ( OBptr (1-OLx,1,1,1,iTracer)
358 I , OBptr0(1-OLx,1,1,1,iTracer)
359 I , OBptr1(1-OLx,1,1,1,iTracer)
360 I , OBptrFile(iTracer), 's', Nr
361 I , fac, first, changed, useYearlyFields
362 I , obcsperiod, count0, count1, year0, year1
363 I , myTime, myIter, myThid )
364 enddo
365 endif
366 # endif /* ALLOW_PTRACERS */
367
368 # ifdef ALLOW_SEAICE
369 IF (useSEAICE) THEN
370 IF ( siobperiod .EQ. -12. _d 0 ) THEN
371 C- obcsperiod=-12 means input file contains 12 monthly means
372 C records, corresponding to Jan. (rec=1) through Dec. (rec=12)
373 CALL cal_GetMonthsRec(
374 O fac, first, changed,
375 O count0, count1,
376 I myTime, myIter, myThid )
377 ELSEIF ( siobperiod .LT. 0. _d 0 ) THEN
378 WRITE(msgBuf,'(A,1PE16.8,2A)')
379 & 'OBCS_EXF_READ_XZ: Invalid siobperiod=', siobperiod,
380 & ' for OBCS files'
381 CALL PRINT_ERROR( msgBuf, myThid )
382 STOP 'ABNORMAL END: S/R OBCS_EXF_READ_XZ'
383 ELSE
384 c get record numbers and interpolation factor
385 CALL exf_GetFFieldRec(
386 I siobstartdate, siobperiod,
387 I useYearlyFields,
388 O fac, first, changed,
389 O count0, count1, year0, year1,
390 I myTime, myIter, myThid )
391 ENDIF
392 IF ( exf_debugLev.GE.debLevD ) THEN
393 _BEGIN_MASTER( myThid )
394 WRITE(msgBuf,'(3A)') ' OBCS_EXF_READ_XZ: ',
395 & 'processing SEAICE-OBCS files'
396 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
397 & SQUEEZE_RIGHT, myThid )
398 WRITE(msgBuf,'(2A,I10,2I7)') ' OBCS_EXF_READ_XZ: ',
399 & ' myIter, count0, count1:', myIter, count0, count1
400 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
401 & SQUEEZE_RIGHT, myThid )
402 WRITE(msgBuf,'(2A,2(L2,2X),E16.9)') ' OBCS_EXF_READ_XZ: ',
403 & ' first, changed, fac: ', first, changed, fac
404 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
405 & SQUEEZE_RIGHT, myThid )
406 _END_MASTER( myThid )
407 ENDIF
408
409 CALL EXF_SET_OBCS_XZ( OBa, OBa0, OBa1, OBafile, 's', 1
410 I , fac, first, changed, useYearlyFields
411 I , siobperiod, count0, count1, year0, year1
412 I , myTime, myIter, myThid )
413 CALL EXF_SET_OBCS_XZ( OBh, OBh0, OBh1, OBhfile, 's', 1
414 I , fac, first, changed, useYearlyFields
415 I , siobperiod, count0, count1, year0, year1
416 I , myTime, myIter, myThid )
417 CALL EXF_SET_OBCS_XZ( OBsl, OBsl0, OBsl1, OBslfile, 's', 1
418 I , fac, first, changed, useYearlyFields
419 I , siobperiod, count0, count1, year0, year1
420 I , myTime, myIter, myThid )
421 CALL EXF_SET_OBCS_XZ( OBsn, OBsn0, OBsn1, OBsnfile, 's', 1
422 I , fac, first, changed, useYearlyFields
423 I , siobperiod, count0, count1, year0, year1
424 I , myTime, myIter, myThid )
425 CALL EXF_SET_OBCS_XZ( OBuice,OBuice0,OBuice1,OBuicefile,'u', 1
426 I , fac, first, changed, useYearlyFields
427 I , siobperiod, count0, count1, year0, year1
428 I , myTime, myIter, myThid )
429 CALL EXF_SET_OBCS_XZ( OBvice,OBvice0,OBvice1,OBvicefile,'v', 1
430 I , fac, first, changed, useYearlyFields
431 I , siobperiod, count0, count1, year0, year1
432 I , myTime, myIter, myThid )
433 ENDIF
434 # endif /* ALLOW_SEAICE */
435
436 #endif /* ALLOW_OBCS and ALLOW_OBCS_PRESCRIBE and ALLOW_EXF */
437 RETURN
438 END
439
440 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
441
442 CBOP
443 C !ROUTINE: OBCS_EXF_READ_YZ
444 C !INTERFACE:
445 SUBROUTINE OBCS_EXF_READ_YZ (
446 I obcsstartdate, obcsperiod,
447 I useYearlyFields,
448 U OBu, OBu0, OBu1, OBufile,
449 U OBv, OBv0, OBv1, OBvfile,
450 U OBt, OBt0, OBt1, OBtfile,
451 U OBs, OBs0, OBs1, OBsfile,
452 #ifdef NONLIN_FRSURF
453 U OBeta, OBeta0, OBeta1, OBetafile,
454 #endif
455 #ifdef ALLOW_SEAICE
456 I siobstartdate, siobperiod,
457 U OBa, OBa0, OBa1, OBafile,
458 U OBh, OBh0, OBh1, OBhfile,
459 U OBsl, OBsl0, OBsl1, OBslfile,
460 U OBsn, OBsn0, OBsn1, OBsnfile,
461 U OBuice,OBuice0,OBuice1,OBuicefile,
462 U OBvice,OBvice0,OBvice1,OBvicefile,
463 #endif
464 #ifdef ALLOW_PTRACERS
465 U OBptr ,OBptr0, OBptr1, OBptrFile,
466 #endif
467 I myTime, myIter, myThid )
468
469 C !DESCRIPTION:
470 C *==================================================================*
471 C | SUBROUTINE OBCS_EXF_READ_YZ
472 C *==================================================================*
473 C | read open boundary conditions from file
474 C | N.B.: * uses exf and cal routines for file/record handling
475 C | * uses ctrl routines for control variable handling
476 C *==================================================================*
477
478 C !USES:
479 IMPLICIT NONE
480 C == Global variables ==
481 #include "SIZE.h"
482 #include "EEPARAMS.h"
483 #include "PARAMS.h"
484 #ifdef ALLOW_EXF
485 # include "EXF_PARAM.h"
486 #endif
487 #ifdef ALLOW_PTRACERS
488 # include "PTRACERS_SIZE.h"
489 # include "PTRACERS_PARAMS.h"
490 #endif /* ALLOW_PTRACERS */
491
492 C !INPUT/OUTPUT PARAMETERS:
493 _RL obcsstartdate
494 _RL obcsperiod
495 LOGICAL useYearlyFields
496 _RL OBu (1-OLy:sNy+OLy,Nr,nSx,nSy)
497 _RL OBv (1-OLy:sNy+OLy,Nr,nSx,nSy)
498 _RL OBt (1-OLy:sNy+OLy,Nr,nSx,nSy)
499 _RL OBs (1-OLy:sNy+OLy,Nr,nSx,nSy)
500 _RL OBu0 (1-OLy:sNy+OLy,Nr,nSx,nSy)
501 _RL OBv0 (1-OLy:sNy+OLy,Nr,nSx,nSy)
502 _RL OBt0 (1-OLy:sNy+OLy,Nr,nSx,nSy)
503 _RL OBs0 (1-OLy:sNy+OLy,Nr,nSx,nSy)
504 _RL OBu1 (1-OLy:sNy+OLy,Nr,nSx,nSy)
505 _RL OBv1 (1-OLy:sNy+OLy,Nr,nSx,nSy)
506 _RL OBt1 (1-OLy:sNy+OLy,Nr,nSx,nSy)
507 _RL OBs1 (1-OLy:sNy+OLy,Nr,nSx,nSy)
508 CHARACTER*(MAX_LEN_FNAM) OBuFile,OBvFile,OBtFile,OBsFile
509 #ifdef NONLIN_FRSURF
510 _RL OBeta (1-OLy:sNy+OLy,nSx,nSy)
511 _RL OBeta0 (1-OLy:sNy+OLy,nSx,nSy)
512 _RL OBeta1 (1-OLy:sNy+OLy,nSx,nSy)
513 CHARACTER*(MAX_LEN_FNAM) OBetaFile
514 #endif
515 #ifdef ALLOW_SEAICE
516 _RL siobstartdate
517 _RL siobperiod
518 _RL OBa (1-OLy:sNy+OLy,nSx,nSy)
519 _RL OBh (1-OLy:sNy+OLy,nSx,nSy)
520 _RL OBa0 (1-OLy:sNy+OLy,nSx,nSy)
521 _RL OBh0 (1-OLy:sNy+OLy,nSx,nSy)
522 _RL OBa1 (1-OLy:sNy+OLy,nSx,nSy)
523 _RL OBh1 (1-OLy:sNy+OLy,nSx,nSy)
524 _RL OBsl (1-OLy:sNy+OLy,nSx,nSy)
525 _RL OBsn (1-OLy:sNy+OLy,nSx,nSy)
526 _RL OBsl0 (1-OLy:sNy+OLy,nSx,nSy)
527 _RL OBsn0 (1-OLy:sNy+OLy,nSx,nSy)
528 _RL OBsl1 (1-OLy:sNy+OLy,nSx,nSy)
529 _RL OBsn1 (1-OLy:sNy+OLy,nSx,nSy)
530 _RL OBuice (1-OLy:sNy+OLy,nSx,nSy)
531 _RL OBvice (1-OLy:sNy+OLy,nSx,nSy)
532 _RL OBuice0 (1-OLy:sNy+OLy,nSx,nSy)
533 _RL OBvice0 (1-OLy:sNy+OLy,nSx,nSy)
534 _RL OBuice1 (1-OLy:sNy+OLy,nSx,nSy)
535 _RL OBvice1 (1-OLy:sNy+OLy,nSx,nSy)
536 CHARACTER*(MAX_LEN_FNAM)
537 & OBaFile,OBhFile,OBslFile,OBsnFile,OBuiceFile,OBviceFile
538 #endif /* ALLOW_SEAICE */
539 #ifdef ALLOW_PTRACERS
540 _RL OBptr (1-OLy:sNy+OLy,Nr,nSx,nSy,PTRACERS_num)
541 _RL OBptr0(1-OLy:sNy+OLy,Nr,nSx,nSy,PTRACERS_num)
542 _RL OBptr1(1-OLy:sNy+OLy,Nr,nSx,nSy,PTRACERS_num)
543 CHARACTER*(MAX_LEN_FNAM) OBptrFile(PTRACERS_num)
544 #endif /* ALLOW_PTRACERS */
545 _RL myTime
546 INTEGER myIter
547 INTEGER myThid
548 CEOP
549
550 #if defined ALLOW_OBCS && defined ALLOW_OBCS_PRESCRIBE \
551 && defined ALLOW_EXF
552
553 C !LOCAL VARIABLES:
554 C msgBuf :: Informational/error message buffer
555 CHARACTER*(MAX_LEN_MBUF) msgBuf
556 logical first, changed
557 integer count0, count1
558 integer year0, year1
559 _RL fac
560 # ifdef ALLOW_PTRACERS
561 integer iTracer
562 # endif /* ALLOW_PTRACERS */
563
564 c == end of interface ==
565
566 IF ( obcsperiod .EQ. -12. _d 0 ) THEN
567 C- obcsperiod=-12 means input file contains 12 monthly means
568 C records, corresponding to Jan. (rec=1) through Dec. (rec=12)
569 CALL cal_GetMonthsRec(
570 O fac, first, changed,
571 O count0, count1,
572 I myTime, myIter, myThid )
573 ELSEIF ( obcsperiod .LT. 0. _d 0 ) THEN
574 WRITE(msgBuf,'(A,1PE16.8,2A)')
575 & 'OBCS_EXF_READ_YZ: Invalid obcsperiod=', obcsperiod,
576 & ' for OBCS files'
577 CALL PRINT_ERROR( msgBuf, myThid )
578 STOP 'ABNORMAL END: S/R OBCS_EXF_READ_YZ'
579 ELSE
580 C get record numbers and interpolation factor
581 CALL exf_GetFFieldRec(
582 I obcsstartdate, obcsperiod,
583 I useYearlyFields,
584 O fac, first, changed,
585 O count0, count1, year0, year1,
586 I myTime, myIter, myThid )
587 ENDIF
588 IF ( exf_debugLev.GE.debLevD ) THEN
589 _BEGIN_MASTER( myThid )
590 WRITE(msgBuf,'(3A)') ' OBCS_EXF_READ_YZ: ',
591 & 'processing OBCS files'
592 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
593 & SQUEEZE_RIGHT, myThid )
594 WRITE(msgBuf,'(2A,I10,2I7)') ' OBCS_EXF_READ_YZ: ',
595 & ' myIter, count0, count1:', myIter, count0, count1
596 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
597 & SQUEEZE_RIGHT, myThid )
598 WRITE(msgBuf,'(2A,2(L2,2X),E16.9)') ' OBCS_EXF_READ_YZ: ',
599 & ' first, changed, fac: ', first, changed, fac
600 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
601 & SQUEEZE_RIGHT, myThid )
602 _END_MASTER( myThid )
603 ENDIF
604
605 CALL EXF_SET_OBCS_YZ( OBu, OBu0, OBu1, OBufile, 'u', Nr
606 I , fac, first, changed, useYearlyFields
607 I , obcsperiod, count0, count1, year0, year1
608 I , myTime, myIter, myThid )
609 CALL EXF_SET_OBCS_YZ( OBv, OBv0, OBv1, OBvfile, 'v', Nr
610 I , fac, first, changed, useYearlyFields
611 I , obcsperiod, count0, count1, year0, year1
612 I , myTime, myIter, myThid )
613 CALL EXF_SET_OBCS_YZ( OBt, OBt0, OBt1, OBtfile, 's', Nr
614 I , fac, first, changed, useYearlyFields
615 I , obcsperiod, count0, count1, year0, year1
616 I , myTime, myIter, myThid )
617 CALL EXF_SET_OBCS_YZ( OBs, OBs0, OBs1, OBsfile, 's', Nr
618 I , fac, first, changed, useYearlyFields
619 I , obcsperiod, count0, count1, year0, year1
620 I , myTime, myIter, myThid )
621 # ifdef NONLIN_FRSURF
622 CALL EXF_SET_OBCS_YZ( OBeta, OBeta0, OBeta1, OBetaFile, 's', 1
623 I , fac, first, changed, useYearlyFields
624 I , obcsperiod, count0, count1, year0, year1
625 I , myTime, myIter, myThid )
626 # endif /* NONLIN_FRSURF */
627 # ifdef ALLOW_PTRACERS
628 if ( usePTRACERS ) then
629 do iTracer = 1, PTRACERS_numInUse
630 CALL EXF_SET_OBCS_YZ( OBptr (1-OLx,1,1,1,iTracer)
631 I , OBptr0(1-OLx,1,1,1,iTracer)
632 I , OBptr1(1-OLx,1,1,1,iTracer)
633 I , OBptrFile(iTracer), 's', Nr
634 I , fac, first, changed, useYearlyFields
635 I , obcsperiod, count0, count1, year0, year1
636 I , myTime, myIter, myThid )
637 enddo
638 endif
639 # endif /* ALLOW_PTRACERS */
640
641 # ifdef ALLOW_SEAICE
642 IF (useSEAICE) THEN
643 IF ( siobperiod .EQ. -12. _d 0 ) THEN
644 C- obcsperiod=-12 means input file contains 12 monthly means
645 C records, corresponding to Jan. (rec=1) through Dec. (rec=12)
646 CALL cal_GetMonthsRec(
647 O fac, first, changed,
648 O count0, count1,
649 I myTime, myIter, myThid )
650 ELSEIF ( siobperiod .LT. 0. _d 0 ) THEN
651 WRITE(msgBuf,'(A,1PE16.8,2A)')
652 & 'OBCS_EXF_READ_YZ: Invalid siobperiod=', siobperiod,
653 & ' for OBCS files'
654 CALL PRINT_ERROR( msgBuf, myThid )
655 STOP 'ABNORMAL END: S/R OBCS_EXF_READ_YZ'
656 ELSE
657 c get record numbers and interpolation factor
658 CALL exf_GetFFieldRec(
659 I siobstartdate, siobperiod,
660 I useYearlyFields,
661 O fac, first, changed,
662 O count0, count1, year0, year1,
663 I myTime, myIter, myThid )
664 ENDIF
665 IF ( exf_debugLev.GE.debLevD ) THEN
666 _BEGIN_MASTER( myThid )
667 WRITE(msgBuf,'(3A)') ' OBCS_EXF_READ_YZ: ',
668 & 'processing SEAICE-OBCS files'
669 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
670 & SQUEEZE_RIGHT, myThid )
671 WRITE(msgBuf,'(2A,I10,2I7)') ' OBCS_EXF_READ_YZ: ',
672 & ' myIter, count0, count1:', myIter, count0, count1
673 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
674 & SQUEEZE_RIGHT, myThid )
675 WRITE(msgBuf,'(2A,2(L2,2X),E16.9)') ' OBCS_EXF_READ_YZ: ',
676 & ' first, changed, fac: ', first, changed, fac
677 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
678 & SQUEEZE_RIGHT, myThid )
679 _END_MASTER( myThid )
680 ENDIF
681
682 CALL EXF_SET_OBCS_YZ( OBa, OBa0, OBa1, OBafile, 's', 1
683 I , fac, first, changed, useYearlyFields
684 I , siobperiod, count0, count1, year0, year1
685 I , myTime, myIter, myThid )
686 CALL EXF_SET_OBCS_YZ( OBh, OBh0, OBh1, OBhfile, 's', 1
687 I , fac, first, changed, useYearlyFields
688 I , siobperiod, count0, count1, year0, year1
689 I , myTime, myIter, myThid )
690 CALL EXF_SET_OBCS_YZ( OBsl, OBsl0, OBsl1, OBslfile, 's', 1
691 I , fac, first, changed, useYearlyFields
692 I , siobperiod, count0, count1, year0, year1
693 I , myTime, myIter, myThid )
694 CALL EXF_SET_OBCS_YZ( OBsn, OBsn0, OBsn1, OBsnfile, 's', 1
695 I , fac, first, changed, useYearlyFields
696 I , siobperiod, count0, count1, year0, year1
697 I , myTime, myIter, myThid )
698 CALL EXF_SET_OBCS_YZ( OBuice,OBuice0,OBuice1,OBuicefile,'u', 1
699 I , fac, first, changed, useYearlyFields
700 I , siobperiod, count0, count1, year0, year1
701 I , myTime, myIter, myThid )
702 CALL EXF_SET_OBCS_YZ( OBvice,OBvice0,OBvice1,OBvicefile,'v', 1
703 I , fac, first, changed, useYearlyFields
704 I , siobperiod, count0, count1, year0, year1
705 I , myTime, myIter, myThid )
706 ENDIF
707 # endif /* ALLOW_SEAICE */
708
709 #endif /* ALLOW_OBCS and ALLOW_OBCS_PRESCRIBE and ALLOW_EXF */
710 RETURN
711 END

  ViewVC Help
Powered by ViewVC 1.1.22