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

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

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


Revision 1.13 - (show annotations) (download)
Tue Oct 23 08:25:28 2007 UTC (16 years, 8 months ago) by dimitri
Branch: MAIN
Changes since 1.12: +25 -1 lines
added open boundary conditions capability for seaice HSNOW and HSALT
(code contributed by Michael Schodlok)

1 C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_prescribe_read.F,v 1.12 2007/10/11 10:30:34 dimitri Exp $
2 C $Name: $
3
4 # include "OBCS_OPTIONS.h"
5
6 subroutine obcs_prescribe_read (
7 I mycurrenttime
8 I , mycurrentiter
9 I , mythid
10 & )
11 c |==================================================================|
12 c | SUBROUTINE obcs_prescribe_read |
13 c |==================================================================|
14 c | read open boundary conditions from file |
15 c | N.B.: * uses exf and cal routines for file/record handling |
16 c | * uses ctrl routines for control variable handling |
17 c |==================================================================|
18
19 implicit none
20
21 c == global variables ==
22
23 #include "EEPARAMS.h"
24 #include "SIZE.h"
25 #include "GRID.h"
26 #include "OBCS.h"
27 #ifdef ALLOW_EXF
28 # include "EXF_PARAM.h"
29 #endif
30 #if (defined (ALLOW_SEAICE) || defined (ALLOW_PTRACERS))
31 # include "PARAMS.h"
32 #endif
33 #ifdef ALLOW_PTRACERS
34 # include "PTRACERS_SIZE.h"
35 # include "PTRACERS.h"
36 # include "OBCS_PTRACERS.h"
37 #endif /* ALLOW_PTRACERS */
38
39 c == routine arguments ==
40
41 _RL mycurrenttime
42 integer mycurrentiter
43 integer mythid
44
45 #if (defined (ALLOW_OBCS) && defined (ALLOW_OBCS_PRESCRIBE))
46
47 c == local variables ==
48
49 #ifdef ALLOW_EXF
50 logical first, changed
51 integer count0, count1
52 integer year0, year1
53 _RL fac
54 #ifdef ALLOW_PTRACERS
55 integer iTracer, i,j,k
56 #endif /* ALLOW_PTRACERS */
57 #endif /* ALLOW_EXF */
58
59 c == end of interface ==
60
61 #ifdef ALLOW_EXF
62 #ifdef ALLOW_OBCS_NORTH
63 call exf_getffieldrec(
64 I obcsNstartdate, obcsNperiod
65 I , obcsNstartdate1, obcsNstartdate2
66 I , .false.
67 O , fac, first, changed
68 O , count0, count1, year0, year1
69 I , mycurrenttime, mycurrentiter, mythid
70 & )
71
72 call exf_set_obcs_xz( OBNu, OBNu0, OBNu1, OBNufile, 'u'
73 I , fac, first, changed, count0, count1
74 I , mycurrenttime, mycurrentiter, mythid )
75 call exf_set_obcs_xz( OBNv, OBNv0, OBNv1, OBNvfile, 'v'
76 I , fac, first, changed, count0, count1
77 I , mycurrenttime, mycurrentiter, mythid )
78 call exf_set_obcs_xz( OBNt, OBNt0, OBNt1, OBNtfile, 's'
79 I , fac, first, changed, count0, count1
80 I , mycurrenttime, mycurrentiter, mythid )
81 call exf_set_obcs_xz( OBNs, OBNs0, OBNs1, OBNsfile, 's'
82 I , fac, first, changed, count0, count1
83 I , mycurrenttime, mycurrentiter, mythid )
84 #ifdef ALLOW_SEAICE
85 IF (useSEAICE) THEN
86 call exf_set_obcs_x ( OBNa, OBNa0, OBNa1, OBNafile, 's'
87 I , fac, first, changed, count0, count1
88 I , mycurrenttime, mycurrentiter, mythid )
89 call exf_set_obcs_x ( OBNh, OBNh0, OBNh1, OBNhfile, 's'
90 I , fac, first, changed, count0, count1
91 I , mycurrenttime, mycurrentiter, mythid )
92 call exf_set_obcs_x ( OBNsl, OBNsl0, OBNsl1, OBNslfile, 's'
93 I , fac, first, changed, count0, count1
94 I , mycurrenttime, mycurrentiter, mythid )
95 call exf_set_obcs_x ( OBNsn, OBNsn0, OBNsn1, OBNsnfile, 's'
96 I , fac, first, changed, count0, count1
97 I , mycurrenttime, mycurrentiter, mythid )
98 ENDIF
99 #endif /* ALLOW_SEAICE */
100 #ifdef ALLOW_PTRACERS
101 if ( usePTRACERS ) then
102 do itracer = 1, PTRACERS_numInUse
103 call exf_set_obcs_xz( OBNptr (1-Olx,1,1,1,iTracer)
104 I , OBNptr0(1-Olx,1,1,1,iTracer)
105 I , OBNptr1(1-Olx,1,1,1,iTracer)
106 I , OBNptrFile(iTracer), 's'
107 I , fac, first, changed, count0, count1
108 I , mycurrenttime, mycurrentiter, mythid )
109 enddo
110 endif
111 #endif /* ALLOW_PTRACERS */
112 #endif /* ALLOW_OBCS_NORTH */
113
114 #ifdef ALLOW_OBCS_SOUTH
115 call exf_getffieldrec(
116 I obcsSstartdate, obcsSperiod
117 I , obcsSstartdate1, obcsSstartdate2
118 I , .false.
119 O , fac, first, changed
120 O , count0, count1, year0, year1
121 I , mycurrenttime, mycurrentiter, mythid
122 & )
123
124 call exf_set_obcs_xz( OBSu, OBSu0, OBSu1, OBSufile, 'u'
125 I , fac, first, changed, count0, count1
126 I , mycurrenttime, mycurrentiter, mythid )
127 call exf_set_obcs_xz( OBSv, OBSv0, OBSv1, OBSvfile, 'v'
128 I , fac, first, changed, count0, count1
129 I , mycurrenttime, mycurrentiter, mythid )
130 call exf_set_obcs_xz( OBSt, OBSt0, OBSt1, OBStfile, 's'
131 I , fac, first, changed, count0, count1
132 I , mycurrenttime, mycurrentiter, mythid )
133 call exf_set_obcs_xz( OBSs, OBSs0, OBSs1, OBSsfile, 's'
134 I , fac, first, changed, count0, count1
135 I , mycurrenttime, mycurrentiter, mythid )
136 #ifdef ALLOW_SEAICE
137 IF (useSEAICE) THEN
138 call exf_set_obcs_x ( OBSa, OBSa0, OBSa1, OBSafile, 's'
139 I , fac, first, changed, count0, count1
140 I , mycurrenttime, mycurrentiter, mythid )
141 call exf_set_obcs_x ( OBSh, OBSh0, OBSh1, OBShfile, 's'
142 I , fac, first, changed, count0, count1
143 I , mycurrenttime, mycurrentiter, mythid )
144 call exf_set_obcs_x ( OBSsl, OBSsl0, OBSsl1, OBSslfile, 's'
145 I , fac, first, changed, count0, count1
146 I , mycurrenttime, mycurrentiter, mythid )
147 call exf_set_obcs_x ( OBSsn, OBSsn0, OBSsn1, OBSsnfile, 's'
148 I , fac, first, changed, count0, count1
149 I , mycurrenttime, mycurrentiter, mythid )
150 ENDIF
151 #endif /* ALLOW_SEAICE */
152 #ifdef ALLOW_PTRACERS
153 if ( usePTRACERS ) then
154 do itracer = 1, PTRACERS_numInUse
155 call exf_set_obcs_xz( OBSptr (1-Olx,1,1,1,iTracer)
156 I , OBSptr0(1-Olx,1,1,1,iTracer)
157 I , OBSptr1(1-Olx,1,1,1,iTracer)
158 I , OBSptrFile(iTracer), 's'
159 I , fac, first, changed, count0, count1
160 I , mycurrenttime, mycurrentiter, mythid )
161 enddo
162 endif
163 #endif /* ALLOW_PTRACERS */
164 #endif /* ALLOW_OBCS_SOUTH */
165
166 #ifdef ALLOW_OBCS_EAST
167 call exf_getffieldrec(
168 I obcsEstartdate, obcsEperiod
169 I , obcsEstartdate1, obcsEstartdate2
170 I , .false.
171 O , fac, first, changed
172 O , count0, count1, year0, year1
173 I , mycurrenttime, mycurrentiter, mythid
174 & )
175
176 call exf_set_obcs_yz( OBEu, OBEu0, OBEu1, OBEufile, 'u'
177 I , fac, first, changed, count0, count1
178 I , mycurrenttime, mycurrentiter, mythid )
179 call exf_set_obcs_yz( OBEv, OBEv0, OBEv1, OBEvfile, 'v'
180 I , fac, first, changed, count0, count1
181 I , mycurrenttime, mycurrentiter, mythid )
182 call exf_set_obcs_yz( OBEt, OBEt0, OBEt1, OBEtfile, 's'
183 I , fac, first, changed, count0, count1
184 I , mycurrenttime, mycurrentiter, mythid )
185 call exf_set_obcs_yz( OBEs, OBEs0, OBEs1, OBEsfile, 's'
186 I , fac, first, changed, count0, count1
187 I , mycurrenttime, mycurrentiter, mythid )
188 #ifdef ALLOW_SEAICE
189 IF (useSEAICE) THEN
190 call exf_set_obcs_y ( OBEa, OBEa0, OBEa1, OBEafile, 's'
191 I , fac, first, changed, count0, count1
192 I , mycurrenttime, mycurrentiter, mythid )
193 call exf_set_obcs_y ( OBEh, OBEh0, OBEh1, OBEhfile, 's'
194 I , fac, first, changed, count0, count1
195 I , mycurrenttime, mycurrentiter, mythid )
196 call exf_set_obcs_y ( OBEsl, OBEsl0, OBEsl1, OBEslfile, 's'
197 I , fac, first, changed, count0, count1
198 I , mycurrenttime, mycurrentiter, mythid )
199 call exf_set_obcs_y ( OBEsn, OBEsn0, OBEsn1, OBEsnfile, 's'
200 I , fac, first, changed, count0, count1
201 I , mycurrenttime, mycurrentiter, mythid )
202 ENDIF
203 #endif /* ALLOW_SEAICE */
204 #ifdef ALLOW_PTRACERS
205 if ( usePTRACERS ) then
206 do itracer = 1, PTRACERS_numInUse
207 call exf_set_obcs_yz( OBEptr (1-Oly,1,1,1,iTracer)
208 I , OBEptr0(1-Oly,1,1,1,iTracer)
209 I , OBEptr1(1-Oly,1,1,1,iTracer)
210 I , OBEptrFile(iTracer), 's'
211 I , fac, first, changed, count0, count1
212 I , mycurrenttime, mycurrentiter, mythid )
213 enddo
214 endif
215 #endif /* ALLOW_PTRACERS */
216 #endif /* ALLOW_OBCS_EAST */
217
218 #ifdef ALLOW_OBCS_WEST
219 call exf_getffieldrec(
220 I obcsWstartdate, obcsWperiod
221 I , obcsWstartdate1, obcsWstartdate2
222 I , .false.
223 O , fac, first, changed
224 O , count0, count1, year0, year1
225 I , mycurrenttime, mycurrentiter, mythid
226 & )
227
228 call exf_set_obcs_yz( OBWu, OBWu0, OBWu1, OBWufile, 'u'
229 I , fac, first, changed, count0, count1
230 I , mycurrenttime, mycurrentiter, mythid )
231 call exf_set_obcs_yz( OBWv, OBWv0, OBWv1, OBWvfile, 'v'
232 I , fac, first, changed, count0, count1
233 I , mycurrenttime, mycurrentiter, mythid )
234 call exf_set_obcs_yz( OBWt, OBWt0, OBWt1, OBWtfile, 's'
235 I , fac, first, changed, count0, count1
236 I , mycurrenttime, mycurrentiter, mythid )
237 call exf_set_obcs_yz( OBWs, OBWs0, OBWs1, OBWsfile, 's'
238 I , fac, first, changed, count0, count1
239 I , mycurrenttime, mycurrentiter, mythid )
240 #ifdef ALLOW_SEAICE
241 IF (useSEAICE) THEN
242 call exf_set_obcs_y ( OBWa, OBWa0, OBWa1, OBWafile, 's'
243 I , fac, first, changed, count0, count1
244 I , mycurrenttime, mycurrentiter, mythid )
245 call exf_set_obcs_y ( OBWh, OBWh0, OBWh1, OBWhfile, 's'
246 I , fac, first, changed, count0, count1
247 I , mycurrenttime, mycurrentiter, mythid )
248 call exf_set_obcs_y ( OBWsl, OBWsl0, OBWsl1, OBWslfile, 's'
249 I , fac, first, changed, count0, count1
250 I , mycurrenttime, mycurrentiter, mythid )
251 call exf_set_obcs_y ( OBWsn, OBWsn0, OBWsn1, OBWsnfile, 's'
252 I , fac, first, changed, count0, count1
253 I , mycurrenttime, mycurrentiter, mythid )
254 ENDIF
255 #endif /* ALLOW_SEAICE */
256 #ifdef ALLOW_PTRACERS
257 if ( usePTRACERS ) then
258 do itracer = 1, PTRACERS_numInUse
259 call exf_set_obcs_yz( OBWptr (1-Oly,1,1,1,iTracer)
260 I , OBWptr0(1-Oly,1,1,1,iTracer)
261 I , OBWptr1(1-Oly,1,1,1,iTracer)
262 I , OBWptrFile(iTracer), 's'
263 I , fac, first, changed, count0, count1
264 I , mycurrenttime, mycurrentiter, mythid )
265 enddo
266 endif
267 #endif /* ALLOW_PTRACERS */
268 #endif /* ALLOW_OBCS_WEST */
269
270 #ifdef ALLOW_OBCS_CONTROL
271 cgg WARNING: Assuming North Open Boundary exists and has same
272 cgg calendar information as other boundaries.
273 call ctrl_obcsbal ( mycurrenttime,mycurrentiter,mythid )
274 #endif
275
276 #ifdef ALLOW_OBCSN_CONTROL
277 call ctrl_getobcsn ( mycurrenttime, mycurrentiter, mythid )
278 #endif
279
280 #ifdef ALLOW_OBCSS_CONTROL
281 call ctrl_getobcss ( mycurrenttime, mycurrentiter, mythid )
282 #endif
283
284 #ifdef ALLOW_OBCSW_CONTROL
285 call ctrl_getobcsw ( mycurrenttime, mycurrentiter, mythid )
286 #endif
287
288 #ifdef ALLOW_OBCSE_CONTROL
289 call ctrl_getobcse ( mycurrenttime, mycurrentiter, mythid )
290 #endif
291
292 #else /* not ALLOW_EXF */
293 CALL OBCS_EXTERNAL_FIELDS_LOAD(
294 & myCurrentTime, myCurrentIter, myThid )
295 #endif /* ALLOw_EXF */
296
297 #endif /* ALLOW_OBCS */
298
299 RETURN
300 END

  ViewVC Help
Powered by ViewVC 1.1.22