1 |
C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_prescribe_read.F,v 1.10 2007/04/16 23:35:58 jmc 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 |
#ifdef ALLOW_PTRACERS.h |
31 |
# include "PARAMS.h" |
32 |
# include "PTRACERS_SIZE.h" |
33 |
# include "PTRACERS.h" |
34 |
# include "OBCS_PTRACERS.h" |
35 |
#endif /* ALLOW_PTRACERS */ |
36 |
|
37 |
c == routine arguments == |
38 |
|
39 |
_RL mycurrenttime |
40 |
integer mycurrentiter |
41 |
integer mythid |
42 |
|
43 |
#if (defined (ALLOW_OBCS) && defined (ALLOW_OBCS_PRESCRIBE)) |
44 |
|
45 |
c == local variables == |
46 |
|
47 |
#ifdef ALLOW_EXF |
48 |
logical first, changed |
49 |
integer count0, count1 |
50 |
integer year0, year1 |
51 |
_RL fac |
52 |
#ifdef ALLOW_PTRACERS |
53 |
integer iTracer, i,j,k |
54 |
#endif /* ALLOW_PTRACERS */ |
55 |
#endif /* ALLOW_EXF */ |
56 |
|
57 |
c == end of interface == |
58 |
|
59 |
#ifdef ALLOW_EXF |
60 |
#ifdef ALLOW_OBCS_NORTH |
61 |
call exf_getffieldrec( |
62 |
I obcsNstartdate, obcsNperiod |
63 |
I , obcsNstartdate1, obcsNstartdate2 |
64 |
I , .false. |
65 |
O , fac, first, changed |
66 |
O , count0, count1, year0, year1 |
67 |
I , mycurrenttime, mycurrentiter, mythid |
68 |
& ) |
69 |
|
70 |
call exf_set_obcs_xz( OBNu, OBNu0, OBNu1, OBNufile, 'u' |
71 |
I , fac, first, changed, count0, count1 |
72 |
I , mycurrenttime, mycurrentiter, mythid ) |
73 |
call exf_set_obcs_xz( OBNv, OBNv0, OBNv1, OBNvfile, 'v' |
74 |
I , fac, first, changed, count0, count1 |
75 |
I , mycurrenttime, mycurrentiter, mythid ) |
76 |
call exf_set_obcs_xz( OBNt, OBNt0, OBNt1, OBNtfile, 's' |
77 |
I , fac, first, changed, count0, count1 |
78 |
I , mycurrenttime, mycurrentiter, mythid ) |
79 |
call exf_set_obcs_xz( OBNs, OBNs0, OBNs1, OBNsfile, 's' |
80 |
I , fac, first, changed, count0, count1 |
81 |
I , mycurrenttime, mycurrentiter, mythid ) |
82 |
#ifdef ALLOW_SEAICE |
83 |
call exf_set_obcs_x ( OBNa, OBNa0, OBNa1, OBNafile, 's' |
84 |
I , fac, first, changed, count0, count1 |
85 |
I , mycurrenttime, mycurrentiter, mythid ) |
86 |
call exf_set_obcs_x ( OBNh, OBNh0, OBNh1, OBNhfile, 's' |
87 |
I , fac, first, changed, count0, count1 |
88 |
I , mycurrenttime, mycurrentiter, mythid ) |
89 |
#endif /* ALLOW_SEAICE */ |
90 |
#ifdef ALLOW_PTRACERS |
91 |
if ( usePTRACERS ) then |
92 |
do itracer = 1, PTRACERS_numInUse |
93 |
call exf_set_obcs_xz( OBNptr (1-Olx,1,1,1,iTracer) |
94 |
I , OBNptr0(1-Olx,1,1,1,iTracer) |
95 |
I , OBNptr1(1-Olx,1,1,1,iTracer) |
96 |
I , OBNptrFile(iTracer), 's' |
97 |
I , fac, first, changed, count0, count1 |
98 |
I , mycurrenttime, mycurrentiter, mythid ) |
99 |
enddo |
100 |
endif |
101 |
#endif /* ALLOW_PTRACERS */ |
102 |
#endif /* ALLOW_OBCS_NORTH */ |
103 |
|
104 |
#ifdef ALLOW_OBCS_SOUTH |
105 |
call exf_getffieldrec( |
106 |
I obcsSstartdate, obcsSperiod |
107 |
I , obcsSstartdate1, obcsSstartdate2 |
108 |
I , .false. |
109 |
O , fac, first, changed |
110 |
O , count0, count1, year0, year1 |
111 |
I , mycurrenttime, mycurrentiter, mythid |
112 |
& ) |
113 |
|
114 |
call exf_set_obcs_xz( OBSu, OBSu0, OBSu1, OBSufile, 'u' |
115 |
I , fac, first, changed, count0, count1 |
116 |
I , mycurrenttime, mycurrentiter, mythid ) |
117 |
call exf_set_obcs_xz( OBSv, OBSv0, OBSv1, OBSvfile, 'v' |
118 |
I , fac, first, changed, count0, count1 |
119 |
I , mycurrenttime, mycurrentiter, mythid ) |
120 |
call exf_set_obcs_xz( OBSt, OBSt0, OBSt1, OBStfile, 's' |
121 |
I , fac, first, changed, count0, count1 |
122 |
I , mycurrenttime, mycurrentiter, mythid ) |
123 |
call exf_set_obcs_xz( OBSs, OBSs0, OBSs1, OBSsfile, 's' |
124 |
I , fac, first, changed, count0, count1 |
125 |
I , mycurrenttime, mycurrentiter, mythid ) |
126 |
#ifdef ALLOW_SEAICE |
127 |
call exf_set_obcs_x ( OBSa, OBSa0, OBSa1, OBSafile, 's' |
128 |
I , fac, first, changed, count0, count1 |
129 |
I , mycurrenttime, mycurrentiter, mythid ) |
130 |
call exf_set_obcs_x ( OBSh, OBSh0, OBSh1, OBShfile, 's' |
131 |
I , fac, first, changed, count0, count1 |
132 |
I , mycurrenttime, mycurrentiter, mythid ) |
133 |
#endif /* ALLOW_SEAICE */ |
134 |
#ifdef ALLOW_PTRACERS |
135 |
if ( usePTRACERS ) then |
136 |
do itracer = 1, PTRACERS_numInUse |
137 |
call exf_set_obcs_xz( OBSptr (1-Olx,1,1,1,iTracer) |
138 |
I , OBSptr0(1-Olx,1,1,1,iTracer) |
139 |
I , OBSptr1(1-Olx,1,1,1,iTracer) |
140 |
I , OBSptrFile(iTracer), 's' |
141 |
I , fac, first, changed, count0, count1 |
142 |
I , mycurrenttime, mycurrentiter, mythid ) |
143 |
enddo |
144 |
endif |
145 |
#endif /* ALLOW_PTRACERS */ |
146 |
#endif /* ALLOW_OBCS_SOUTH */ |
147 |
|
148 |
#ifdef ALLOW_OBCS_EAST |
149 |
call exf_getffieldrec( |
150 |
I obcsEstartdate, obcsEperiod |
151 |
I , obcsEstartdate1, obcsEstartdate2 |
152 |
I , .false. |
153 |
O , fac, first, changed |
154 |
O , count0, count1, year0, year1 |
155 |
I , mycurrenttime, mycurrentiter, mythid |
156 |
& ) |
157 |
|
158 |
call exf_set_obcs_yz( OBEu, OBEu0, OBEu1, OBEufile, 'u' |
159 |
I , fac, first, changed, count0, count1 |
160 |
I , mycurrenttime, mycurrentiter, mythid ) |
161 |
call exf_set_obcs_yz( OBEv, OBEv0, OBEv1, OBEvfile, 'v' |
162 |
I , fac, first, changed, count0, count1 |
163 |
I , mycurrenttime, mycurrentiter, mythid ) |
164 |
call exf_set_obcs_yz( OBEt, OBEt0, OBEt1, OBEtfile, 's' |
165 |
I , fac, first, changed, count0, count1 |
166 |
I , mycurrenttime, mycurrentiter, mythid ) |
167 |
call exf_set_obcs_yz( OBEs, OBEs0, OBEs1, OBEsfile, 's' |
168 |
I , fac, first, changed, count0, count1 |
169 |
I , mycurrenttime, mycurrentiter, mythid ) |
170 |
#ifdef ALLOW_SEAICE |
171 |
call exf_set_obcs_y ( OBEa, OBEa0, OBEa1, OBEafile, 's' |
172 |
I , fac, first, changed, count0, count1 |
173 |
I , mycurrenttime, mycurrentiter, mythid ) |
174 |
call exf_set_obcs_y ( OBEh, OBEh0, OBEh1, OBEhfile, 's' |
175 |
I , fac, first, changed, count0, count1 |
176 |
I , mycurrenttime, mycurrentiter, mythid ) |
177 |
#endif /* ALLOW_SEAICE */ |
178 |
#ifdef ALLOW_PTRACERS |
179 |
if ( usePTRACERS ) then |
180 |
do itracer = 1, PTRACERS_numInUse |
181 |
call exf_set_obcs_yz( OBEptr (1-Oly,1,1,1,iTracer) |
182 |
I , OBEptr0(1-Oly,1,1,1,iTracer) |
183 |
I , OBEptr1(1-Oly,1,1,1,iTracer) |
184 |
I , OBEptrFile(iTracer), 's' |
185 |
I , fac, first, changed, count0, count1 |
186 |
I , mycurrenttime, mycurrentiter, mythid ) |
187 |
enddo |
188 |
endif |
189 |
#endif /* ALLOW_PTRACERS */ |
190 |
#endif /* ALLOW_OBCS_EAST */ |
191 |
|
192 |
#ifdef ALLOW_OBCS_WEST |
193 |
call exf_getffieldrec( |
194 |
I obcsWstartdate, obcsWperiod |
195 |
I , obcsWstartdate1, obcsWstartdate2 |
196 |
I , .false. |
197 |
O , fac, first, changed |
198 |
O , count0, count1, year0, year1 |
199 |
I , mycurrenttime, mycurrentiter, mythid |
200 |
& ) |
201 |
|
202 |
call exf_set_obcs_yz( OBWu, OBWu0, OBWu1, OBWufile, 'u' |
203 |
I , fac, first, changed, count0, count1 |
204 |
I , mycurrenttime, mycurrentiter, mythid ) |
205 |
call exf_set_obcs_yz( OBWv, OBWv0, OBWv1, OBWvfile, 'v' |
206 |
I , fac, first, changed, count0, count1 |
207 |
I , mycurrenttime, mycurrentiter, mythid ) |
208 |
call exf_set_obcs_yz( OBWt, OBWt0, OBWt1, OBWtfile, 's' |
209 |
I , fac, first, changed, count0, count1 |
210 |
I , mycurrenttime, mycurrentiter, mythid ) |
211 |
call exf_set_obcs_yz( OBWs, OBWs0, OBWs1, OBWsfile, 's' |
212 |
I , fac, first, changed, count0, count1 |
213 |
I , mycurrenttime, mycurrentiter, mythid ) |
214 |
#ifdef ALLOW_SEAICE |
215 |
call exf_set_obcs_y ( OBWa, OBWa0, OBWa1, OBWafile, 's' |
216 |
I , fac, first, changed, count0, count1 |
217 |
I , mycurrenttime, mycurrentiter, mythid ) |
218 |
call exf_set_obcs_y ( OBWh, OBWh0, OBWh1, OBWhfile, 's' |
219 |
I , fac, first, changed, count0, count1 |
220 |
I , mycurrenttime, mycurrentiter, mythid ) |
221 |
#endif /* ALLOW_SEAICE */ |
222 |
#ifdef ALLOW_PTRACERS |
223 |
if ( usePTRACERS ) then |
224 |
do itracer = 1, PTRACERS_numInUse |
225 |
call exf_set_obcs_yz( OBWptr (1-Oly,1,1,1,iTracer) |
226 |
I , OBWptr0(1-Oly,1,1,1,iTracer) |
227 |
I , OBWptr1(1-Oly,1,1,1,iTracer) |
228 |
I , OBWptrFile(iTracer), 's' |
229 |
I , fac, first, changed, count0, count1 |
230 |
I , mycurrenttime, mycurrentiter, mythid ) |
231 |
enddo |
232 |
endif |
233 |
#endif /* ALLOW_PTRACERS */ |
234 |
#endif /* ALLOW_OBCS_WEST */ |
235 |
|
236 |
#ifdef ALLOW_OBCS_CONTROL |
237 |
cgg WARNING: Assuming North Open Boundary exists and has same |
238 |
cgg calendar information as other boundaries. |
239 |
call ctrl_obcsbal ( mycurrenttime,mycurrentiter,mythid ) |
240 |
#endif |
241 |
|
242 |
#ifdef ALLOW_OBCSN_CONTROL |
243 |
call ctrl_getobcsn ( mycurrenttime, mycurrentiter, mythid ) |
244 |
#endif |
245 |
|
246 |
#ifdef ALLOW_OBCSS_CONTROL |
247 |
call ctrl_getobcss ( mycurrenttime, mycurrentiter, mythid ) |
248 |
#endif |
249 |
|
250 |
#ifdef ALLOW_OBCSW_CONTROL |
251 |
call ctrl_getobcsw ( mycurrenttime, mycurrentiter, mythid ) |
252 |
#endif |
253 |
|
254 |
#ifdef ALLOW_OBCSE_CONTROL |
255 |
call ctrl_getobcse ( mycurrenttime, mycurrentiter, mythid ) |
256 |
#endif |
257 |
|
258 |
#else /* not ALLOW_EXF */ |
259 |
CALL OBCS_EXTERNAL_FIELDS_LOAD( |
260 |
& myCurrentTime, myCurrentIter, myThid ) |
261 |
#endif /* ALLOw_EXF */ |
262 |
|
263 |
#endif /* ALLOW_OBCS */ |
264 |
|
265 |
RETURN |
266 |
END |