1 |
jmc |
1.7 |
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/active_file_g.F,v 1.10 2012/08/02 22:10:31 jmc Exp $ |
2 |
jmc |
1.5 |
C $Name: $ |
3 |
heimbach |
1.2 |
|
4 |
edhill |
1.4 |
#include "AUTODIFF_OPTIONS.h" |
5 |
heimbach |
1.2 |
|
6 |
jmc |
1.7 |
C ================================================================== |
7 |
|
|
C active_file_g.F: Routines to handle the I/O of the active file for |
8 |
|
|
C the tangent linear calculations. All files are |
9 |
|
|
C direct access files. |
10 |
|
|
C Routines |
11 |
|
|
C o g_active_read_xy_loc - Read an active 2D variable from file. |
12 |
|
|
C o g_active_read_xyz_loc - Read an active 3D variable from file. |
13 |
|
|
C o g_active_read_xz_loc - Read an active 2D xz-slice from file. |
14 |
|
|
C o g_active_read_yz_loc - Read an active 2D yz-slice from file. |
15 |
|
|
C |
16 |
|
|
C o g_active_write_xy_loc - Write an active 2D variable to a file. |
17 |
|
|
C o g_active_write_xyz_loc - Write an active 3D variable to a file. |
18 |
|
|
C o g_active_write_xz_loc - Write an active 2D xz-slice to a file. |
19 |
|
|
C o g_active_write_yz_loc - Write an active 2D yz-slice to a file. |
20 |
|
|
C |
21 |
|
|
C changed: Christian Eckert eckert@mit.edu 24-Apr-2000 |
22 |
|
|
C - Added routines that do active writes on tiles |
23 |
|
|
C instead of a whole thread. |
24 |
|
|
C changed: heimbach@mit.edu 05-Mar-2001 |
25 |
|
|
C - added active file handling of xz-/yz-arrays |
26 |
|
|
C ================================================================== |
27 |
heimbach |
1.2 |
|
28 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
29 |
heimbach |
1.2 |
CBOP |
30 |
|
|
C !ROUTINE: g_active_read_xy_loc |
31 |
|
|
C !INTERFACE: |
32 |
|
|
subroutine g_active_read_xy_loc( |
33 |
|
|
I active_var_file, |
34 |
|
|
O active_var, |
35 |
heimbach |
1.6 |
I g_active_var, |
36 |
jmc |
1.7 |
I iRec, |
37 |
heimbach |
1.2 |
I doglobalread, |
38 |
|
|
I lAdInit, |
39 |
|
|
I myOptimIter, |
40 |
jmc |
1.7 |
I myThid, |
41 |
heimbach |
1.2 |
I dummy, |
42 |
heimbach |
1.6 |
I g_dummy |
43 |
heimbach |
1.2 |
& ) |
44 |
|
|
|
45 |
|
|
C !DESCRIPTION: \bv |
46 |
jmc |
1.7 |
C ================================================================== |
47 |
|
|
C SUBROUTINE g_active_read_xy_loc |
48 |
|
|
C ================================================================== |
49 |
|
|
C o Read an active 2D (XY) variable from file. |
50 |
|
|
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
51 |
|
|
C ================================================================== |
52 |
heimbach |
1.2 |
C \ev |
53 |
|
|
|
54 |
|
|
C !USES: |
55 |
jmc |
1.7 |
IMPLICIT NONE |
56 |
heimbach |
1.2 |
|
57 |
jmc |
1.7 |
C == global variables == |
58 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
59 |
|
|
#include "SIZE.h" |
60 |
|
|
|
61 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
62 |
jmc |
1.7 |
C active_var_file: filename |
63 |
|
|
C active_var: array |
64 |
|
|
C iRec: record number |
65 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
66 |
|
|
C myThid: thread number for this instance |
67 |
|
|
C doglobalread: flag for global or local read/write |
68 |
|
|
C (default: .false.) |
69 |
|
|
C lAdInit: initialisation of corresponding adjoint |
70 |
|
|
C variable and write to active file |
71 |
|
|
CHARACTER*(*) active_var_file |
72 |
|
|
_RL active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
73 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
74 |
|
|
INTEGER iRec |
75 |
|
|
INTEGER myOptimIter |
76 |
|
|
INTEGER myThid |
77 |
|
|
LOGICAL doglobalread |
78 |
|
|
LOGICAL lAdInit |
79 |
heimbach |
1.6 |
_RL dummy, g_dummy |
80 |
heimbach |
1.2 |
|
81 |
jmc |
1.7 |
C !FUNCTIONS: |
82 |
|
|
INTEGER ILNBLNK |
83 |
|
|
EXTERNAL ILNBLNK |
84 |
|
|
|
85 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
86 |
jmc |
1.7 |
CHARACTER*(2) pref |
87 |
|
|
CHARACTER*(80) fname |
88 |
|
|
INTEGER il |
89 |
|
|
INTEGER myNr |
90 |
|
|
LOGICAL useCurrentDir |
91 |
heimbach |
1.2 |
CEOP |
92 |
|
|
|
93 |
|
|
pref = 'g_' |
94 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
95 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
96 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
97 |
|
|
myNr = 1 |
98 |
|
|
useCurrentDir = .TRUE. |
99 |
|
|
|
100 |
|
|
CALL ACTIVE_READ_3D_RL( |
101 |
|
|
& active_var_file, active_var, doglobalread, |
102 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
103 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
104 |
|
|
|
105 |
|
|
CALL ACTIVE_READ_3D_RL( |
106 |
|
|
& fname, g_active_var, doglobalread, |
107 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
108 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
109 |
heimbach |
1.2 |
|
110 |
jmc |
1.7 |
RETURN |
111 |
|
|
END |
112 |
heimbach |
1.2 |
|
113 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
114 |
heimbach |
1.2 |
CBOP |
115 |
|
|
C !ROUTINE: g_active_read_xyz_loc |
116 |
|
|
C !INTERFACE: |
117 |
|
|
subroutine g_active_read_xyz_loc( |
118 |
|
|
I active_var_file, |
119 |
|
|
O active_var, |
120 |
heimbach |
1.6 |
I g_active_var, |
121 |
jmc |
1.7 |
I iRec, |
122 |
heimbach |
1.2 |
I doglobalread, |
123 |
|
|
I lAdInit, |
124 |
|
|
I myOptimIter, |
125 |
jmc |
1.7 |
I myThid, |
126 |
heimbach |
1.2 |
I dummy, |
127 |
heimbach |
1.6 |
I g_dummy |
128 |
heimbach |
1.2 |
& ) |
129 |
|
|
|
130 |
|
|
C !DESCRIPTION: \bv |
131 |
jmc |
1.7 |
C ================================================================== |
132 |
|
|
C SUBROUTINE g_active_read_xyz_loc |
133 |
|
|
C ================================================================== |
134 |
|
|
C o Read an active 3D variable from file. |
135 |
|
|
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
136 |
|
|
C ================================================================== |
137 |
heimbach |
1.2 |
C \ev |
138 |
|
|
|
139 |
|
|
C !USES: |
140 |
jmc |
1.7 |
IMPLICIT NONE |
141 |
heimbach |
1.2 |
|
142 |
jmc |
1.7 |
C == global variables == |
143 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
144 |
|
|
#include "SIZE.h" |
145 |
|
|
|
146 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
147 |
jmc |
1.7 |
C active_var_file: filename |
148 |
|
|
C active_var: array |
149 |
|
|
C iRec: record number |
150 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
151 |
|
|
C myThid: thread number for this instance |
152 |
|
|
C doglobalread: flag for global or local read/write |
153 |
|
|
C (default: .false.) |
154 |
|
|
C lAdInit: initialisation of corresponding adjoint |
155 |
|
|
C variable and write to active file |
156 |
|
|
CHARACTER*(*) active_var_file |
157 |
|
|
_RL active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
158 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
159 |
|
|
INTEGER iRec |
160 |
|
|
INTEGER myOptimIter |
161 |
|
|
INTEGER myThid |
162 |
|
|
LOGICAL doglobalread |
163 |
|
|
LOGICAL lAdInit |
164 |
heimbach |
1.6 |
_RL dummy, g_dummy |
165 |
heimbach |
1.2 |
|
166 |
jmc |
1.7 |
C !FUNCTIONS: |
167 |
|
|
INTEGER ILNBLNK |
168 |
|
|
EXTERNAL ILNBLNK |
169 |
|
|
|
170 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
171 |
jmc |
1.7 |
CHARACTER*(2) pref |
172 |
|
|
CHARACTER*(80) fname |
173 |
|
|
INTEGER il |
174 |
|
|
INTEGER myNr |
175 |
|
|
LOGICAL useCurrentDir |
176 |
heimbach |
1.2 |
CEOP |
177 |
|
|
|
178 |
|
|
pref = 'g_' |
179 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
180 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
181 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
182 |
|
|
myNr = Nr |
183 |
|
|
useCurrentDir = .TRUE. |
184 |
|
|
|
185 |
|
|
CALL ACTIVE_READ_3D_RL( |
186 |
|
|
& active_var_file, active_var, doglobalread, |
187 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
188 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
189 |
|
|
|
190 |
|
|
CALL ACTIVE_READ_3D_RL( |
191 |
|
|
& fname, g_active_var, doglobalread, |
192 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
193 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
194 |
heimbach |
1.2 |
|
195 |
jmc |
1.7 |
RETURN |
196 |
|
|
END |
197 |
heimbach |
1.2 |
|
198 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
199 |
heimbach |
1.2 |
CBOP |
200 |
jmc |
1.7 |
C !ROUTINE: g_active_read_xz_loc |
201 |
heimbach |
1.2 |
C !INTERFACE: |
202 |
|
|
subroutine g_active_read_xz_loc( |
203 |
|
|
I active_var_file, |
204 |
|
|
O active_var, |
205 |
heimbach |
1.6 |
I g_active_var, |
206 |
jmc |
1.7 |
I iRec, |
207 |
heimbach |
1.2 |
I doglobalread, |
208 |
|
|
I lAdInit, |
209 |
|
|
I myOptimIter, |
210 |
jmc |
1.7 |
I myThid, |
211 |
heimbach |
1.2 |
I dummy, |
212 |
heimbach |
1.6 |
I g_dummy |
213 |
heimbach |
1.2 |
& ) |
214 |
|
|
|
215 |
|
|
C !DESCRIPTION: \bv |
216 |
jmc |
1.7 |
C ================================================================== |
217 |
|
|
C SUBROUTINE g_active_read_xz_loc |
218 |
|
|
C ================================================================== |
219 |
|
|
C o Read an active 2D xz-slice from file. |
220 |
|
|
C started: heimbach@mit.edu 05-Mar-2001 |
221 |
|
|
C ================================================================== |
222 |
heimbach |
1.2 |
C \ev |
223 |
|
|
|
224 |
|
|
C !USES: |
225 |
jmc |
1.7 |
IMPLICIT NONE |
226 |
heimbach |
1.2 |
|
227 |
jmc |
1.7 |
C == global variables == |
228 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
229 |
|
|
#include "SIZE.h" |
230 |
|
|
|
231 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
232 |
jmc |
1.7 |
C active_var_file: filename |
233 |
|
|
C active_var: array |
234 |
|
|
C iRec: record number |
235 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
236 |
|
|
C myThid: thread number for this instance |
237 |
|
|
C doglobalread: flag for global or local read/write |
238 |
|
|
C (default: .false.) |
239 |
|
|
C lAdInit: initialisation of corresponding adjoint |
240 |
|
|
C variable and write to active file |
241 |
|
|
CHARACTER*(*) active_var_file |
242 |
|
|
_RL active_var(1-OLx:sNx+OLx,nSx,nSy) |
243 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,nSx,nSy) |
244 |
|
|
INTEGER iRec |
245 |
|
|
INTEGER myOptimIter |
246 |
|
|
INTEGER myThid |
247 |
|
|
LOGICAL doglobalread |
248 |
|
|
LOGICAL lAdInit |
249 |
heimbach |
1.6 |
_RL dummy, g_dummy |
250 |
heimbach |
1.2 |
|
251 |
jmc |
1.7 |
C !FUNCTIONS: |
252 |
|
|
INTEGER ILNBLNK |
253 |
|
|
EXTERNAL ILNBLNK |
254 |
|
|
|
255 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
256 |
jmc |
1.7 |
CHARACTER*(2) pref |
257 |
|
|
CHARACTER*(80) fname |
258 |
|
|
INTEGER il |
259 |
|
|
INTEGER myNr |
260 |
|
|
LOGICAL useCurrentDir |
261 |
heimbach |
1.2 |
CEOP |
262 |
|
|
|
263 |
|
|
pref = 'g_' |
264 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
265 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
266 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
267 |
|
|
myNr = Nr |
268 |
|
|
useCurrentDir = .TRUE. |
269 |
|
|
|
270 |
|
|
CALL ACTIVE_READ_XZ_RL( |
271 |
|
|
& active_var_file, active_var, doglobalread, |
272 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
273 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
274 |
|
|
|
275 |
|
|
CALL ACTIVE_READ_XZ_RL( |
276 |
|
|
& fname, g_active_var, doglobalread, |
277 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
278 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
279 |
heimbach |
1.2 |
|
280 |
jmc |
1.7 |
RETURN |
281 |
|
|
END |
282 |
heimbach |
1.2 |
|
283 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
284 |
heimbach |
1.2 |
CBOP |
285 |
|
|
C !ROUTINE: g_active_read_yz_loc |
286 |
|
|
C !INTERFACE: |
287 |
|
|
subroutine g_active_read_yz_loc( |
288 |
|
|
I active_var_file, |
289 |
|
|
O active_var, |
290 |
heimbach |
1.6 |
I g_active_var, |
291 |
jmc |
1.7 |
I iRec, |
292 |
heimbach |
1.2 |
I doglobalread, |
293 |
|
|
I lAdInit, |
294 |
|
|
I myOptimIter, |
295 |
jmc |
1.7 |
I myThid, |
296 |
heimbach |
1.2 |
I dummy, |
297 |
heimbach |
1.6 |
I g_dummy |
298 |
heimbach |
1.2 |
& ) |
299 |
|
|
|
300 |
|
|
C !DESCRIPTION: \bv |
301 |
jmc |
1.7 |
C ================================================================== |
302 |
|
|
C SUBROUTINE g_active_read_yz_loc |
303 |
|
|
C ================================================================== |
304 |
|
|
C o Read an active 2D yz-slice from file. |
305 |
|
|
C started: heimbach@mit.edu 05-Mar-2001 |
306 |
|
|
C ================================================================== |
307 |
heimbach |
1.2 |
C \ev |
308 |
|
|
|
309 |
|
|
C !USES: |
310 |
jmc |
1.7 |
IMPLICIT NONE |
311 |
heimbach |
1.2 |
|
312 |
jmc |
1.7 |
C == global variables == |
313 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
314 |
|
|
#include "SIZE.h" |
315 |
|
|
|
316 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
317 |
jmc |
1.7 |
C active_var_file: filename |
318 |
|
|
C active_var: array |
319 |
|
|
C iRec: record number |
320 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
321 |
|
|
C myThid: thread number for this instance |
322 |
|
|
C doglobalread: flag for global or local read/write |
323 |
|
|
C (default: .false.) |
324 |
|
|
C lAdInit: initialisation of corresponding adjoint |
325 |
|
|
C variable and write to active file |
326 |
|
|
CHARACTER*(*) active_var_file |
327 |
|
|
_RL active_var(1-OLy:sNy+OLy,nSx,nSy) |
328 |
|
|
_RL g_active_var(1-OLy:sNy+OLy,nSx,nSy) |
329 |
|
|
INTEGER iRec |
330 |
|
|
INTEGER myOptimIter |
331 |
|
|
INTEGER myThid |
332 |
|
|
LOGICAL doglobalread |
333 |
|
|
LOGICAL lAdInit |
334 |
heimbach |
1.6 |
_RL dummy, g_dummy |
335 |
heimbach |
1.2 |
|
336 |
jmc |
1.7 |
C !FUNCTIONS: |
337 |
|
|
INTEGER ILNBLNK |
338 |
|
|
EXTERNAL ILNBLNK |
339 |
|
|
|
340 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
341 |
jmc |
1.7 |
CHARACTER*(2) pref |
342 |
|
|
CHARACTER*(80) fname |
343 |
|
|
INTEGER il |
344 |
|
|
INTEGER myNr |
345 |
|
|
LOGICAL useCurrentDir |
346 |
heimbach |
1.2 |
CEOP |
347 |
|
|
|
348 |
|
|
pref = 'g_' |
349 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
350 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
351 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
352 |
|
|
myNr = Nr |
353 |
|
|
useCurrentDir = .TRUE. |
354 |
|
|
|
355 |
|
|
CALL ACTIVE_READ_YZ_RL( |
356 |
|
|
& active_var_file, active_var, doglobalread, |
357 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
358 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
359 |
|
|
|
360 |
|
|
CALL ACTIVE_READ_YZ_RL( |
361 |
|
|
& fname, g_active_var, doglobalread, |
362 |
|
|
& useCurrentDir, lAdInit, iRec, myNr, |
363 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
364 |
heimbach |
1.2 |
|
365 |
jmc |
1.7 |
RETURN |
366 |
|
|
END |
367 |
heimbach |
1.2 |
|
368 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
369 |
heimbach |
1.2 |
CBOP |
370 |
|
|
C !ROUTINE: g_active_write_xy_loc |
371 |
|
|
C !INTERFACE: |
372 |
|
|
subroutine g_active_write_xy_loc( |
373 |
|
|
I active_var_file, |
374 |
|
|
I active_var, |
375 |
heimbach |
1.6 |
I g_active_var, |
376 |
jmc |
1.7 |
I iRec, |
377 |
heimbach |
1.2 |
I myOptimIter, |
378 |
jmc |
1.7 |
I myThid, |
379 |
heimbach |
1.2 |
I dummy, |
380 |
|
|
I g_dummy |
381 |
|
|
& ) |
382 |
|
|
|
383 |
|
|
C !DESCRIPTION: \bv |
384 |
jmc |
1.7 |
C ================================================================== |
385 |
|
|
C SUBROUTINE g_active_write_xy_loc |
386 |
|
|
C ================================================================== |
387 |
|
|
C o Write an active 2D variable to a file. |
388 |
|
|
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
389 |
|
|
C ================================================================== |
390 |
heimbach |
1.2 |
C \ev |
391 |
|
|
|
392 |
|
|
C !USES: |
393 |
jmc |
1.7 |
IMPLICIT NONE |
394 |
heimbach |
1.2 |
|
395 |
jmc |
1.7 |
C == global variables == |
396 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
397 |
|
|
#include "SIZE.h" |
398 |
|
|
|
399 |
jmc |
1.7 |
C !INPUT/OUTPUT PARAMETERS: |
400 |
|
|
C active_var_file: filename |
401 |
|
|
C active_var: array |
402 |
|
|
C iRec: record number |
403 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
404 |
|
|
C myThid: thread number for this instance |
405 |
|
|
CHARACTER*(*) active_var_file |
406 |
|
|
_RL active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
407 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
408 |
|
|
INTEGER iRec |
409 |
|
|
INTEGER myOptimIter |
410 |
|
|
INTEGER myThid |
411 |
heimbach |
1.2 |
_RL dummy |
412 |
|
|
_RL g_dummy |
413 |
|
|
|
414 |
jmc |
1.7 |
C !FUNCTIONS: |
415 |
|
|
INTEGER ILNBLNK |
416 |
|
|
EXTERNAL ILNBLNK |
417 |
|
|
|
418 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
419 |
jmc |
1.7 |
CHARACTER*(2) pref |
420 |
|
|
CHARACTER*(80) fname |
421 |
|
|
INTEGER il |
422 |
|
|
INTEGER myNr |
423 |
|
|
LOGICAL globalFile |
424 |
|
|
LOGICAL useCurrentDir |
425 |
heimbach |
1.2 |
CEOP |
426 |
|
|
|
427 |
|
|
pref = 'g_' |
428 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
429 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
430 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
431 |
|
|
myNr = 1 |
432 |
|
|
globalFile = .FALSE. |
433 |
|
|
useCurrentDir = .TRUE. |
434 |
|
|
|
435 |
|
|
CALL ACTIVE_WRITE_3D_RL( |
436 |
|
|
& active_var_file, active_var, globalFile, |
437 |
|
|
& useCurrentDir, iRec, myNr, |
438 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
439 |
|
|
|
440 |
|
|
CALL ACTIVE_WRITE_3D_RL( |
441 |
|
|
& fname, g_active_var, globalFile, |
442 |
|
|
& useCurrentDir, iRec, myNr, |
443 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
444 |
heimbach |
1.2 |
|
445 |
jmc |
1.7 |
RETURN |
446 |
|
|
END |
447 |
heimbach |
1.2 |
|
448 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
449 |
heimbach |
1.2 |
CBOP |
450 |
|
|
C !ROUTINE: g_active_write_xyz_loc |
451 |
|
|
C !INTERFACE: |
452 |
|
|
subroutine g_active_write_xyz_loc( |
453 |
|
|
I active_var_file, |
454 |
|
|
I active_var, |
455 |
heimbach |
1.6 |
I g_active_var, |
456 |
jmc |
1.7 |
I iRec, |
457 |
heimbach |
1.2 |
I myOptimIter, |
458 |
jmc |
1.7 |
I myThid, |
459 |
heimbach |
1.2 |
I dummy, |
460 |
|
|
I g_dummy |
461 |
|
|
& ) |
462 |
|
|
|
463 |
|
|
C !DESCRIPTION: \bv |
464 |
jmc |
1.7 |
C ================================================================== |
465 |
|
|
C SUBROUTINE g_active_write_xyz_loc |
466 |
|
|
C ================================================================== |
467 |
|
|
C o Write an active 3D variable to a file. |
468 |
|
|
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
469 |
|
|
C ================================================================== |
470 |
heimbach |
1.2 |
C \ev |
471 |
|
|
|
472 |
|
|
C !USES: |
473 |
jmc |
1.7 |
IMPLICIT NONE |
474 |
heimbach |
1.2 |
|
475 |
jmc |
1.7 |
C == global variables == |
476 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
477 |
|
|
#include "SIZE.h" |
478 |
|
|
|
479 |
jmc |
1.7 |
C !INPUT/OUTPUT PARAMETERS: |
480 |
|
|
C active_var_file: filename |
481 |
|
|
C active_var: array |
482 |
|
|
C iRec: record number |
483 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
484 |
|
|
C myThid: thread number for this instance |
485 |
|
|
CHARACTER*(*) active_var_file |
486 |
|
|
_RL active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
487 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
488 |
|
|
INTEGER iRec |
489 |
|
|
INTEGER myOptimIter |
490 |
|
|
INTEGER myThid |
491 |
heimbach |
1.2 |
_RL dummy |
492 |
|
|
_RL g_dummy |
493 |
|
|
|
494 |
jmc |
1.7 |
C !FUNCTIONS: |
495 |
|
|
INTEGER ILNBLNK |
496 |
|
|
EXTERNAL ILNBLNK |
497 |
|
|
|
498 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
499 |
jmc |
1.7 |
CHARACTER*(2) pref |
500 |
|
|
CHARACTER*(80) fname |
501 |
|
|
INTEGER il |
502 |
|
|
INTEGER myNr |
503 |
|
|
LOGICAL globalFile |
504 |
|
|
LOGICAL useCurrentDir |
505 |
heimbach |
1.2 |
CEOP |
506 |
|
|
|
507 |
|
|
pref = 'g_' |
508 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
509 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
510 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
511 |
|
|
myNr = Nr |
512 |
|
|
globalFile = .FALSE. |
513 |
|
|
useCurrentDir = .TRUE. |
514 |
|
|
|
515 |
|
|
CALL ACTIVE_WRITE_3D_RL( |
516 |
|
|
& active_var_file, active_var, globalFile, |
517 |
|
|
& useCurrentDir, iRec, myNr, |
518 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
519 |
|
|
|
520 |
|
|
CALL ACTIVE_WRITE_3D_RL( |
521 |
|
|
& fname, g_active_var, globalFile, |
522 |
|
|
& useCurrentDir, iRec, myNr, |
523 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
524 |
heimbach |
1.2 |
|
525 |
jmc |
1.7 |
RETURN |
526 |
|
|
END |
527 |
heimbach |
1.2 |
|
528 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
529 |
heimbach |
1.2 |
CBOP |
530 |
|
|
C !ROUTINE: g_active_write_xz_loc |
531 |
|
|
C !INTERFACE: |
532 |
|
|
subroutine g_active_write_xz_loc( |
533 |
|
|
I active_var_file, |
534 |
|
|
I active_var, |
535 |
heimbach |
1.6 |
I g_active_var, |
536 |
jmc |
1.7 |
I iRec, |
537 |
heimbach |
1.2 |
I myOptimIter, |
538 |
jmc |
1.7 |
I myThid, |
539 |
heimbach |
1.2 |
I dummy, |
540 |
|
|
I g_dummy |
541 |
|
|
& ) |
542 |
|
|
|
543 |
|
|
C !DESCRIPTION: \bv |
544 |
jmc |
1.7 |
C ================================================================== |
545 |
|
|
C SUBROUTINE g_active_write_xz_loc |
546 |
|
|
C ================================================================== |
547 |
|
|
C o Write an active 2D xz-slice to a file. |
548 |
|
|
C started: heimbach@mit.edu 05-Mar-2001 |
549 |
|
|
C ================================================================== |
550 |
heimbach |
1.2 |
C \ev |
551 |
|
|
|
552 |
|
|
C !USES: |
553 |
jmc |
1.7 |
IMPLICIT NONE |
554 |
heimbach |
1.2 |
|
555 |
jmc |
1.7 |
C == global variables == |
556 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
557 |
|
|
#include "SIZE.h" |
558 |
|
|
|
559 |
jmc |
1.7 |
C !INPUT/OUTPUT PARAMETERS: |
560 |
|
|
C active_var_file: filename |
561 |
|
|
C active_var: array |
562 |
|
|
C iRec: record number |
563 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
564 |
|
|
C myThid: thread number for this instance |
565 |
|
|
CHARACTER*(*) active_var_file |
566 |
|
|
_RL active_var(1-OLx:sNx+OLx,nSx,nSy) |
567 |
|
|
_RL g_active_var(1-OLx:sNx+OLx,nSx,nSy) |
568 |
|
|
INTEGER iRec |
569 |
|
|
INTEGER myOptimIter |
570 |
|
|
INTEGER myThid |
571 |
heimbach |
1.2 |
_RL dummy |
572 |
|
|
_RL g_dummy |
573 |
|
|
|
574 |
jmc |
1.7 |
C !FUNCTIONS: |
575 |
|
|
INTEGER ILNBLNK |
576 |
|
|
EXTERNAL ILNBLNK |
577 |
|
|
|
578 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
579 |
jmc |
1.7 |
CHARACTER*(2) pref |
580 |
|
|
CHARACTER*(80) fname |
581 |
|
|
INTEGER il |
582 |
|
|
INTEGER myNr |
583 |
|
|
LOGICAL globalFile |
584 |
|
|
LOGICAL useCurrentDir |
585 |
heimbach |
1.2 |
CEOP |
586 |
|
|
|
587 |
|
|
pref = 'g_' |
588 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
589 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
590 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
591 |
|
|
myNr = Nr |
592 |
|
|
globalFile = .FALSE. |
593 |
|
|
useCurrentDir = .TRUE. |
594 |
|
|
|
595 |
|
|
CALL ACTIVE_WRITE_XZ_RL( |
596 |
|
|
& active_var_file, active_var, globalFile, |
597 |
|
|
& useCurrentDir, iRec, myNr, |
598 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
599 |
|
|
|
600 |
|
|
CALL ACTIVE_WRITE_XZ_RL( |
601 |
|
|
& fname, g_active_var, globalFile, |
602 |
|
|
& useCurrentDir, iRec, myNr, |
603 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
604 |
heimbach |
1.2 |
|
605 |
jmc |
1.7 |
RETURN |
606 |
|
|
END |
607 |
heimbach |
1.2 |
|
608 |
jmc |
1.7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
609 |
heimbach |
1.2 |
CBOP |
610 |
|
|
C !ROUTINE: g_active_write_yz_loc |
611 |
|
|
C !INTERFACE: |
612 |
|
|
subroutine g_active_write_yz_loc( |
613 |
|
|
I active_var_file, |
614 |
|
|
I active_var, |
615 |
heimbach |
1.6 |
I g_active_var, |
616 |
jmc |
1.7 |
I iRec, |
617 |
heimbach |
1.2 |
I myOptimIter, |
618 |
jmc |
1.7 |
I myThid, |
619 |
heimbach |
1.2 |
I dummy, |
620 |
|
|
I g_dummy |
621 |
|
|
& ) |
622 |
|
|
|
623 |
|
|
C !DESCRIPTION: \bv |
624 |
jmc |
1.7 |
C ================================================================== |
625 |
|
|
C SUBROUTINE g_active_write_yz_loc |
626 |
|
|
C ================================================================== |
627 |
|
|
C o Write an active 2D variable to a file. |
628 |
|
|
C started: heimbach@mit.edu 05-Mar-2001 |
629 |
|
|
C ================================================================== |
630 |
heimbach |
1.2 |
C \ev |
631 |
|
|
|
632 |
|
|
C !USES: |
633 |
jmc |
1.7 |
IMPLICIT NONE |
634 |
heimbach |
1.2 |
|
635 |
jmc |
1.7 |
C == global variables == |
636 |
heimbach |
1.2 |
#include "EEPARAMS.h" |
637 |
|
|
#include "SIZE.h" |
638 |
|
|
|
639 |
jmc |
1.7 |
C !INPUT/OUTPUT PARAMETERS: |
640 |
|
|
C active_var_file: filename |
641 |
|
|
C active_var: array |
642 |
|
|
C iRec: record number |
643 |
|
|
C myOptimIter: number of optimization iteration (default: 0) |
644 |
|
|
C myThid: thread number for this instance |
645 |
|
|
CHARACTER*(*) active_var_file |
646 |
|
|
_RL active_var(1-OLy:sNy+OLy,nSx,nSy) |
647 |
|
|
_RL g_active_var(1-OLy:sNy+OLy,nSx,nSy) |
648 |
|
|
INTEGER iRec |
649 |
|
|
INTEGER myOptimIter |
650 |
|
|
INTEGER myThid |
651 |
heimbach |
1.2 |
_RL dummy |
652 |
|
|
_RL g_dummy |
653 |
|
|
|
654 |
jmc |
1.7 |
C !FUNCTIONS: |
655 |
|
|
INTEGER ILNBLNK |
656 |
|
|
EXTERNAL ILNBLNK |
657 |
|
|
|
658 |
heimbach |
1.2 |
C !LOCAL VARIABLES: |
659 |
jmc |
1.7 |
CHARACTER*(2) pref |
660 |
|
|
CHARACTER*(80) fname |
661 |
|
|
INTEGER il |
662 |
|
|
INTEGER myNr |
663 |
|
|
LOGICAL globalFile |
664 |
|
|
LOGICAL useCurrentDir |
665 |
heimbach |
1.2 |
CEOP |
666 |
|
|
|
667 |
|
|
pref = 'g_' |
668 |
jmc |
1.7 |
il = ILNBLNK( active_var_file ) |
669 |
|
|
WRITE(fname(1:80),'(A)') ' ' |
670 |
|
|
WRITE(fname(1:2+il),'(2A)') pref, active_var_file(1:il) |
671 |
|
|
myNr = Nr |
672 |
|
|
globalFile = .FALSE. |
673 |
|
|
useCurrentDir = .TRUE. |
674 |
|
|
|
675 |
|
|
CALL ACTIVE_WRITE_YZ_RL( |
676 |
|
|
& active_var_file, active_var, globalFile, |
677 |
|
|
& useCurrentDir, iRec, myNr, |
678 |
|
|
& FORWARD_SIMULATION, myOptimIter, myThid ) |
679 |
|
|
|
680 |
|
|
CALL ACTIVE_WRITE_YZ_RL( |
681 |
|
|
& fname, g_active_var, globalFile, |
682 |
|
|
& useCurrentDir, iRec, myNr, |
683 |
|
|
& TANGENT_SIMULATION, myOptimIter, myThid ) |
684 |
heimbach |
1.2 |
|
685 |
jmc |
1.7 |
RETURN |
686 |
|
|
END |