27 |
c |
c |
28 |
c |
c |
29 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
|
c |
|
30 |
c - Added routines that do active writes on tiles |
c - Added routines that do active writes on tiles |
31 |
c instead of a whole thread. |
c instead of a whole thread. |
32 |
|
c changed: heimbach@mit.edu 05-Mar-2001 |
33 |
|
c - added active file handling of xz-/yz-arrays |
34 |
c |
c |
35 |
c ================================================================== |
c ================================================================== |
36 |
|
|
37 |
|
|
38 |
|
CBOP |
39 |
|
C !ROUTINE: active_read_xy |
40 |
|
C !INTERFACE: |
41 |
subroutine active_read_xy( |
subroutine active_read_xy( |
42 |
I active_var_file, |
I active_var_file, |
43 |
O active_var, |
O active_var, |
49 |
I , dummy |
I , dummy |
50 |
& ) |
& ) |
51 |
|
|
52 |
|
C !DESCRIPTION: \bv |
53 |
c ================================================================== |
c ================================================================== |
54 |
c SUBROUTINE active_read_xy |
c SUBROUTINE active_read_xy |
55 |
c ================================================================== |
c ================================================================== |
56 |
c |
c o Read an active 2D (XY) variable from file. |
|
c o Read an active 2D variable from file. |
|
|
c |
|
57 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
|
|
c |
|
|
c - Restructured the code in order to create a package |
|
|
c for the MITgcmUV. |
|
|
c |
|
58 |
c ================================================================== |
c ================================================================== |
59 |
c SUBROUTINE active_read_xy |
c SUBROUTINE active_read_xy |
60 |
c ================================================================== |
c ================================================================== |
61 |
|
C \ev |
62 |
|
|
63 |
|
C !USES: |
64 |
implicit none |
implicit none |
65 |
|
|
66 |
c == global variables == |
c == global variables == |
|
|
|
67 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
68 |
#include "SIZE.h" |
#include "SIZE.h" |
69 |
|
|
70 |
|
C !INPUT/OUTPUT PARAMETERS: |
71 |
c == routine arguments == |
c == routine arguments == |
72 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
82 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
83 |
integer irec |
integer irec |
87 |
logical lAdInit |
logical lAdInit |
88 |
_RL dummy |
_RL dummy |
89 |
|
|
90 |
|
C !LOCAL VARIABLES: |
91 |
c == local variables == |
c == local variables == |
|
|
|
92 |
integer mynr |
integer mynr |
93 |
|
|
94 |
c == end of interface == |
c == end of interface == |
95 |
|
CEOP |
96 |
|
|
97 |
mynr = 1 |
mynr = 1 |
98 |
call active_read_rl( active_var_file, active_var, doglobalread, |
call active_read_rl( active_var_file, active_var, doglobalread, |
104 |
|
|
105 |
c ================================================================== |
c ================================================================== |
106 |
|
|
107 |
|
CBOP |
108 |
|
C !ROUTINE: active_read_xyz |
109 |
|
C !INTERFACE: |
110 |
subroutine active_read_xyz( |
subroutine active_read_xyz( |
111 |
I active_var_file, |
I active_var_file, |
112 |
O active_var, |
O active_var, |
118 |
I , dummy |
I , dummy |
119 |
& ) |
& ) |
120 |
|
|
121 |
|
C !DESCRIPTION: \bv |
122 |
c ================================================================== |
c ================================================================== |
123 |
c SUBROUTINE active_read_xyz |
c SUBROUTINE active_read_xyz |
124 |
c ================================================================== |
c ================================================================== |
|
c |
|
125 |
c o Read an active 3D variable from file. |
c o Read an active 3D variable from file. |
|
c |
|
126 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
|
|
c |
|
|
c - Restructured the code in order to create a package |
|
|
c for the MITgcmUV. |
|
|
c |
|
127 |
c ================================================================== |
c ================================================================== |
128 |
c SUBROUTINE active_read_xyz |
c SUBROUTINE active_read_xyz |
129 |
c ================================================================== |
c ================================================================== |
130 |
|
C \ev |
131 |
|
|
132 |
|
C !USES: |
133 |
implicit none |
implicit none |
134 |
|
|
135 |
c == global variables == |
c == global variables == |
|
|
|
136 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
137 |
#include "SIZE.h" |
#include "SIZE.h" |
138 |
|
|
139 |
|
C !INPUT/OUTPUT PARAMETERS: |
140 |
c == routine arguments == |
c == routine arguments == |
141 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
151 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
152 |
integer irec |
integer irec |
156 |
logical lAdInit |
logical lAdInit |
157 |
_RL dummy |
_RL dummy |
158 |
|
|
159 |
|
C !LOCAL VARIABLES: |
160 |
c == local variables == |
c == local variables == |
|
|
|
161 |
integer mynr |
integer mynr |
162 |
|
|
163 |
c == end of interface == |
c == end of interface == |
164 |
|
CEOP |
165 |
|
|
166 |
mynr = nr |
mynr = nr |
167 |
call active_read_rl( active_var_file, active_var, doglobalread, |
call active_read_rl( active_var_file, active_var, doglobalread, |
174 |
c ================================================================== |
c ================================================================== |
175 |
|
|
176 |
|
|
177 |
|
CBOP |
178 |
|
C !ROUTINE: active_read_xz |
179 |
|
C !INTERFACE: |
180 |
subroutine active_read_xz( |
subroutine active_read_xz( |
181 |
I active_var_file, |
I active_var_file, |
182 |
O active_var, |
O active_var, |
188 |
I , dummy |
I , dummy |
189 |
& ) |
& ) |
190 |
|
|
191 |
|
C !DESCRIPTION: \bv |
192 |
c ================================================================== |
c ================================================================== |
193 |
c SUBROUTINE active_read_xz |
c SUBROUTINE active_read_xz |
194 |
c ================================================================== |
c ================================================================== |
|
c |
|
195 |
c o Read an active 2D xz-slice from file. |
c o Read an active 2D xz-slice from file. |
|
c |
|
196 |
c started: heimbach@mit.edu 05-Mar-2001 |
c started: heimbach@mit.edu 05-Mar-2001 |
|
c |
|
197 |
c ================================================================== |
c ================================================================== |
198 |
c SUBROUTINE active_read_xz |
c SUBROUTINE active_read_xz |
199 |
c ================================================================== |
c ================================================================== |
200 |
|
C \ev |
201 |
|
|
202 |
|
C !USES: |
203 |
implicit none |
implicit none |
204 |
|
|
205 |
c == global variables == |
c == global variables == |
|
|
|
206 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
207 |
#include "SIZE.h" |
#include "SIZE.h" |
208 |
|
|
209 |
|
C !INPUT/OUTPUT PARAMETERS: |
210 |
c == routine arguments == |
c == routine arguments == |
211 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
221 |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
222 |
integer irec |
integer irec |
226 |
logical lAdInit |
logical lAdInit |
227 |
_RL dummy |
_RL dummy |
228 |
|
|
229 |
|
C !LOCAL VARIABLES: |
230 |
c == local variables == |
c == local variables == |
|
|
|
231 |
integer mynr |
integer mynr |
232 |
|
|
233 |
c == end of interface == |
c == end of interface == |
234 |
|
CEOP |
235 |
|
|
236 |
mynr = 1 |
mynr = 1 |
237 |
call active_read_xz_rl( active_var_file, active_var, doglobalread, |
call active_read_xz_rl( active_var_file, active_var, doglobalread, |
244 |
c ================================================================== |
c ================================================================== |
245 |
|
|
246 |
|
|
247 |
subroutine active_read_yz( |
CBOP |
248 |
|
C !ROUTINE: active_read_yz |
249 |
|
C !INTERFACE: |
250 |
|
subroutine active_read_yz( |
251 |
I active_var_file, |
I active_var_file, |
252 |
O active_var, |
O active_var, |
253 |
I irec, |
I irec, |
258 |
I , dummy |
I , dummy |
259 |
& ) |
& ) |
260 |
|
|
261 |
|
C !DESCRIPTION: \bv |
262 |
c ================================================================== |
c ================================================================== |
263 |
c SUBROUTINE active_read_yz |
c SUBROUTINE active_read_yz |
264 |
c ================================================================== |
c ================================================================== |
|
c |
|
265 |
c o Read an active 2D yz-slice from file. |
c o Read an active 2D yz-slice from file. |
|
c |
|
266 |
c started: heimbach@mit.edu 05-Mar-2001 |
c started: heimbach@mit.edu 05-Mar-2001 |
|
c |
|
267 |
c ================================================================== |
c ================================================================== |
268 |
c SUBROUTINE active_read_yz |
c SUBROUTINE active_read_yz |
269 |
c ================================================================== |
c ================================================================== |
270 |
|
C \ev |
271 |
|
|
272 |
|
C !USES: |
273 |
implicit none |
implicit none |
274 |
|
|
275 |
c == global variables == |
c == global variables == |
|
|
|
276 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
277 |
#include "SIZE.h" |
#include "SIZE.h" |
278 |
|
|
279 |
|
C !INPUT/OUTPUT PARAMETERS: |
280 |
c == routine arguments == |
c == routine arguments == |
281 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
291 |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
292 |
integer irec |
integer irec |
296 |
logical lAdInit |
logical lAdInit |
297 |
_RL dummy |
_RL dummy |
298 |
|
|
299 |
|
C !LOCAL VARIABLES: |
300 |
c == local variables == |
c == local variables == |
|
|
|
301 |
integer mynr |
integer mynr |
302 |
|
|
303 |
c == end of interface == |
c == end of interface == |
304 |
|
CEOP |
305 |
|
|
306 |
mynr = 1 |
mynr = 1 |
307 |
call active_read_yz_rl( active_var_file, active_var, doglobalread, |
call active_read_yz_rl( active_var_file, active_var, doglobalread, |
313 |
|
|
314 |
c ================================================================== |
c ================================================================== |
315 |
|
|
316 |
|
CBOP |
317 |
|
C !ROUTINE: active_write_xy |
318 |
|
C !INTERFACE: |
319 |
subroutine active_write_xy( |
subroutine active_write_xy( |
320 |
I active_var_file, |
I active_var_file, |
321 |
I active_var, |
I active_var, |
325 |
I , dummy |
I , dummy |
326 |
& ) |
& ) |
327 |
|
|
328 |
|
C !DESCRIPTION: \bv |
329 |
c ================================================================== |
c ================================================================== |
330 |
c SUBROUTINE active_write_xy |
c SUBROUTINE active_write_xy |
331 |
c ================================================================== |
c ================================================================== |
|
c |
|
332 |
c o Write an active 2D variable to a file. |
c o Write an active 2D variable to a file. |
|
c |
|
333 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
|
|
c |
|
|
c - Restructured the code in order to create a package |
|
|
c for the MITgcmUV. |
|
|
c |
|
334 |
c ================================================================== |
c ================================================================== |
335 |
c SUBROUTINE active_write_xy |
c SUBROUTINE active_write_xy |
336 |
c ================================================================== |
c ================================================================== |
337 |
|
C \ev |
338 |
|
|
339 |
|
C !USES: |
340 |
implicit none |
implicit none |
341 |
|
|
342 |
c == global variables == |
c == global variables == |
|
|
|
343 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
344 |
#include "SIZE.h" |
#include "SIZE.h" |
345 |
|
|
346 |
c == routine arguments == |
c == routine arguments == |
347 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
353 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
354 |
integer irec |
integer irec |
356 |
integer mythid |
integer mythid |
357 |
_RL dummy |
_RL dummy |
358 |
|
|
359 |
|
C !LOCAL VARIABLES: |
360 |
c == local variables == |
c == local variables == |
|
|
|
361 |
integer mynr |
integer mynr |
362 |
logical globalfile |
logical globalfile |
363 |
|
|
364 |
c == end of interface == |
c == end of interface == |
365 |
|
CEOP |
366 |
|
|
367 |
mynr = 1 |
mynr = 1 |
368 |
globalfile = .false. |
globalfile = .false. |
376 |
|
|
377 |
c ================================================================== |
c ================================================================== |
378 |
|
|
379 |
|
CBOP |
380 |
|
C !ROUTINE: active_write_xyz |
381 |
|
C !INTERFACE: |
382 |
subroutine active_write_xyz( |
subroutine active_write_xyz( |
383 |
I active_var_file, |
I active_var_file, |
384 |
I active_var, |
I active_var, |
388 |
I , dummy |
I , dummy |
389 |
& ) |
& ) |
390 |
|
|
391 |
|
C !DESCRIPTION: \bv |
392 |
c ================================================================== |
c ================================================================== |
393 |
c SUBROUTINE active_write_xyz |
c SUBROUTINE active_write_xyz |
394 |
c ================================================================== |
c ================================================================== |
|
c |
|
395 |
c o Write an active 3D variable to a file. |
c o Write an active 3D variable to a file. |
|
c |
|
396 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
|
|
c |
|
|
c - Restructured the code in order to create a package |
|
|
c for the MITgcmUV. |
|
|
c |
|
397 |
c ================================================================== |
c ================================================================== |
398 |
c SUBROUTINE active_write_xyz |
c SUBROUTINE active_write_xyz |
399 |
c ================================================================== |
c ================================================================== |
400 |
|
C \ev |
401 |
|
|
402 |
|
C !USES: |
403 |
implicit none |
implicit none |
404 |
|
|
405 |
c == global variables == |
c == global variables == |
|
|
|
406 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
407 |
#include "SIZE.h" |
#include "SIZE.h" |
408 |
|
|
409 |
c == routine arguments == |
c == routine arguments == |
410 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
416 |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
_RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
417 |
integer irec |
integer irec |
419 |
integer mythid |
integer mythid |
420 |
_RL dummy |
_RL dummy |
421 |
|
|
422 |
|
C !LOCAL VARIABLES: |
423 |
c == local variables == |
c == local variables == |
|
|
|
424 |
integer mynr |
integer mynr |
425 |
logical globalfile |
logical globalfile |
426 |
|
|
427 |
c == end of interface == |
c == end of interface == |
428 |
|
CEOP |
429 |
|
|
430 |
mynr = nr |
mynr = nr |
431 |
globalfile = .false. |
globalfile = .false. |
438 |
|
|
439 |
c ================================================================== |
c ================================================================== |
440 |
|
|
441 |
|
CBOP |
442 |
|
C !ROUTINE: active_write_xz |
443 |
|
C !INTERFACE: |
444 |
subroutine active_write_xz( |
subroutine active_write_xz( |
445 |
I active_var_file, |
I active_var_file, |
446 |
I active_var, |
I active_var, |
450 |
I , dummy |
I , dummy |
451 |
& ) |
& ) |
452 |
|
|
453 |
|
C !DESCRIPTION: \bv |
454 |
c ================================================================== |
c ================================================================== |
455 |
c SUBROUTINE active_write_xz |
c SUBROUTINE active_write_xz |
456 |
c ================================================================== |
c ================================================================== |
|
c |
|
457 |
c o Write an active 2D xz-slice to a file. |
c o Write an active 2D xz-slice to a file. |
|
c |
|
458 |
c started: heimbach@mit.edu 05-Mar-2001 |
c started: heimbach@mit.edu 05-Mar-2001 |
|
c |
|
459 |
c ================================================================== |
c ================================================================== |
460 |
c SUBROUTINE active_write_xz |
c SUBROUTINE active_write_xz |
461 |
c ================================================================== |
c ================================================================== |
462 |
|
C \ev |
463 |
|
|
464 |
|
C !USES: |
465 |
implicit none |
implicit none |
466 |
|
|
467 |
c == global variables == |
c == global variables == |
|
|
|
468 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
469 |
#include "SIZE.h" |
#include "SIZE.h" |
470 |
|
|
471 |
c == routine arguments == |
c == routine arguments == |
472 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
478 |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
_RL active_var(1-olx:snx+olx,nsx,nsy) |
479 |
integer irec |
integer irec |
481 |
integer mythid |
integer mythid |
482 |
_RL dummy |
_RL dummy |
483 |
|
|
484 |
|
C !LOCAL VARIABLES: |
485 |
c == local variables == |
c == local variables == |
|
|
|
486 |
integer mynr |
integer mynr |
487 |
logical globalfile |
logical globalfile |
488 |
|
|
489 |
c == end of interface == |
c == end of interface == |
490 |
|
CEOP |
491 |
|
|
492 |
mynr = 1 |
mynr = 1 |
493 |
globalfile = .false. |
globalfile = .false. |
501 |
|
|
502 |
c ================================================================== |
c ================================================================== |
503 |
|
|
504 |
|
CBOP |
505 |
|
C !ROUTINE: active_write_yz |
506 |
|
C !INTERFACE: |
507 |
subroutine active_write_yz( |
subroutine active_write_yz( |
508 |
I active_var_file, |
I active_var_file, |
509 |
I active_var, |
I active_var, |
513 |
I , dummy |
I , dummy |
514 |
& ) |
& ) |
515 |
|
|
516 |
|
C !DESCRIPTION: \bv |
517 |
c ================================================================== |
c ================================================================== |
518 |
c SUBROUTINE active_write_yz |
c SUBROUTINE active_write_yz |
519 |
c ================================================================== |
c ================================================================== |
|
c |
|
520 |
c o Write an active 2D variable to a file. |
c o Write an active 2D variable to a file. |
|
c |
|
521 |
c started: heimbach@mit.edu 05-Mar-2001 |
c started: heimbach@mit.edu 05-Mar-2001 |
|
c |
|
522 |
c ================================================================== |
c ================================================================== |
523 |
c SUBROUTINE active_write_yz |
c SUBROUTINE active_write_yz |
524 |
c ================================================================== |
c ================================================================== |
525 |
|
C \ev |
526 |
|
|
527 |
|
C !USES: |
528 |
implicit none |
implicit none |
529 |
|
|
530 |
c == global variables == |
c == global variables == |
|
|
|
531 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
532 |
#include "SIZE.h" |
#include "SIZE.h" |
533 |
|
|
534 |
c == routine arguments == |
c == routine arguments == |
535 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
541 |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
_RL active_var(1-oly:sny+oly,nsx,nsy) |
542 |
integer irec |
integer irec |
544 |
integer mythid |
integer mythid |
545 |
_RL dummy |
_RL dummy |
546 |
|
|
547 |
|
C !LOCAL VARIABLES: |
548 |
c == local variables == |
c == local variables == |
|
|
|
549 |
integer mynr |
integer mynr |
550 |
logical globalfile |
logical globalfile |
551 |
|
|
552 |
c == end of interface == |
c == end of interface == |
553 |
|
CEOP |
554 |
|
|
555 |
mynr = 1 |
mynr = 1 |
556 |
globalfile = .false. |
globalfile = .false. |