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