1 |
C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_prescribe_read.F,v 1.11 2007/10/11 01:29:16 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 |
ENDIF |
93 |
#endif /* ALLOW_SEAICE */ |
94 |
#ifdef ALLOW_PTRACERS |
95 |
if ( usePTRACERS ) then |
96 |
do itracer = 1, PTRACERS_numInUse |
97 |
call exf_set_obcs_xz( OBNptr (1-Olx,1,1,1,iTracer) |
98 |
I , OBNptr0(1-Olx,1,1,1,iTracer) |
99 |
I , OBNptr1(1-Olx,1,1,1,iTracer) |
100 |
I , OBNptrFile(iTracer), 's' |
101 |
I , fac, first, changed, count0, count1 |
102 |
I , mycurrenttime, mycurrentiter, mythid ) |
103 |
enddo |
104 |
endif |
105 |
#endif /* ALLOW_PTRACERS */ |
106 |
#endif /* ALLOW_OBCS_NORTH */ |
107 |
|
108 |
#ifdef ALLOW_OBCS_SOUTH |
109 |
call exf_getffieldrec( |
110 |
I obcsSstartdate, obcsSperiod |
111 |
I , obcsSstartdate1, obcsSstartdate2 |
112 |
I , .false. |
113 |
O , fac, first, changed |
114 |
O , count0, count1, year0, year1 |
115 |
I , mycurrenttime, mycurrentiter, mythid |
116 |
& ) |
117 |
|
118 |
call exf_set_obcs_xz( OBSu, OBSu0, OBSu1, OBSufile, 'u' |
119 |
I , fac, first, changed, count0, count1 |
120 |
I , mycurrenttime, mycurrentiter, mythid ) |
121 |
call exf_set_obcs_xz( OBSv, OBSv0, OBSv1, OBSvfile, 'v' |
122 |
I , fac, first, changed, count0, count1 |
123 |
I , mycurrenttime, mycurrentiter, mythid ) |
124 |
call exf_set_obcs_xz( OBSt, OBSt0, OBSt1, OBStfile, 's' |
125 |
I , fac, first, changed, count0, count1 |
126 |
I , mycurrenttime, mycurrentiter, mythid ) |
127 |
call exf_set_obcs_xz( OBSs, OBSs0, OBSs1, OBSsfile, 's' |
128 |
I , fac, first, changed, count0, count1 |
129 |
I , mycurrenttime, mycurrentiter, mythid ) |
130 |
#ifdef ALLOW_SEAICE |
131 |
IF (useSEAICE) THEN |
132 |
call exf_set_obcs_x ( OBSa, OBSa0, OBSa1, OBSafile, 's' |
133 |
I , fac, first, changed, count0, count1 |
134 |
I , mycurrenttime, mycurrentiter, mythid ) |
135 |
call exf_set_obcs_x ( OBSh, OBSh0, OBSh1, OBShfile, 's' |
136 |
I , fac, first, changed, count0, count1 |
137 |
I , mycurrenttime, mycurrentiter, mythid ) |
138 |
ENDIF |
139 |
#endif /* ALLOW_SEAICE */ |
140 |
#ifdef ALLOW_PTRACERS |
141 |
if ( usePTRACERS ) then |
142 |
do itracer = 1, PTRACERS_numInUse |
143 |
call exf_set_obcs_xz( OBSptr (1-Olx,1,1,1,iTracer) |
144 |
I , OBSptr0(1-Olx,1,1,1,iTracer) |
145 |
I , OBSptr1(1-Olx,1,1,1,iTracer) |
146 |
I , OBSptrFile(iTracer), 's' |
147 |
I , fac, first, changed, count0, count1 |
148 |
I , mycurrenttime, mycurrentiter, mythid ) |
149 |
enddo |
150 |
endif |
151 |
#endif /* ALLOW_PTRACERS */ |
152 |
#endif /* ALLOW_OBCS_SOUTH */ |
153 |
|
154 |
#ifdef ALLOW_OBCS_EAST |
155 |
call exf_getffieldrec( |
156 |
I obcsEstartdate, obcsEperiod |
157 |
I , obcsEstartdate1, obcsEstartdate2 |
158 |
I , .false. |
159 |
O , fac, first, changed |
160 |
O , count0, count1, year0, year1 |
161 |
I , mycurrenttime, mycurrentiter, mythid |
162 |
& ) |
163 |
|
164 |
call exf_set_obcs_yz( OBEu, OBEu0, OBEu1, OBEufile, 'u' |
165 |
I , fac, first, changed, count0, count1 |
166 |
I , mycurrenttime, mycurrentiter, mythid ) |
167 |
call exf_set_obcs_yz( OBEv, OBEv0, OBEv1, OBEvfile, 'v' |
168 |
I , fac, first, changed, count0, count1 |
169 |
I , mycurrenttime, mycurrentiter, mythid ) |
170 |
call exf_set_obcs_yz( OBEt, OBEt0, OBEt1, OBEtfile, 's' |
171 |
I , fac, first, changed, count0, count1 |
172 |
I , mycurrenttime, mycurrentiter, mythid ) |
173 |
call exf_set_obcs_yz( OBEs, OBEs0, OBEs1, OBEsfile, 's' |
174 |
I , fac, first, changed, count0, count1 |
175 |
I , mycurrenttime, mycurrentiter, mythid ) |
176 |
#ifdef ALLOW_SEAICE |
177 |
IF (useSEAICE) THEN |
178 |
call exf_set_obcs_y ( OBEa, OBEa0, OBEa1, OBEafile, 's' |
179 |
I , fac, first, changed, count0, count1 |
180 |
I , mycurrenttime, mycurrentiter, mythid ) |
181 |
call exf_set_obcs_y ( OBEh, OBEh0, OBEh1, OBEhfile, 's' |
182 |
I , fac, first, changed, count0, count1 |
183 |
I , mycurrenttime, mycurrentiter, mythid ) |
184 |
ENDIF |
185 |
#endif /* ALLOW_SEAICE */ |
186 |
#ifdef ALLOW_PTRACERS |
187 |
if ( usePTRACERS ) then |
188 |
do itracer = 1, PTRACERS_numInUse |
189 |
call exf_set_obcs_yz( OBEptr (1-Oly,1,1,1,iTracer) |
190 |
I , OBEptr0(1-Oly,1,1,1,iTracer) |
191 |
I , OBEptr1(1-Oly,1,1,1,iTracer) |
192 |
I , OBEptrFile(iTracer), 's' |
193 |
I , fac, first, changed, count0, count1 |
194 |
I , mycurrenttime, mycurrentiter, mythid ) |
195 |
enddo |
196 |
endif |
197 |
#endif /* ALLOW_PTRACERS */ |
198 |
#endif /* ALLOW_OBCS_EAST */ |
199 |
|
200 |
#ifdef ALLOW_OBCS_WEST |
201 |
call exf_getffieldrec( |
202 |
I obcsWstartdate, obcsWperiod |
203 |
I , obcsWstartdate1, obcsWstartdate2 |
204 |
I , .false. |
205 |
O , fac, first, changed |
206 |
O , count0, count1, year0, year1 |
207 |
I , mycurrenttime, mycurrentiter, mythid |
208 |
& ) |
209 |
|
210 |
call exf_set_obcs_yz( OBWu, OBWu0, OBWu1, OBWufile, 'u' |
211 |
I , fac, first, changed, count0, count1 |
212 |
I , mycurrenttime, mycurrentiter, mythid ) |
213 |
call exf_set_obcs_yz( OBWv, OBWv0, OBWv1, OBWvfile, 'v' |
214 |
I , fac, first, changed, count0, count1 |
215 |
I , mycurrenttime, mycurrentiter, mythid ) |
216 |
call exf_set_obcs_yz( OBWt, OBWt0, OBWt1, OBWtfile, 's' |
217 |
I , fac, first, changed, count0, count1 |
218 |
I , mycurrenttime, mycurrentiter, mythid ) |
219 |
call exf_set_obcs_yz( OBWs, OBWs0, OBWs1, OBWsfile, 's' |
220 |
I , fac, first, changed, count0, count1 |
221 |
I , mycurrenttime, mycurrentiter, mythid ) |
222 |
#ifdef ALLOW_SEAICE |
223 |
IF (useSEAICE) THEN |
224 |
call exf_set_obcs_y ( OBWa, OBWa0, OBWa1, OBWafile, 's' |
225 |
I , fac, first, changed, count0, count1 |
226 |
I , mycurrenttime, mycurrentiter, mythid ) |
227 |
call exf_set_obcs_y ( OBWh, OBWh0, OBWh1, OBWhfile, 's' |
228 |
I , fac, first, changed, count0, count1 |
229 |
I , mycurrenttime, mycurrentiter, mythid ) |
230 |
ENDIF |
231 |
#endif /* ALLOW_SEAICE */ |
232 |
#ifdef ALLOW_PTRACERS |
233 |
if ( usePTRACERS ) then |
234 |
do itracer = 1, PTRACERS_numInUse |
235 |
call exf_set_obcs_yz( OBWptr (1-Oly,1,1,1,iTracer) |
236 |
I , OBWptr0(1-Oly,1,1,1,iTracer) |
237 |
I , OBWptr1(1-Oly,1,1,1,iTracer) |
238 |
I , OBWptrFile(iTracer), 's' |
239 |
I , fac, first, changed, count0, count1 |
240 |
I , mycurrenttime, mycurrentiter, mythid ) |
241 |
enddo |
242 |
endif |
243 |
#endif /* ALLOW_PTRACERS */ |
244 |
#endif /* ALLOW_OBCS_WEST */ |
245 |
|
246 |
#ifdef ALLOW_OBCS_CONTROL |
247 |
cgg WARNING: Assuming North Open Boundary exists and has same |
248 |
cgg calendar information as other boundaries. |
249 |
call ctrl_obcsbal ( mycurrenttime,mycurrentiter,mythid ) |
250 |
#endif |
251 |
|
252 |
#ifdef ALLOW_OBCSN_CONTROL |
253 |
call ctrl_getobcsn ( mycurrenttime, mycurrentiter, mythid ) |
254 |
#endif |
255 |
|
256 |
#ifdef ALLOW_OBCSS_CONTROL |
257 |
call ctrl_getobcss ( mycurrenttime, mycurrentiter, mythid ) |
258 |
#endif |
259 |
|
260 |
#ifdef ALLOW_OBCSW_CONTROL |
261 |
call ctrl_getobcsw ( mycurrenttime, mycurrentiter, mythid ) |
262 |
#endif |
263 |
|
264 |
#ifdef ALLOW_OBCSE_CONTROL |
265 |
call ctrl_getobcse ( mycurrenttime, mycurrentiter, mythid ) |
266 |
#endif |
267 |
|
268 |
#else /* not ALLOW_EXF */ |
269 |
CALL OBCS_EXTERNAL_FIELDS_LOAD( |
270 |
& myCurrentTime, myCurrentIter, myThid ) |
271 |
#endif /* ALLOw_EXF */ |
272 |
|
273 |
#endif /* ALLOW_OBCS */ |
274 |
|
275 |
RETURN |
276 |
END |