1 |
heimbach |
1.1 |
|
2 |
|
|
#include "CPP_OPTIONS.h" |
3 |
|
|
|
4 |
|
|
c ================================================================== |
5 |
|
|
c |
6 |
|
|
c active_file.F: Routines to handle the I/O of the active file for |
7 |
|
|
c the adjoint calculations. All files are direct |
8 |
|
|
c access files. |
9 |
|
|
c |
10 |
|
|
c Routines |
11 |
|
|
c |
12 |
|
|
c o active_read_xy - Read an active 2D variable from file. |
13 |
|
|
c o active_read_xyz - Read an active 3D variable from file. |
14 |
|
|
c o active_read_xz - Read an active 2D xz-slice from file. |
15 |
|
|
c o active_read_yz - Read an active 2D yz-slice from file. |
16 |
|
|
c |
17 |
|
|
c o active_write_xy - Write an active 2D variable to a file. |
18 |
|
|
c o active_write_xyz - Write an active 3D variable to a file. |
19 |
|
|
c o active_write_xz - Write an active 2D xz-slice to a file. |
20 |
|
|
c o active_write_yz - Write an active 2D yz-slice to a file. |
21 |
|
|
c |
22 |
|
|
c o active_read_tile_xy - Read an active 2D variable from file. |
23 |
|
|
c o active_read_tile_xyz - Read an active 3D variable from file. |
24 |
|
|
c |
25 |
|
|
c o active_write_tile_xy - Write an active 2D variable to a file. |
26 |
|
|
c o active_write_tile_xyz - Write an active 3D variable to a file. |
27 |
|
|
c |
28 |
|
|
c |
29 |
|
|
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
30 |
|
|
c - Added routines that do active writes on tiles |
31 |
|
|
c instead of a whole thread. |
32 |
heimbach |
1.2 |
c changed: heimbach@mit.edu 05-Mar-2001 |
33 |
|
|
c - added active file handling of xz-/yz-arrays |
34 |
heimbach |
1.1 |
c |
35 |
|
|
c ================================================================== |
36 |
|
|
|
37 |
|
|
|
38 |
heimbach |
1.2 |
CBOP |
39 |
|
|
C !ROUTINE: active_read_xy |
40 |
|
|
C !INTERFACE: |
41 |
heimbach |
1.1 |
subroutine active_read_xy( |
42 |
|
|
I active_var_file, |
43 |
|
|
O active_var, |
44 |
|
|
I irec, |
45 |
|
|
I doglobalread, |
46 |
|
|
I lAdInit, |
47 |
|
|
I myOptimIter, |
48 |
|
|
I mythid |
49 |
|
|
I , dummy |
50 |
|
|
& ) |
51 |
|
|
|
52 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
53 |
heimbach |
1.1 |
c ================================================================== |
54 |
|
|
c SUBROUTINE active_read_xy |
55 |
|
|
c ================================================================== |
56 |
heimbach |
1.2 |
c o Read an active 2D (XY) variable from file. |
57 |
heimbach |
1.1 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
58 |
|
|
c ================================================================== |
59 |
|
|
c SUBROUTINE active_read_xy |
60 |
|
|
c ================================================================== |
61 |
heimbach |
1.2 |
C \ev |
62 |
heimbach |
1.1 |
|
63 |
heimbach |
1.2 |
C !USES: |
64 |
heimbach |
1.1 |
implicit none |
65 |
|
|
|
66 |
|
|
c == global variables == |
67 |
|
|
#include "EEPARAMS.h" |
68 |
|
|
#include "SIZE.h" |
69 |
|
|
|
70 |
heimbach |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
71 |
heimbach |
1.1 |
c == routine arguments == |
72 |
heimbach |
1.2 |
c active_var_file: filename |
73 |
|
|
c active_var: array |
74 |
|
|
c irec: record number |
75 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
76 |
|
|
c mythid: thread number for this instance |
77 |
|
|
c doglobalread: flag for global or local read/write |
78 |
|
|
c (default: .false.) |
79 |
|
|
c lAdInit: initialisation of corresponding adjoint |
80 |
|
|
c variable and write to active file |
81 |
heimbach |
1.1 |
character*(*) active_var_file |
82 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
83 |
|
|
integer irec |
84 |
|
|
integer myOptimIter |
85 |
|
|
integer mythid |
86 |
|
|
logical doglobalread |
87 |
|
|
logical lAdInit |
88 |
|
|
_RL dummy |
89 |
|
|
|
90 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
91 |
heimbach |
1.1 |
c == local variables == |
92 |
|
|
integer mynr |
93 |
|
|
|
94 |
|
|
c == end of interface == |
95 |
heimbach |
1.2 |
CEOP |
96 |
heimbach |
1.1 |
|
97 |
|
|
mynr = 1 |
98 |
|
|
call active_read_rl( active_var_file, active_var, doglobalread, |
99 |
|
|
& lAdInit, irec, mynr, |
100 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid) |
101 |
|
|
|
102 |
|
|
return |
103 |
|
|
end |
104 |
|
|
|
105 |
|
|
c ================================================================== |
106 |
|
|
|
107 |
heimbach |
1.2 |
CBOP |
108 |
|
|
C !ROUTINE: active_read_xyz |
109 |
|
|
C !INTERFACE: |
110 |
heimbach |
1.1 |
subroutine active_read_xyz( |
111 |
|
|
I active_var_file, |
112 |
|
|
O active_var, |
113 |
|
|
I irec, |
114 |
|
|
I doglobalread, |
115 |
|
|
I lAdInit, |
116 |
|
|
I myOptimIter, |
117 |
|
|
I mythid |
118 |
|
|
I , dummy |
119 |
|
|
& ) |
120 |
|
|
|
121 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
122 |
heimbach |
1.1 |
c ================================================================== |
123 |
|
|
c SUBROUTINE active_read_xyz |
124 |
|
|
c ================================================================== |
125 |
|
|
c o Read an active 3D variable from file. |
126 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
127 |
|
|
c ================================================================== |
128 |
|
|
c SUBROUTINE active_read_xyz |
129 |
|
|
c ================================================================== |
130 |
heimbach |
1.2 |
C \ev |
131 |
heimbach |
1.1 |
|
132 |
heimbach |
1.2 |
C !USES: |
133 |
heimbach |
1.1 |
implicit none |
134 |
|
|
|
135 |
|
|
c == global variables == |
136 |
|
|
#include "EEPARAMS.h" |
137 |
|
|
#include "SIZE.h" |
138 |
|
|
|
139 |
heimbach |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
140 |
heimbach |
1.1 |
c == routine arguments == |
141 |
heimbach |
1.2 |
c active_var_file: filename |
142 |
|
|
c active_var: array |
143 |
|
|
c irec: record number |
144 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
145 |
|
|
c mythid: thread number for this instance |
146 |
|
|
c doglobalread: flag for global or local read/write |
147 |
|
|
c (default: .false.) |
148 |
|
|
c lAdInit: initialisation of corresponding adjoint |
149 |
|
|
c variable and write to active file |
150 |
heimbach |
1.1 |
character*(*) active_var_file |
151 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
152 |
|
|
integer irec |
153 |
|
|
integer myOptimIter |
154 |
|
|
integer mythid |
155 |
|
|
logical doglobalread |
156 |
|
|
logical lAdInit |
157 |
|
|
_RL dummy |
158 |
|
|
|
159 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
160 |
heimbach |
1.1 |
c == local variables == |
161 |
|
|
integer mynr |
162 |
|
|
|
163 |
|
|
c == end of interface == |
164 |
heimbach |
1.2 |
CEOP |
165 |
heimbach |
1.1 |
|
166 |
|
|
mynr = nr |
167 |
|
|
call active_read_rl( active_var_file, active_var, doglobalread, |
168 |
|
|
& lAdInit, irec, mynr, |
169 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid) |
170 |
|
|
|
171 |
|
|
return |
172 |
|
|
end |
173 |
|
|
|
174 |
|
|
c ================================================================== |
175 |
|
|
|
176 |
|
|
|
177 |
heimbach |
1.2 |
CBOP |
178 |
|
|
C !ROUTINE: active_read_xz |
179 |
|
|
C !INTERFACE: |
180 |
heimbach |
1.1 |
subroutine active_read_xz( |
181 |
|
|
I active_var_file, |
182 |
|
|
O active_var, |
183 |
|
|
I irec, |
184 |
|
|
I doglobalread, |
185 |
|
|
I lAdInit, |
186 |
|
|
I myOptimIter, |
187 |
|
|
I mythid |
188 |
|
|
I , dummy |
189 |
|
|
& ) |
190 |
|
|
|
191 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
192 |
heimbach |
1.1 |
c ================================================================== |
193 |
|
|
c SUBROUTINE active_read_xz |
194 |
|
|
c ================================================================== |
195 |
|
|
c o Read an active 2D xz-slice from file. |
196 |
|
|
c started: heimbach@mit.edu 05-Mar-2001 |
197 |
|
|
c ================================================================== |
198 |
|
|
c SUBROUTINE active_read_xz |
199 |
|
|
c ================================================================== |
200 |
heimbach |
1.2 |
C \ev |
201 |
heimbach |
1.1 |
|
202 |
heimbach |
1.2 |
C !USES: |
203 |
heimbach |
1.1 |
implicit none |
204 |
|
|
|
205 |
|
|
c == global variables == |
206 |
|
|
#include "EEPARAMS.h" |
207 |
|
|
#include "SIZE.h" |
208 |
|
|
|
209 |
heimbach |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
210 |
heimbach |
1.1 |
c == routine arguments == |
211 |
heimbach |
1.2 |
c active_var_file: filename |
212 |
|
|
c active_var: array |
213 |
|
|
c irec: record number |
214 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
215 |
|
|
c mythid: thread number for this instance |
216 |
|
|
c doglobalread: flag for global or local read/write |
217 |
|
|
c (default: .false.) |
218 |
|
|
c lAdInit: initialisation of corresponding adjoint |
219 |
|
|
c variable and write to active file |
220 |
heimbach |
1.1 |
character*(*) active_var_file |
221 |
|
|
_RL active_var(1-olx:snx+olx,nsx,nsy) |
222 |
|
|
integer irec |
223 |
|
|
integer myOptimIter |
224 |
|
|
integer mythid |
225 |
|
|
logical doglobalread |
226 |
|
|
logical lAdInit |
227 |
|
|
_RL dummy |
228 |
|
|
|
229 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
230 |
heimbach |
1.1 |
c == local variables == |
231 |
|
|
integer mynr |
232 |
|
|
|
233 |
|
|
c == end of interface == |
234 |
heimbach |
1.2 |
CEOP |
235 |
heimbach |
1.1 |
|
236 |
|
|
mynr = 1 |
237 |
|
|
call active_read_xz_rl( active_var_file, active_var, doglobalread, |
238 |
|
|
& lAdInit, irec, mynr, |
239 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid) |
240 |
|
|
|
241 |
|
|
return |
242 |
|
|
end |
243 |
|
|
|
244 |
|
|
c ================================================================== |
245 |
|
|
|
246 |
|
|
|
247 |
heimbach |
1.2 |
CBOP |
248 |
|
|
C !ROUTINE: active_read_yz |
249 |
|
|
C !INTERFACE: |
250 |
|
|
subroutine active_read_yz( |
251 |
heimbach |
1.1 |
I active_var_file, |
252 |
|
|
O active_var, |
253 |
|
|
I irec, |
254 |
|
|
I doglobalread, |
255 |
|
|
I lAdInit, |
256 |
|
|
I myOptimIter, |
257 |
|
|
I mythid |
258 |
|
|
I , dummy |
259 |
|
|
& ) |
260 |
|
|
|
261 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
262 |
heimbach |
1.1 |
c ================================================================== |
263 |
|
|
c SUBROUTINE active_read_yz |
264 |
|
|
c ================================================================== |
265 |
|
|
c o Read an active 2D yz-slice from file. |
266 |
|
|
c started: heimbach@mit.edu 05-Mar-2001 |
267 |
|
|
c ================================================================== |
268 |
|
|
c SUBROUTINE active_read_yz |
269 |
|
|
c ================================================================== |
270 |
heimbach |
1.2 |
C \ev |
271 |
heimbach |
1.1 |
|
272 |
heimbach |
1.2 |
C !USES: |
273 |
heimbach |
1.1 |
implicit none |
274 |
|
|
|
275 |
|
|
c == global variables == |
276 |
|
|
#include "EEPARAMS.h" |
277 |
|
|
#include "SIZE.h" |
278 |
|
|
|
279 |
heimbach |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
280 |
heimbach |
1.1 |
c == routine arguments == |
281 |
heimbach |
1.2 |
c active_var_file: filename |
282 |
|
|
c active_var: array |
283 |
|
|
c irec: record number |
284 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
285 |
|
|
c mythid: thread number for this instance |
286 |
|
|
c doglobalread: flag for global or local read/write |
287 |
|
|
c (default: .false.) |
288 |
|
|
c lAdInit: initialisation of corresponding adjoint |
289 |
|
|
c variable and write to active file |
290 |
heimbach |
1.1 |
character*(*) active_var_file |
291 |
|
|
_RL active_var(1-oly:sny+oly,nsx,nsy) |
292 |
|
|
integer irec |
293 |
|
|
integer myOptimIter |
294 |
|
|
integer mythid |
295 |
|
|
logical doglobalread |
296 |
|
|
logical lAdInit |
297 |
|
|
_RL dummy |
298 |
|
|
|
299 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
300 |
heimbach |
1.1 |
c == local variables == |
301 |
|
|
integer mynr |
302 |
|
|
|
303 |
|
|
c == end of interface == |
304 |
heimbach |
1.2 |
CEOP |
305 |
heimbach |
1.1 |
|
306 |
|
|
mynr = 1 |
307 |
|
|
call active_read_yz_rl( active_var_file, active_var, doglobalread, |
308 |
|
|
& lAdInit, irec, mynr, |
309 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid) |
310 |
|
|
|
311 |
|
|
return |
312 |
|
|
end |
313 |
|
|
|
314 |
|
|
c ================================================================== |
315 |
|
|
|
316 |
heimbach |
1.2 |
CBOP |
317 |
|
|
C !ROUTINE: active_write_xy |
318 |
|
|
C !INTERFACE: |
319 |
heimbach |
1.1 |
subroutine active_write_xy( |
320 |
|
|
I active_var_file, |
321 |
|
|
I active_var, |
322 |
|
|
I irec, |
323 |
|
|
I myOptimIter, |
324 |
|
|
I mythid |
325 |
|
|
I , dummy |
326 |
|
|
& ) |
327 |
|
|
|
328 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
329 |
heimbach |
1.1 |
c ================================================================== |
330 |
|
|
c SUBROUTINE active_write_xy |
331 |
|
|
c ================================================================== |
332 |
|
|
c o Write an active 2D variable to a file. |
333 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
334 |
|
|
c ================================================================== |
335 |
|
|
c SUBROUTINE active_write_xy |
336 |
|
|
c ================================================================== |
337 |
heimbach |
1.2 |
C \ev |
338 |
heimbach |
1.1 |
|
339 |
heimbach |
1.2 |
C !USES: |
340 |
heimbach |
1.1 |
implicit none |
341 |
|
|
|
342 |
|
|
c == global variables == |
343 |
|
|
#include "EEPARAMS.h" |
344 |
|
|
#include "SIZE.h" |
345 |
|
|
|
346 |
|
|
c == routine arguments == |
347 |
heimbach |
1.2 |
c active_var_file: filename |
348 |
|
|
c active_var: array |
349 |
|
|
c irec: record number |
350 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
351 |
|
|
c mythid: thread number for this instance |
352 |
heimbach |
1.1 |
character*(*) active_var_file |
353 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
354 |
|
|
integer irec |
355 |
|
|
integer myOptimIter |
356 |
|
|
integer mythid |
357 |
|
|
_RL dummy |
358 |
|
|
|
359 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
360 |
heimbach |
1.1 |
c == local variables == |
361 |
|
|
integer mynr |
362 |
|
|
logical globalfile |
363 |
|
|
|
364 |
|
|
c == end of interface == |
365 |
heimbach |
1.2 |
CEOP |
366 |
heimbach |
1.1 |
|
367 |
|
|
mynr = 1 |
368 |
|
|
globalfile = .false. |
369 |
|
|
|
370 |
|
|
call active_write_rl( active_var_file, active_var, globalfile, |
371 |
|
|
& irec, mynr, |
372 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid ) |
373 |
|
|
|
374 |
|
|
return |
375 |
|
|
end |
376 |
|
|
|
377 |
|
|
c ================================================================== |
378 |
|
|
|
379 |
heimbach |
1.2 |
CBOP |
380 |
|
|
C !ROUTINE: active_write_xyz |
381 |
|
|
C !INTERFACE: |
382 |
heimbach |
1.1 |
subroutine active_write_xyz( |
383 |
|
|
I active_var_file, |
384 |
|
|
I active_var, |
385 |
|
|
I irec, |
386 |
|
|
I myOptimIter, |
387 |
|
|
I mythid |
388 |
|
|
I , dummy |
389 |
|
|
& ) |
390 |
|
|
|
391 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
392 |
heimbach |
1.1 |
c ================================================================== |
393 |
|
|
c SUBROUTINE active_write_xyz |
394 |
|
|
c ================================================================== |
395 |
|
|
c o Write an active 3D variable to a file. |
396 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
397 |
|
|
c ================================================================== |
398 |
|
|
c SUBROUTINE active_write_xyz |
399 |
|
|
c ================================================================== |
400 |
heimbach |
1.2 |
C \ev |
401 |
heimbach |
1.1 |
|
402 |
heimbach |
1.2 |
C !USES: |
403 |
heimbach |
1.1 |
implicit none |
404 |
|
|
|
405 |
|
|
c == global variables == |
406 |
|
|
#include "EEPARAMS.h" |
407 |
|
|
#include "SIZE.h" |
408 |
|
|
|
409 |
|
|
c == routine arguments == |
410 |
heimbach |
1.2 |
c active_var_file: filename |
411 |
|
|
c active_var: array |
412 |
|
|
c irec: record number |
413 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
414 |
|
|
c mythid: thread number for this instance |
415 |
heimbach |
1.1 |
character*(*) active_var_file |
416 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
417 |
|
|
integer irec |
418 |
|
|
integer myOptimIter |
419 |
|
|
integer mythid |
420 |
|
|
_RL dummy |
421 |
|
|
|
422 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
423 |
heimbach |
1.1 |
c == local variables == |
424 |
|
|
integer mynr |
425 |
|
|
logical globalfile |
426 |
|
|
|
427 |
|
|
c == end of interface == |
428 |
heimbach |
1.2 |
CEOP |
429 |
heimbach |
1.1 |
|
430 |
|
|
mynr = nr |
431 |
|
|
globalfile = .false. |
432 |
|
|
call active_write_rl(active_var_file, active_var, globalfile, |
433 |
|
|
& irec, mynr, |
434 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid) |
435 |
|
|
|
436 |
|
|
return |
437 |
|
|
end |
438 |
|
|
|
439 |
|
|
c ================================================================== |
440 |
|
|
|
441 |
heimbach |
1.2 |
CBOP |
442 |
|
|
C !ROUTINE: active_write_xz |
443 |
|
|
C !INTERFACE: |
444 |
heimbach |
1.1 |
subroutine active_write_xz( |
445 |
|
|
I active_var_file, |
446 |
|
|
I active_var, |
447 |
|
|
I irec, |
448 |
|
|
I myOptimIter, |
449 |
|
|
I mythid |
450 |
|
|
I , dummy |
451 |
|
|
& ) |
452 |
|
|
|
453 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
454 |
heimbach |
1.1 |
c ================================================================== |
455 |
|
|
c SUBROUTINE active_write_xz |
456 |
|
|
c ================================================================== |
457 |
|
|
c o Write an active 2D xz-slice to a file. |
458 |
|
|
c started: heimbach@mit.edu 05-Mar-2001 |
459 |
|
|
c ================================================================== |
460 |
|
|
c SUBROUTINE active_write_xz |
461 |
|
|
c ================================================================== |
462 |
heimbach |
1.2 |
C \ev |
463 |
heimbach |
1.1 |
|
464 |
heimbach |
1.2 |
C !USES: |
465 |
heimbach |
1.1 |
implicit none |
466 |
|
|
|
467 |
|
|
c == global variables == |
468 |
|
|
#include "EEPARAMS.h" |
469 |
|
|
#include "SIZE.h" |
470 |
|
|
|
471 |
|
|
c == routine arguments == |
472 |
heimbach |
1.2 |
c active_var_file: filename |
473 |
|
|
c active_var: array |
474 |
|
|
c irec: record number |
475 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
476 |
|
|
c mythid: thread number for this instance |
477 |
heimbach |
1.1 |
character*(*) active_var_file |
478 |
|
|
_RL active_var(1-olx:snx+olx,nsx,nsy) |
479 |
|
|
integer irec |
480 |
|
|
integer myOptimIter |
481 |
|
|
integer mythid |
482 |
|
|
_RL dummy |
483 |
|
|
|
484 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
485 |
heimbach |
1.1 |
c == local variables == |
486 |
|
|
integer mynr |
487 |
|
|
logical globalfile |
488 |
|
|
|
489 |
|
|
c == end of interface == |
490 |
heimbach |
1.2 |
CEOP |
491 |
heimbach |
1.1 |
|
492 |
|
|
mynr = 1 |
493 |
|
|
globalfile = .false. |
494 |
|
|
|
495 |
|
|
call active_write_xz_rl( active_var_file, active_var, globalfile, |
496 |
|
|
& irec, mynr, |
497 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid ) |
498 |
|
|
|
499 |
|
|
return |
500 |
|
|
end |
501 |
|
|
|
502 |
|
|
c ================================================================== |
503 |
|
|
|
504 |
heimbach |
1.2 |
CBOP |
505 |
|
|
C !ROUTINE: active_write_yz |
506 |
|
|
C !INTERFACE: |
507 |
heimbach |
1.1 |
subroutine active_write_yz( |
508 |
|
|
I active_var_file, |
509 |
|
|
I active_var, |
510 |
|
|
I irec, |
511 |
|
|
I myOptimIter, |
512 |
|
|
I mythid |
513 |
|
|
I , dummy |
514 |
|
|
& ) |
515 |
|
|
|
516 |
heimbach |
1.2 |
C !DESCRIPTION: \bv |
517 |
heimbach |
1.1 |
c ================================================================== |
518 |
|
|
c SUBROUTINE active_write_yz |
519 |
|
|
c ================================================================== |
520 |
|
|
c o Write an active 2D variable to a file. |
521 |
|
|
c started: heimbach@mit.edu 05-Mar-2001 |
522 |
|
|
c ================================================================== |
523 |
|
|
c SUBROUTINE active_write_yz |
524 |
|
|
c ================================================================== |
525 |
heimbach |
1.2 |
C \ev |
526 |
heimbach |
1.1 |
|
527 |
heimbach |
1.2 |
C !USES: |
528 |
heimbach |
1.1 |
implicit none |
529 |
|
|
|
530 |
|
|
c == global variables == |
531 |
|
|
#include "EEPARAMS.h" |
532 |
|
|
#include "SIZE.h" |
533 |
|
|
|
534 |
|
|
c == routine arguments == |
535 |
heimbach |
1.2 |
c active_var_file: filename |
536 |
|
|
c active_var: array |
537 |
|
|
c irec: record number |
538 |
|
|
c myOptimIter: number of optimization iteration (default: 0) |
539 |
|
|
c mythid: thread number for this instance |
540 |
heimbach |
1.1 |
character*(*) active_var_file |
541 |
|
|
_RL active_var(1-oly:sny+oly,nsx,nsy) |
542 |
|
|
integer irec |
543 |
|
|
integer myOptimIter |
544 |
|
|
integer mythid |
545 |
|
|
_RL dummy |
546 |
|
|
|
547 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
548 |
heimbach |
1.1 |
c == local variables == |
549 |
|
|
integer mynr |
550 |
|
|
logical globalfile |
551 |
|
|
|
552 |
|
|
c == end of interface == |
553 |
heimbach |
1.2 |
CEOP |
554 |
heimbach |
1.1 |
|
555 |
|
|
mynr = 1 |
556 |
|
|
globalfile = .false. |
557 |
|
|
|
558 |
|
|
call active_write_yz_rl( active_var_file, active_var, globalfile, |
559 |
|
|
& irec, mynr, |
560 |
|
|
& FORWARD_SIMULATION, myOptimIter, mythid ) |
561 |
|
|
|
562 |
|
|
return |
563 |
|
|
end |
564 |
|
|
|
565 |
|
|
c ================================================================== |
566 |
|
|
|
567 |
|
|
subroutine active_read_tile_xy( |
568 |
|
|
I active_var_file, |
569 |
|
|
O active_var, |
570 |
|
|
I irec, |
571 |
|
|
I doglobalread, |
572 |
|
|
I bi, |
573 |
|
|
I bj, |
574 |
|
|
I lAdInit, |
575 |
|
|
I myOptimIter, |
576 |
|
|
I mythid |
577 |
|
|
& ) |
578 |
|
|
|
579 |
|
|
c ================================================================== |
580 |
|
|
c SUBROUTINE active_read_tile_xy |
581 |
|
|
c ================================================================== |
582 |
|
|
c |
583 |
|
|
c o Read an active 2D variable from file. |
584 |
|
|
c |
585 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
586 |
|
|
c |
587 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
588 |
|
|
c |
589 |
|
|
c - Restructured the code in order to create a package |
590 |
|
|
c for the MITgcmUV.c |
591 |
|
|
c |
592 |
|
|
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
593 |
|
|
c |
594 |
|
|
c - Added routines that do active writes on tiles |
595 |
|
|
c instead of a whole thread. |
596 |
|
|
c |
597 |
|
|
c ================================================================== |
598 |
|
|
c SUBROUTINE active_read_tile_xy |
599 |
|
|
c ================================================================== |
600 |
|
|
|
601 |
|
|
implicit none |
602 |
|
|
|
603 |
|
|
c == global variables == |
604 |
|
|
|
605 |
|
|
#include "EEPARAMS.h" |
606 |
|
|
#include "SIZE.h" |
607 |
|
|
|
608 |
|
|
c == routine arguments == |
609 |
|
|
|
610 |
|
|
character*(*) active_var_file |
611 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly) |
612 |
|
|
integer irec |
613 |
|
|
integer myOptimIter |
614 |
|
|
integer mythid |
615 |
|
|
integer bi |
616 |
|
|
integer bj |
617 |
|
|
logical doglobalread |
618 |
|
|
logical lAdInit |
619 |
|
|
|
620 |
|
|
c == local variables == |
621 |
|
|
|
622 |
|
|
integer mynr |
623 |
|
|
|
624 |
|
|
c == end of interface == |
625 |
|
|
|
626 |
|
|
mynr = 1 |
627 |
|
|
call active_read_tile_rl( |
628 |
|
|
I active_var_file, |
629 |
|
|
I active_var, |
630 |
|
|
I doglobalread, |
631 |
|
|
I lAdInit, |
632 |
|
|
I irec, |
633 |
|
|
I mynr, |
634 |
|
|
I bi, |
635 |
|
|
I bj, |
636 |
|
|
I FORWARD_SIMULATION, |
637 |
|
|
I myOptimIter, |
638 |
|
|
I mythid |
639 |
|
|
& ) |
640 |
|
|
|
641 |
|
|
return |
642 |
|
|
end |
643 |
|
|
|
644 |
|
|
|
645 |
|
|
subroutine active_read_tile_xyz( |
646 |
|
|
I active_var_file, |
647 |
|
|
O active_var, |
648 |
|
|
I irec, |
649 |
|
|
I doglobalread, |
650 |
|
|
I bi, |
651 |
|
|
I bj, |
652 |
|
|
I lAdInit, |
653 |
|
|
I myOptimIter, |
654 |
|
|
I mythid |
655 |
|
|
& ) |
656 |
|
|
|
657 |
|
|
c ================================================================== |
658 |
|
|
c SUBROUTINE active_read_tile_xyz |
659 |
|
|
c ================================================================== |
660 |
|
|
c |
661 |
|
|
c o Read an active 3D variable from file. |
662 |
|
|
c |
663 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
664 |
|
|
c |
665 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
666 |
|
|
c |
667 |
|
|
c - Restructured the code in order to create a package |
668 |
|
|
c for the MITgcmUV.c |
669 |
|
|
c |
670 |
|
|
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
671 |
|
|
c |
672 |
|
|
c - Added routines that do active writes on tiles |
673 |
|
|
c instead of a whole thread. |
674 |
|
|
c |
675 |
|
|
c ================================================================== |
676 |
|
|
c SUBROUTINE active_read_tile_xyz |
677 |
|
|
c ================================================================== |
678 |
|
|
|
679 |
|
|
implicit none |
680 |
|
|
|
681 |
|
|
c == global variables == |
682 |
|
|
|
683 |
|
|
#include "EEPARAMS.h" |
684 |
|
|
#include "SIZE.h" |
685 |
|
|
|
686 |
|
|
c == routine arguments == |
687 |
|
|
|
688 |
|
|
character*(*) active_var_file |
689 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr) |
690 |
|
|
integer irec |
691 |
|
|
integer myOptimIter |
692 |
|
|
integer mythid |
693 |
|
|
logical doglobalread |
694 |
|
|
integer bi |
695 |
|
|
integer bj |
696 |
|
|
logical lAdInit |
697 |
|
|
|
698 |
|
|
c == local variables == |
699 |
|
|
|
700 |
|
|
integer mynr |
701 |
|
|
|
702 |
|
|
c == end of interface == |
703 |
|
|
|
704 |
|
|
mynr = nr |
705 |
|
|
|
706 |
|
|
call active_read_tile_rl( |
707 |
|
|
I active_var_file, |
708 |
|
|
I active_var, |
709 |
|
|
I doglobalread, |
710 |
|
|
I lAdInit, |
711 |
|
|
I irec, |
712 |
|
|
I mynr, |
713 |
|
|
I bi, |
714 |
|
|
I bj, |
715 |
|
|
I FORWARD_SIMULATION, |
716 |
|
|
I myOptimIter, |
717 |
|
|
I mythid |
718 |
|
|
& ) |
719 |
|
|
|
720 |
|
|
return |
721 |
|
|
end |
722 |
|
|
|
723 |
|
|
|
724 |
|
|
subroutine active_write_tile_xy( |
725 |
|
|
I active_var_file, |
726 |
|
|
I active_var, |
727 |
|
|
I irec, |
728 |
|
|
I bi, |
729 |
|
|
I bj, |
730 |
|
|
I myOptimIter, |
731 |
|
|
I mythid |
732 |
|
|
& ) |
733 |
|
|
|
734 |
|
|
c ================================================================== |
735 |
|
|
c SUBROUTINE active_write_tile_xy |
736 |
|
|
c ================================================================== |
737 |
|
|
c |
738 |
|
|
c o Write an active 2D variable to a file. |
739 |
|
|
c |
740 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
741 |
|
|
c |
742 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
743 |
|
|
c |
744 |
|
|
c - Restructured the code in order to create a package |
745 |
|
|
c for the MITgcmUV.c |
746 |
|
|
c |
747 |
|
|
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
748 |
|
|
c |
749 |
|
|
c - Added routines that do active writes on tiles |
750 |
|
|
c instead of a whole thread. |
751 |
|
|
c |
752 |
|
|
c ================================================================== |
753 |
|
|
c SUBROUTINE active_write_tile_xy |
754 |
|
|
c ================================================================== |
755 |
|
|
|
756 |
|
|
implicit none |
757 |
|
|
|
758 |
|
|
c == global variables == |
759 |
|
|
|
760 |
|
|
#include "EEPARAMS.h" |
761 |
|
|
#include "SIZE.h" |
762 |
|
|
|
763 |
|
|
c == routine arguments == |
764 |
|
|
|
765 |
|
|
character*(*) active_var_file |
766 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly) |
767 |
|
|
integer irec |
768 |
|
|
integer bi |
769 |
|
|
integer bj |
770 |
|
|
integer myOptimIter |
771 |
|
|
integer mythid |
772 |
|
|
|
773 |
|
|
c == local variables == |
774 |
|
|
|
775 |
|
|
integer mynr |
776 |
|
|
logical globalfile |
777 |
|
|
|
778 |
|
|
c == end of interface == |
779 |
|
|
|
780 |
|
|
mynr = 1 |
781 |
|
|
globalfile = .false. |
782 |
|
|
|
783 |
|
|
call active_write_tile_rl( |
784 |
|
|
I active_var_file, |
785 |
|
|
I active_var, |
786 |
|
|
I globalfile, |
787 |
|
|
I irec, |
788 |
|
|
I mynr, |
789 |
|
|
I bi, |
790 |
|
|
I bj, |
791 |
|
|
I FORWARD_SIMULATION, |
792 |
|
|
I myOptimIter, |
793 |
|
|
I mythid |
794 |
|
|
& ) |
795 |
|
|
|
796 |
|
|
return |
797 |
|
|
end |
798 |
|
|
|
799 |
|
|
|
800 |
|
|
subroutine active_write_tile_xyz( |
801 |
|
|
I active_var_file, |
802 |
|
|
I active_var, |
803 |
|
|
I irec, |
804 |
|
|
I bi, |
805 |
|
|
I bj, |
806 |
|
|
I myOptimIter, |
807 |
|
|
I mythid |
808 |
|
|
& ) |
809 |
|
|
|
810 |
|
|
c ================================================================== |
811 |
|
|
c SUBROUTINE active_write_tile_xyz |
812 |
|
|
c ================================================================== |
813 |
|
|
c |
814 |
|
|
c o Write an active 3D variable to a file. |
815 |
|
|
c |
816 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
817 |
|
|
c |
818 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
819 |
|
|
c |
820 |
|
|
c - Restructured the code in order to create a package |
821 |
|
|
c for the MITgcmUV.c |
822 |
|
|
c |
823 |
|
|
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
824 |
|
|
c |
825 |
|
|
c - Added routines that do active writes on tiles |
826 |
|
|
c instead of a whole thread. |
827 |
|
|
c |
828 |
|
|
c ================================================================== |
829 |
|
|
c SUBROUTINE active_write_tile_xyz |
830 |
|
|
c ================================================================== |
831 |
|
|
|
832 |
|
|
implicit none |
833 |
|
|
|
834 |
|
|
c == global variables == |
835 |
|
|
|
836 |
|
|
#include "EEPARAMS.h" |
837 |
|
|
#include "SIZE.h" |
838 |
|
|
|
839 |
|
|
c == routine arguments == |
840 |
|
|
|
841 |
|
|
character*(*) active_var_file |
842 |
|
|
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr) |
843 |
|
|
integer irec |
844 |
|
|
integer bi |
845 |
|
|
integer bj |
846 |
|
|
integer myOptimIter |
847 |
|
|
integer mythid |
848 |
|
|
|
849 |
|
|
c == local variables == |
850 |
|
|
|
851 |
|
|
integer mynr |
852 |
|
|
logical globalfile |
853 |
|
|
|
854 |
|
|
c == end of interface == |
855 |
|
|
|
856 |
|
|
mynr = nr |
857 |
|
|
globalfile = .false. |
858 |
|
|
call active_write_tile_rl( |
859 |
|
|
I active_var_file, |
860 |
|
|
I active_var, |
861 |
|
|
I globalfile, |
862 |
|
|
I irec, |
863 |
|
|
I mynr, |
864 |
|
|
I bi, |
865 |
|
|
I bj, |
866 |
|
|
I FORWARD_SIMULATION, |
867 |
|
|
I myOptimIter, |
868 |
|
|
I mythid |
869 |
|
|
& ) |
870 |
|
|
|
871 |
|
|
return |
872 |
|
|
end |