/[MITgcm]/MITgcm/pkg/autodiff/active_file_control_slice.F
ViewVC logotype

Annotation of /MITgcm/pkg/autodiff/active_file_control_slice.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (hide annotations) (download)
Mon Mar 22 02:15:02 2010 UTC (14 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint63, checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c
Changes since 1.9: +3 -3 lines
finish removing unbalanced quote (single or double) in commented line

1 jmc 1.10 C $Header: /u/gcmpack/MITgcm/pkg/autodiff/active_file_control_slice.F,v 1.9 2007/10/08 23:50:53 jmc Exp $
2 jmc 1.9 C $Name: $
3 heimbach 1.3
4 edhill 1.5 #include "AUTODIFF_OPTIONS.h"
5 heimbach 1.3
6     c ==================================================================
7     c
8     c active_file_control.F: Routines to handle the i/o of active vari-
9     c ables for the adjoint calculations. All
10     c files are direct access files.
11     c
12     c Routines:
13     c
14     c o active_read_xz_rl - Basic routine to handle active read
15     c operations.
16     c o active_write_xz_rl - Basic routine to handle active write
17     c operations.
18     c o active_read_yz_rl - Basic routine to handle active read
19     c operations.
20     c o active_write_yz_rl - Basic routine to handle active write
21     c operations.
22     c
23     c ==================================================================
24    
25    
26     subroutine active_read_xz_rl(
27     I active_var_file,
28     O active_var,
29     I globalfile,
30     I lAdInit,
31     I irec,
32     I mynr,
33     I theSimulationMode,
34     I myOptimIter,
35     I mythid
36     & )
37    
38     c ==================================================================
39     c SUBROUTINE active_read_xz_rl
40     c ==================================================================
41     c
42     c o Read an active variable from file.
43     c
44     c The variable *globalfile* can be used as a switch, which allows
45     c to read from a global file. The adjoint files are, however, always
46     c treated as tiled files.
47     c
48     c started: heimbach@mit.edu 05-Mar-2001
49     c
50     c ==================================================================
51     c SUBROUTINE active_read_xz_rl
52     c ==================================================================
53    
54     implicit none
55    
56     c == global variables ==
57    
58     #include "EEPARAMS.h"
59     #include "SIZE.h"
60     #include "PARAMS.h"
61 heimbach 1.7 #include "ctrl.h"
62 heimbach 1.3
63     c == routine arguments ==
64    
65     character*(*) active_var_file
66    
67     logical globalfile
68     logical lAdInit
69     integer irec
70     integer mynr
71     integer theSimulationMode
72     integer myOptimIter
73     integer mythid
74     _RL active_var(1-olx:snx+olx,mynr,nsx,nsy)
75    
76     c == local variables ==
77    
78     character*(2) adpref
79     character*(80) adfname
80    
81     integer bi,bj
82     integer i,j,k
83     integer oldprec
84     integer prec
85     integer il
86     integer ilnblnk
87    
88     logical writeglobalfile
89    
90 heimbach 1.8 _RL active_data_t(1-olx:snx+olx,mynr,nsx,nsy)
91 heimbach 1.3
92     c == functions ==
93    
94     external ilnblnk
95    
96     c == end of interface ==
97    
98     c force 64-bit io
99     oldPrec = readBinaryPrec
100 heimbach 1.7 readBinaryPrec = ctrlprec
101     prec = ctrlprec
102 heimbach 1.3
103     write(adfname(1:80),'(80a)') ' '
104     adpref = 'ad'
105     il = ilnblnk( active_var_file )
106    
107     write(adfname(1:2),'(a)') adpref
108     write(adfname(3:il+2),'(a)') active_var_file(1:il)
109    
110     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
111     c >>>>>>>>>>>>>>>>>>> FORWARD RUN <<<<<<<<<<<<<<<<<<<
112     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
113    
114     if (theSimulationMode .eq. FORWARD_SIMULATION) then
115    
116     _BEGIN_MASTER( mythid )
117    
118     c Read the active variable from file.
119    
120 jmc 1.9 call mdsreadfieldxz(
121     & active_var_file,
122     & prec,
123 heimbach 1.3 & 'RL',
124 jmc 1.9 & mynr,
125 heimbach 1.3 & active_var,
126 jmc 1.9 & irec,
127 heimbach 1.3 & mythid )
128    
129     if (lAdInit) then
130     c Initialise the corresponding adjoint variable on the
131 jmc 1.10 c adjoint variable file. These files are tiled.
132 heimbach 1.3
133     writeglobalfile = .false.
134     do bj = 1,nsy
135     do bi = 1,nsx
136 heimbach 1.8 do k = 1,mynr
137     do i = 1,snx
138     active_data_t(i,k,bi,bj)= 0. _d 0
139     enddo
140 heimbach 1.3 enddo
141     enddo
142     enddo
143    
144 jmc 1.9 call mdswritefieldxz(
145     & adfname,
146     & prec,
147 heimbach 1.3 & globalfile,
148 jmc 1.9 & 'RL',
149     & mynr,
150 heimbach 1.3 & active_data_t,
151 heimbach 1.8 & irec,
152 heimbach 1.3 & myOptimIter,
153     & mythid )
154     endif
155    
156     _END_MASTER( mythid )
157    
158     endif
159    
160     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
161     c >>>>>>>>>>>>>>>>>>> ADJOINT RUN <<<<<<<<<<<<<<<<<<<
162     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
163    
164     if (theSimulationMode .eq. REVERSE_SIMULATION) then
165    
166     _BEGIN_MASTER( mythid )
167    
168     writeglobalfile = .false.
169 jmc 1.9 call mdsreadfieldxz(
170     & active_var_file,
171     & prec,
172 heimbach 1.3 & 'RL',
173 jmc 1.9 & mynr,
174     & active_data_t,
175     & irec,
176 heimbach 1.3 & mythid )
177    
178     c Add active_var from appropriate location to data.
179 heimbach 1.8 do bj = 1,nsy
180     do bi = 1,nsx
181     do k = 1,mynr
182 heimbach 1.3 do i = 1,snx
183 jmc 1.9 active_data_t(i,k,bi,bj) =
184 heimbach 1.8 & active_data_t(i,k,bi,bj) +
185 heimbach 1.3 & active_var(i,k,bi,bj)
186     enddo
187     enddo
188     enddo
189 heimbach 1.8 enddo
190 jmc 1.9
191 heimbach 1.3 c Store the result on disk.
192 jmc 1.9 call mdswritefieldxz(
193     & active_var_file,
194 heimbach 1.3 & prec,
195 jmc 1.9 & writeglobalfile,
196 heimbach 1.3 & 'RL',
197 jmc 1.9 & mynr,
198     & active_data_t,
199     & irec,
200 heimbach 1.3 & myOptimIter,
201     & mythid )
202    
203     c Set active_var to zero.
204 heimbach 1.8 do bj = 1,nsy
205     do bi = 1,nsx
206     do k=1,mynr
207 heimbach 1.3 do i = 1,snx
208     active_var(i,k,bi,bj) = 0. _d 0
209     enddo
210     enddo
211     enddo
212     enddo
213    
214     _END_MASTER( mythid )
215     endif
216    
217 heimbach 1.4 c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
218     c >>>>>>>>>>>>>>>>>>> TANGENT RUN <<<<<<<<<<<<<<<<<<<
219     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
220    
221     if (theSimulationMode .eq. TANGENT_SIMULATION) then
222    
223     _BEGIN_MASTER( mythid )
224    
225     c Read the active variable from file.
226    
227 jmc 1.9 call mdsreadfieldxz(
228     & active_var_file,
229     & prec,
230 heimbach 1.4 & 'RL',
231 jmc 1.9 & mynr,
232 heimbach 1.4 & active_var,
233 jmc 1.9 & irec,
234 heimbach 1.4 & mythid )
235    
236     _END_MASTER( mythid )
237    
238     endif
239    
240 heimbach 1.3 c Reset default io precision.
241     readBinaryPrec = oldPrec
242    
243     _BARRIER
244    
245     return
246     end
247    
248     c ==================================================================
249    
250     subroutine active_write_xz_rl(
251     I active_var_file,
252     I active_var,
253     I globalfile,
254     I irec,
255     I mynr,
256     I theSimulationMode,
257     I myOptimIter,
258     I mythid
259     & )
260    
261     c ==================================================================
262     c SUBROUTINE active_write_xz_rl
263     c ==================================================================
264     c
265     c o Write an active variable to a file.
266     c
267     c started: heimbach@mit.edu 05-Mar-2001
268     c
269     c ==================================================================
270     c SUBROUTINE active_write_xz_rl
271     c ==================================================================
272    
273     implicit none
274    
275     c == global variables ==
276    
277     #include "EEPARAMS.h"
278     #include "SIZE.h"
279     #include "PARAMS.h"
280 heimbach 1.7 #include "ctrl.h"
281 heimbach 1.3
282     c == routine arguments ==
283    
284     character*(*) active_var_file
285    
286     integer mynr
287     logical globalfile
288     integer irec
289     integer theSimulationMode
290     integer myOptimIter
291     integer mythid
292     _RL active_var(1-olx:snx+olx,mynr,nsx,nsy)
293    
294     c == local variables ==
295    
296     integer i,j,k
297     integer bi,bj
298 heimbach 1.8 _RL active_data_t(1-olx:snx+olx,mynr,nsx,nsy)
299 heimbach 1.3 integer oldprec
300     integer prec
301    
302     c == end of interface ==
303    
304     c force 64-bit io
305     oldPrec = readBinaryPrec
306 heimbach 1.7 readBinaryPrec = ctrlprec
307     prec = ctrlprec
308 heimbach 1.3
309     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
310     c >>>>>>>>>>>>>>>>>>> FORWARD RUN <<<<<<<<<<<<<<<<<<<
311     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
312    
313     if (theSimulationMode .eq. FORWARD_SIMULATION) then
314    
315     _BEGIN_MASTER( mythid )
316    
317 jmc 1.9 call mdswritefieldxz(
318     & active_var_file,
319     & prec,
320 heimbach 1.3 & globalfile,
321 jmc 1.9 & 'RL',
322     & mynr,
323     & active_var,
324     & irec,
325 heimbach 1.3 & myOptimIter,
326     & mythid )
327    
328     _END_MASTER( mythid )
329    
330     endif
331    
332     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
333     c >>>>>>>>>>>>>>>>>>> ADJOINT RUN <<<<<<<<<<<<<<<<<<<
334     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
335    
336     if (theSimulationMode .eq. REVERSE_SIMULATION) then
337    
338     _BEGIN_MASTER( mythid )
339    
340 jmc 1.9 call mdsreadfieldxz(
341     & active_var_file,
342     & prec,
343 heimbach 1.3 & 'RL',
344 heimbach 1.8 & mynr,
345 jmc 1.9 & active_data_t,
346 heimbach 1.8 & irec,
347 heimbach 1.3 & mythid )
348    
349     c Add active_var from appropriate location to data.
350 heimbach 1.8 do bj = 1,nsy
351     do bi = 1,nsx
352     do k = 1,nr
353     do i = 1,snx
354 jmc 1.9 active_var(i,k,bi,bj) =
355 heimbach 1.8 & active_var(i,k,bi,bj) +
356     & active_data_t(i,k,bi,bj)
357     active_data_t(i,k,bi,bj) = 0. _d 0
358 heimbach 1.3 enddo
359     enddo
360 heimbach 1.8 enddo
361     enddo
362 jmc 1.9 call mdswritefieldxz(
363     & active_var_file,
364     & prec,
365 heimbach 1.3 & globalfile,
366 jmc 1.9 & 'RL',
367     & mynr,
368     & active_data_t,
369     & irec,
370 heimbach 1.3 & myOptimIter,
371     & mythid )
372    
373     _END_MASTER( mythid )
374    
375     endif
376    
377 heimbach 1.4 c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
378     c >>>>>>>>>>>>>>>>>>> TANGENT RUN <<<<<<<<<<<<<<<<<<<
379     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
380    
381     if (theSimulationMode .eq. TANGENT_SIMULATION) then
382    
383     _BEGIN_MASTER( mythid )
384    
385 jmc 1.9 call mdswritefieldxz(
386     & active_var_file,
387     & prec,
388 heimbach 1.4 & globalfile,
389 jmc 1.9 & 'RL',
390     & mynr,
391     & active_var,
392     & irec,
393 heimbach 1.4 & myOptimIter,
394     & mythid )
395    
396     _END_MASTER( mythid )
397    
398     endif
399    
400 heimbach 1.3 c Reset default io precision.
401     readBinaryPrec = oldPrec
402    
403     _BARRIER
404    
405     return
406     end
407    
408     c ==================================================================
409    
410     subroutine active_read_yz_rl(
411     I active_var_file,
412     O active_var,
413     I globalfile,
414     I lAdInit,
415     I irec,
416     I mynr,
417     I theSimulationMode,
418     I myOptimIter,
419     I mythid
420     & )
421    
422     c ==================================================================
423     c SUBROUTINE active_read_yz_rl
424     c ==================================================================
425     c
426     c o Read an active variable from file.
427     c
428     c The variable *globalfile* can be used as a switch, which allows
429     c to read from a global file. The adjoint files are, however, always
430     c treated as tiled files.
431     c
432     c started: heimbach@mit.edu 05-Mar-2001
433     c
434     c ==================================================================
435     c SUBROUTINE active_read_yz_rl
436     c ==================================================================
437    
438     implicit none
439    
440     c == global variables ==
441    
442     #include "EEPARAMS.h"
443     #include "SIZE.h"
444     #include "PARAMS.h"
445 heimbach 1.7 #include "ctrl.h"
446 heimbach 1.3
447     c == routine arguments ==
448    
449     character*(*) active_var_file
450    
451     logical globalfile
452     logical lAdInit
453     integer irec
454     integer mynr
455     integer theSimulationMode
456     integer myOptimIter
457     integer mythid
458     _RL active_var(1-oly:sny+oly,mynr,nsx,nsy)
459    
460     c == local variables ==
461    
462     character*(2) adpref
463     character*(80) adfname
464    
465     integer bi,bj
466     integer i,j,k
467     integer oldprec
468     integer prec
469     integer il
470     integer ilnblnk
471    
472     logical writeglobalfile
473    
474 heimbach 1.8 _RL active_data_t(1-oly:sny+oly,mynr,nsx,nsy)
475 heimbach 1.3
476     c == functions ==
477    
478     external ilnblnk
479    
480     c == end of interface ==
481    
482     c force 64-bit io
483     oldPrec = readBinaryPrec
484 heimbach 1.7 readBinaryPrec = ctrlprec
485     prec = ctrlprec
486 heimbach 1.3
487     write(adfname(1:80),'(80a)') ' '
488     adpref = 'ad'
489     il = ilnblnk( active_var_file )
490    
491     write(adfname(1:2),'(a)') adpref
492     write(adfname(3:il+2),'(a)') active_var_file(1:il)
493    
494     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
495     c >>>>>>>>>>>>>>>>>>> FORWARD RUN <<<<<<<<<<<<<<<<<<<
496     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
497    
498     if (theSimulationMode .eq. FORWARD_SIMULATION) then
499    
500     _BEGIN_MASTER( mythid )
501    
502     c Read the active variable from file.
503    
504 jmc 1.9 call mdsreadfieldyz(
505     & active_var_file,
506     & prec,
507 heimbach 1.3 & 'RL',
508 jmc 1.9 & mynr,
509 heimbach 1.3 & active_var,
510 jmc 1.9 & irec,
511 heimbach 1.3 & mythid )
512    
513     if (lAdInit) then
514     c Initialise the corresponding adjoint variable on the
515 jmc 1.10 c adjoint variable file. These files are tiled.
516 heimbach 1.3
517     writeglobalfile = .false.
518     do bj = 1,nsy
519     do bi = 1,nsx
520 heimbach 1.8 do k = 1, mynr
521     do j = 1,sny
522     active_data_t(j,k,bi,bj)= 0. _d 0
523     enddo
524 heimbach 1.3 enddo
525     enddo
526     enddo
527    
528 jmc 1.9 call mdswritefieldyz(
529     & adfname,
530     & prec,
531 heimbach 1.3 & globalfile,
532 jmc 1.9 & 'RL',
533     & mynr,
534 heimbach 1.3 & active_data_t,
535 heimbach 1.8 & irec,
536 heimbach 1.3 & myOptimIter,
537     & mythid )
538     endif
539    
540     _END_MASTER( mythid )
541    
542     endif
543    
544     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
545     c >>>>>>>>>>>>>>>>>>> ADJOINT RUN <<<<<<<<<<<<<<<<<<<
546     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
547    
548     if (theSimulationMode .eq. REVERSE_SIMULATION) then
549    
550     _BEGIN_MASTER( mythid )
551    
552     writeglobalfile = .false.
553 jmc 1.9 call mdsreadfieldyz(
554     & active_var_file,
555     & prec,
556 heimbach 1.3 & 'RL',
557 jmc 1.9 & mynr,
558     & active_data_t,
559     & irec,
560 heimbach 1.3 & mythid )
561    
562     c Add active_var from appropriate location to data.
563 heimbach 1.8 do bj = 1,nsy
564     do bi = 1,nsx
565     do k = 1,mynr
566 heimbach 1.3 do j = 1,sny
567 jmc 1.9 active_data_t(j,k,bi,bj) =
568 heimbach 1.8 & active_data_t(j,k,bi,bj) +
569 heimbach 1.3 & active_var(j,k,bi,bj)
570     enddo
571     enddo
572     enddo
573 heimbach 1.8 enddo
574 jmc 1.9
575 heimbach 1.3 c Store the result on disk.
576 jmc 1.9 call mdswritefieldyz(
577     & active_var_file,
578 heimbach 1.3 & prec,
579 jmc 1.9 & writeglobalfile,
580 heimbach 1.3 & 'RL',
581 jmc 1.9 & mynr,
582     & active_data_t,
583     & irec,
584 heimbach 1.3 & myOptimIter,
585     & mythid )
586    
587     c Set active_var to zero.
588 heimbach 1.8 do bj = 1,nsy
589     do bi = 1,nsx
590     do k=1,mynr
591 heimbach 1.3 do j = 1,sny
592     active_var(j,k,bi,bj) = 0. _d 0
593     enddo
594     enddo
595     enddo
596     enddo
597    
598     _END_MASTER( mythid )
599     endif
600    
601 heimbach 1.4 c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
602     c >>>>>>>>>>>>>>>>>>> TANGENT RUN <<<<<<<<<<<<<<<<<<<
603     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
604    
605     if (theSimulationMode .eq. TANGENT_SIMULATION) then
606    
607     _BEGIN_MASTER( mythid )
608    
609     c Read the active variable from file.
610    
611 jmc 1.9 call mdsreadfieldyz(
612     & active_var_file,
613     & prec,
614 heimbach 1.4 & 'RL',
615 jmc 1.9 & mynr,
616 heimbach 1.4 & active_var,
617 jmc 1.9 & irec,
618 heimbach 1.4 & mythid )
619    
620     _END_MASTER( mythid )
621    
622     endif
623    
624 heimbach 1.3 c Reset default io precision.
625     readBinaryPrec = oldPrec
626    
627     _BARRIER
628    
629     return
630     end
631    
632     c ==================================================================
633    
634     subroutine active_write_yz_rl(
635     I active_var_file,
636     I active_var,
637     I globalfile,
638     I irec,
639     I mynr,
640     I theSimulationMode,
641     I myOptimIter,
642     I mythid
643     & )
644    
645     c ==================================================================
646     c SUBROUTINE active_write_yz_rl
647     c ==================================================================
648     c
649     c o Write an active variable to a file.
650     c
651     c started: heimbach@mit.edu 05-Mar-2001
652     c
653     c ==================================================================
654     c SUBROUTINE active_write_yz_rl
655     c ==================================================================
656    
657     implicit none
658    
659     c == global variables ==
660    
661     #include "EEPARAMS.h"
662     #include "SIZE.h"
663     #include "PARAMS.h"
664 heimbach 1.7 #include "ctrl.h"
665 heimbach 1.3
666     c == routine arguments ==
667    
668     character*(*) active_var_file
669    
670     integer mynr
671     logical globalfile
672     integer irec
673     integer theSimulationMode
674     integer myOptimIter
675     integer mythid
676     _RL active_var(1-oly:sny+oly,mynr,nsx,nsy)
677    
678     c == local variables ==
679    
680     integer i,j,k
681     integer bi,bj
682 heimbach 1.8 _RL active_data_t(1-oly:sny+oly,mynr,nsx,nsy)
683 heimbach 1.3 integer oldprec
684     integer prec
685    
686     c == end of interface ==
687    
688     c force 64-bit io
689     oldPrec = readBinaryPrec
690 heimbach 1.7 readBinaryPrec = ctrlprec
691     prec = ctrlprec
692 heimbach 1.3
693     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
694     c >>>>>>>>>>>>>>>>>>> FORWARD RUN <<<<<<<<<<<<<<<<<<<
695     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
696    
697     if (theSimulationMode .eq. FORWARD_SIMULATION) then
698    
699     _BEGIN_MASTER( mythid )
700    
701 jmc 1.9 call mdswritefieldyz(
702     & active_var_file,
703     & prec,
704 heimbach 1.3 & globalfile,
705 jmc 1.9 & 'RL',
706     & mynr,
707     & active_var,
708     & irec,
709 heimbach 1.3 & myOptimIter,
710     & mythid )
711    
712     _END_MASTER( mythid )
713    
714     endif
715    
716     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
717     c >>>>>>>>>>>>>>>>>>> ADJOINT RUN <<<<<<<<<<<<<<<<<<<
718     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
719    
720     if (theSimulationMode .eq. REVERSE_SIMULATION) then
721    
722     _BEGIN_MASTER( mythid )
723    
724 jmc 1.9 call mdsreadfieldyz(
725     & active_var_file,
726     & prec,
727 heimbach 1.3 & 'RL',
728 heimbach 1.8 & mynr,
729 jmc 1.9 & active_data_t,
730     & irec,
731 heimbach 1.3 & mythid )
732    
733     c Add active_var from appropriate location to data.
734 heimbach 1.8 do bj = 1,nsy
735     do bi = 1,nsx
736     do k = 1, mynr
737     do j = 1,sny
738 jmc 1.9 active_var(j,k,bi,bj) =
739 heimbach 1.8 & active_var(j,k,bi,bj) +
740     & active_data_t(j,k,bi,bj)
741     active_data_t(j,k,bi,bj) = 0. _d 0
742 heimbach 1.3 enddo
743     enddo
744 heimbach 1.8 enddo
745     enddo
746 jmc 1.9 call mdswritefieldyz(
747     & active_var_file,
748     & prec,
749 heimbach 1.3 & globalfile,
750 jmc 1.9 & 'RL',
751     & mynr,
752     & active_data_t,
753     & irec,
754 heimbach 1.3 & myOptimIter,
755     & mythid )
756 heimbach 1.4
757     _END_MASTER( mythid )
758    
759     endif
760    
761     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
762     c >>>>>>>>>>>>>>>>>>> TANGENTY RUN <<<<<<<<<<<<<<<<<<<
763     c >>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<
764    
765     if (theSimulationMode .eq. TANGENT_SIMULATION) then
766    
767     _BEGIN_MASTER( mythid )
768    
769 jmc 1.9 call mdswritefieldyz(
770     & active_var_file,
771     & prec,
772 heimbach 1.4 & globalfile,
773 jmc 1.9 & 'RL',
774     & mynr,
775     & active_var,
776     & irec,
777 heimbach 1.4 & myOptimIter,
778     & mythid )
779 heimbach 1.3
780     _END_MASTER( mythid )
781    
782     endif
783    
784     c Reset default io precision.
785     readBinaryPrec = oldPrec
786    
787     _BARRIER
788    
789     return
790     end
791    

  ViewVC Help
Powered by ViewVC 1.1.22