1 |
|
|
2 |
CADJ SUBROUTINE active_read_rl INPUT = 1, 2, 3, 4, 5, 6, 7, 8, 9 |
#include "AUTODIFF_OPTIONS.h" |
|
CADJ SUBROUTINE active_read_rl OUTPUT = 2 |
|
|
|
|
|
CADJ SUBROUTINE active_write_rl INPUT = 1, 2, 3, 4, 5, 6, 7, 8 |
|
|
CADJ SUBROUTINE active_write_rl OUTPUT = 2 |
|
|
|
|
|
CADJ SUBROUTINE active_read_tile_rl INPUT = 1, 2, 3, 4, 5, 6, 7, 8, 9 |
|
|
CADJ SUBROUTINE active_read_tile_rl INPUT += 10, 11 |
|
|
CADJ SUBROUTINE active_read_tile_rl OUTPUT = 2 |
|
|
|
|
|
CADJ SUBROUTINE active_write_tile_rl INPUT = 1, 2, 3, 4, 5, 6, 7, 8, 9 |
|
|
CADJ SUBROUTINE active_write_tile_rl INPUT += 10 |
|
|
CADJ SUBROUTINE active_write_tile_rl OUTPUT = 2 |
|
|
|
|
|
#include "CPP_OPTIONS.h" |
|
3 |
|
|
4 |
c ================================================================== |
c ================================================================== |
5 |
c |
c |
14 |
c o adactive_write_xy - Adjoint of active_write_xy |
c o adactive_write_xy - Adjoint of active_write_xy |
15 |
c o adactive_write_xyz - Adjoint of active_write_xyz |
c o adactive_write_xyz - Adjoint of active_write_xyz |
16 |
c |
c |
17 |
|
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 |
c o adactive_read_tile_xy - Adjoint of active_read_tile_xy |
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 |
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 |
c o adactive_write_tile_xy - Adjoint of active_write_tile_xy |
26 |
c |
c |
27 |
c |
c |
28 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
c changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
|
c |
|
29 |
c - Added routines that do active writes on tiles |
c - Added routines that do active writes on tiles |
30 |
c instead of a whole thread. |
c instead of a whole thread. |
|
c |
|
31 |
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
|
c |
|
32 |
c - changed suboutine argument list: |
c - changed suboutine argument list: |
33 |
c dropped mycurrentiter, mycurrenttime |
c dropped mycurrentiter, mycurrenttime |
34 |
|
c changed: heimbach@mit.edu 25-Mar-2002 |
35 |
|
c - added active file handling of xz-/yz-arrays |
36 |
c |
c |
37 |
c ================================================================== |
c ================================================================== |
38 |
|
|
39 |
|
CBOP |
40 |
|
C !ROUTINE: adactive_read_xy |
41 |
|
C !INTERFACE: |
42 |
subroutine adactive_read_xy( |
subroutine adactive_read_xy( |
43 |
I active_var_file, |
I active_var_file, |
44 |
I irec, |
I irec, |
49 |
I adactive_var |
I adactive_var |
50 |
& ) |
& ) |
51 |
|
|
52 |
|
C !DESCRIPTION: \bv |
53 |
c ================================================================== |
c ================================================================== |
54 |
c SUBROUTINE active_read_xy |
c SUBROUTINE adactive_read_xy |
55 |
c ================================================================== |
c ================================================================== |
|
c |
|
56 |
c o Adjoint of active_read_xy. |
c o Adjoint of active_read_xy. |
|
c |
|
57 |
c started: Christian Eckert eckert@mit.edu 24-May-1999 |
c started: Christian Eckert eckert@mit.edu 24-May-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 |
|
|
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
|
|
c |
|
|
c - changed suboutine argument list: |
|
|
c dropped mycurrentiter, mycurrenttime |
|
|
c |
|
58 |
c ================================================================== |
c ================================================================== |
59 |
c SUBROUTINE active_read_xy |
c SUBROUTINE adactive_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 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 |
character*(*) active_var_file |
character*(*) active_var_file |
82 |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
83 |
integer irec |
integer irec |
85 |
logical doglobalread |
logical doglobalread |
86 |
logical lAdInit |
logical lAdInit |
87 |
|
|
88 |
|
C !LOCAL VARIABLES: |
89 |
c == local variables == |
c == local variables == |
|
|
|
90 |
integer mynr |
integer mynr |
91 |
integer il |
integer il |
92 |
integer ilnblnk |
integer ilnblnk |
94 |
character*(80) fname |
character*(80) fname |
95 |
|
|
96 |
c == functions == |
c == functions == |
|
|
|
97 |
external ilnblnk |
external ilnblnk |
98 |
|
|
99 |
c == end of interface == |
c == end of interface == |
100 |
|
CEOP |
101 |
|
|
102 |
mynr = 1 |
mynr = 1 |
103 |
adpref = 'ad' |
adpref = 'ad' |
114 |
|
|
115 |
end |
end |
116 |
|
|
117 |
|
CBOP |
118 |
|
C !ROUTINE: adactive_read_xyz |
119 |
|
C !INTERFACE: |
120 |
subroutine adactive_read_xyz( |
subroutine adactive_read_xyz( |
121 |
I active_var_file, |
I active_var_file, |
122 |
I irec, |
I irec, |
127 |
I adactive_var |
I adactive_var |
128 |
& ) |
& ) |
129 |
|
|
130 |
|
C !DESCRIPTION: \bv |
131 |
c ================================================================== |
c ================================================================== |
132 |
c SUBROUTINE adactive_read_xyz |
c SUBROUTINE adactive_read_xyz |
133 |
c ================================================================== |
c ================================================================== |
|
c |
|
134 |
c o Adjoint of active_read_xyz. |
c o Adjoint of active_read_xyz. |
|
c |
|
135 |
c started: Christian Eckert eckert@mit.edu 24-May-1999 |
c started: Christian Eckert eckert@mit.edu 24-May-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 |
|
|
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
|
|
c |
|
|
c - changed suboutine argument list: |
|
|
c dropped mycurrentiter, mycurrenttime |
|
|
c |
|
136 |
c ================================================================== |
c ================================================================== |
137 |
c SUBROUTINE adactive_read_xyz |
c SUBROUTINE adactive_read_xyz |
138 |
c ================================================================== |
c ================================================================== |
139 |
|
C \ev |
140 |
|
|
141 |
|
C !USES: |
142 |
implicit none |
implicit none |
143 |
|
|
144 |
c == global variables == |
c == global variables == |
|
|
|
145 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
146 |
#include "SIZE.h" |
#include "SIZE.h" |
147 |
|
|
148 |
c == routine arguments == |
c == routine arguments == |
149 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
159 |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
160 |
integer irec |
integer irec |
162 |
logical doglobalread |
logical doglobalread |
163 |
logical lAdInit |
logical lAdInit |
164 |
|
|
165 |
|
C !LOCAL VARIABLES: |
166 |
c == local variables == |
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 |
|
CEOP |
178 |
|
|
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 |
|
CBOP |
195 |
|
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 |
integer mynr |
245 |
integer il |
integer il |
246 |
integer ilnblnk |
integer ilnblnk |
248 |
character*(80) fname |
character*(80) fname |
249 |
|
|
250 |
c == functions == |
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 |
external ilnblnk |
329 |
|
|
330 |
c == end of interface == |
c == end of interface == |
331 |
|
CEOP |
332 |
|
|
333 |
mynr = nr |
mynr = nr |
334 |
adpref = 'ad' |
adpref = 'ad' |
339 |
write(fname(1:2),'(a)') adpref |
write(fname(1:2),'(a)') adpref |
340 |
write(fname(3:2+il),'(a)') active_var_file(1:il) |
write(fname(3:2+il),'(a)') active_var_file(1:il) |
341 |
|
|
342 |
call active_read_rl( fname, adactive_var, |
call active_read_yz_rl( fname, adactive_var, |
343 |
& doglobalread, lAdInit, irec, mynr, |
& doglobalread, lAdInit, irec, mynr, |
344 |
& REVERSE_SIMULATION, myiter, mythid ) |
& REVERSE_SIMULATION, myiter, mythid ) |
345 |
|
|
346 |
end |
end |
347 |
|
|
348 |
|
CBOP |
349 |
|
C !ROUTINE: adactive_read_xy |
350 |
|
C !INTERFACE: |
351 |
subroutine adactive_write_xy( |
subroutine adactive_write_xy( |
352 |
I active_var_file, |
I active_var_file, |
353 |
I irec, |
I irec, |
358 |
& ) |
& ) |
359 |
|
|
360 |
|
|
361 |
|
C !DESCRIPTION: \bv |
362 |
c ================================================================== |
c ================================================================== |
363 |
c SUBROUTINE adactive_write_xy |
c SUBROUTINE adactive_write_xy |
364 |
c ================================================================== |
c ================================================================== |
|
c |
|
365 |
c o Adjoint of active_write_xy. |
c o Adjoint of active_write_xy. |
|
c |
|
366 |
c started: Christian Eckert eckert@mit.edu 24-May-1999 |
c started: Christian Eckert eckert@mit.edu 24-May-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 |
|
|
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
|
|
c |
|
|
c - changed suboutine argument list: |
|
|
c dropped mycurrentiter, mycurrenttime |
|
|
c |
|
367 |
c ================================================================== |
c ================================================================== |
368 |
c SUBROUTINE adactive_write_xy |
c SUBROUTINE adactive_write_xy |
369 |
c ================================================================== |
c ================================================================== |
370 |
|
C \ev |
371 |
|
|
372 |
|
C !USES: |
373 |
implicit none |
implicit none |
374 |
|
|
375 |
c == global variables == |
c == global variables == |
|
|
|
376 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
377 |
#include "SIZE.h" |
#include "SIZE.h" |
378 |
|
|
379 |
c == routine arguments == |
c == routine arguments == |
380 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
386 |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
387 |
integer irec |
integer irec |
388 |
integer myiter,mythid |
integer myiter,mythid |
389 |
_RL dummy |
_RL dummy |
390 |
|
|
391 |
|
C !LOCAL VARIABLES: |
392 |
c == local variables == |
c == local variables == |
|
|
|
393 |
integer mynr |
integer mynr |
394 |
integer il |
integer il |
395 |
integer ilnblnk |
integer ilnblnk |
398 |
logical globalfile |
logical globalfile |
399 |
|
|
400 |
c == functions == |
c == functions == |
|
|
|
401 |
external ilnblnk |
external ilnblnk |
402 |
|
|
403 |
c == end of interface == |
c == end of interface == |
404 |
|
CEOP |
405 |
|
|
406 |
mynr = 1 |
mynr = 1 |
407 |
adpref = 'ad' |
adpref = 'ad' |
420 |
|
|
421 |
end |
end |
422 |
|
|
423 |
|
CBOP |
424 |
|
C !ROUTINE: adactive_read_xyz |
425 |
|
C !INTERFACE: |
426 |
subroutine adactive_write_xyz( |
subroutine adactive_write_xyz( |
427 |
I active_var_file, |
I active_var_file, |
428 |
I irec, |
I irec, |
433 |
& ) |
& ) |
434 |
|
|
435 |
|
|
436 |
|
C !DESCRIPTION: \bv |
437 |
c ================================================================== |
c ================================================================== |
438 |
c SUBROUTINE adactive_write_xyz |
c SUBROUTINE adactive_write_xyz |
439 |
c ================================================================== |
c ================================================================== |
|
c |
|
440 |
c o Adjoint of active_write_xyz. |
c o Adjoint of active_write_xyz. |
|
c |
|
441 |
c started: Christian Eckert eckert@mit.edu 24-May-1999 |
c started: Christian Eckert eckert@mit.edu 24-May-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 |
|
|
c changed: Patrick Heimbach heimbach@mit.edu 27-May-2000 |
|
|
c |
|
|
c - changed suboutine argument list: |
|
|
c dropped mycurrentiter, mycurrenttime |
|
|
c |
|
442 |
c ================================================================== |
c ================================================================== |
443 |
c SUBROUTINE adactive_write_xyz |
c SUBROUTINE adactive_write_xyz |
444 |
c ================================================================== |
c ================================================================== |
445 |
|
C \ev |
446 |
|
|
447 |
|
C !USES: |
448 |
implicit none |
implicit none |
449 |
|
|
450 |
c == global variables == |
c == global variables == |
|
|
|
451 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
452 |
#include "SIZE.h" |
#include "SIZE.h" |
453 |
|
|
454 |
c == routine arguments == |
c == routine arguments == |
455 |
|
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 |
character*(*) active_var_file |
character*(*) active_var_file |
461 |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
_RL adactive_var(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
462 |
integer irec |
integer irec |
463 |
integer myiter,mythid |
integer myiter,mythid |
464 |
_RL dummy |
_RL dummy |
465 |
|
|
466 |
|
C !LOCAL VARIABLES: |
467 |
c == local variables == |
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 |
|
CEOP |
480 |
|
|
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 |
|
& 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 |
integer mynr |
544 |
integer il |
integer il |
545 |
integer ilnblnk |
integer ilnblnk |
548 |
logical globalfile |
logical globalfile |
549 |
|
|
550 |
c == functions == |
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 |
external ilnblnk |
627 |
|
|
628 |
c == end of interface == |
c == end of interface == |
629 |
|
CEOP |
630 |
|
|
631 |
mynr = nr |
mynr = nr |
632 |
adpref = 'ad' |
adpref = 'ad' |
639 |
|
|
640 |
globalfile = .false. |
globalfile = .false. |
641 |
|
|
642 |
call active_write_rl( fname, adactive_var, |
call active_write_yz_rl( fname, adactive_var, |
643 |
& globalfile, irec, mynr, |
& globalfile, irec, mynr, |
644 |
& REVERSE_SIMULATION, myiter, mythid ) |
& REVERSE_SIMULATION, myiter, mythid ) |
645 |
|
|