1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PROFILES_OPTIONS.h" |
5 |
|
6 |
c ================================================================== |
7 |
c |
8 |
c active_file.F: Routines to handle the I/O of the active file for |
9 |
c the adjoint calculations. All files are direct |
10 |
c access files. |
11 |
c |
12 |
c Routines |
13 |
c |
14 |
c o active_read_profile - Read an active 1D record. |
15 |
c o active_write_profile - Write an active 1D record. |
16 |
c |
17 |
c |
18 |
c changed: gforget@ocean.mit.edu 23-Mar-2006 |
19 |
c |
20 |
c ================================================================== |
21 |
|
22 |
C !ROUTINE: active_read_profile |
23 |
C !INTERFACE: |
24 |
subroutine active_read_profile( |
25 |
I active_num_file, |
26 |
I nactive_var, |
27 |
O active_var, |
28 |
I active_varnum, |
29 |
I irec, |
30 |
I lAdInit, |
31 |
I myOptimIter, |
32 |
I bi, |
33 |
I bj, |
34 |
I mythid, |
35 |
I dummy |
36 |
& ) |
37 |
|
38 |
c ================================================================== |
39 |
c SUBROUTINE active_read_profile |
40 |
c ================================================================== |
41 |
c o Read an active 1D record from an profile data file. |
42 |
c ================================================================== |
43 |
|
44 |
implicit none |
45 |
c == global variables == |
46 |
#include "EEPARAMS.h" |
47 |
#include "SIZE.h" |
48 |
#ifdef ALLOW_PROFILES |
49 |
# include "profiles.h" |
50 |
#endif |
51 |
|
52 |
c == routine arguments == |
53 |
c active_var_file: filename |
54 |
c nactive_var: integer size of active_var |
55 |
c active_var: array |
56 |
c active_varname: name fo the quantity to save |
57 |
c irec: record number |
58 |
c myOptimIter: number of optimization iteration (default: 0) |
59 |
c mythid: thread number for this instance |
60 |
c lAdInit: initialisation of corresponding adjoint |
61 |
c variable and write to active file |
62 |
integer nactive_var,active_num_file |
63 |
_RL active_var(nactive_var) |
64 |
integer irec,active_varnum |
65 |
integer myOptimIter |
66 |
integer bi,bj,mythid |
67 |
logical lAdInit |
68 |
_RL dummy |
69 |
|
70 |
#ifdef ALLOW_PROFILES |
71 |
|
72 |
call active_read_profile_rl( fidforward(active_num_file,bi,bj), |
73 |
& active_num_file, |
74 |
& nactive_var, active_var, active_varnum, lAdInit, |
75 |
& irec, prof_ind_glob(active_num_file,irec,bi,bj), |
76 |
& FORWARD_SIMULATION, myOptimIter,bi,bj, mythid) |
77 |
|
78 |
#endif |
79 |
|
80 |
return |
81 |
end |
82 |
|
83 |
c ================================================================== |
84 |
c ================================================================== |
85 |
c ================================================================== |
86 |
|
87 |
C !ROUTINE: active_write_profile |
88 |
C !INTERFACE: |
89 |
subroutine active_write_profile( |
90 |
I active_num_file, |
91 |
I nactive_var, |
92 |
I active_var, |
93 |
I active_varnum, |
94 |
I irec, |
95 |
I myOptimIter, |
96 |
I bi, |
97 |
I bj, |
98 |
I mythid, |
99 |
I dummy |
100 |
& ) |
101 |
|
102 |
C !DESCRIPTION: \bv |
103 |
c ================================================================== |
104 |
c SUBROUTINE active_write_profile |
105 |
c ================================================================== |
106 |
c o Write an active 1D record from file. |
107 |
c ================================================================== |
108 |
|
109 |
C !USES: |
110 |
implicit none |
111 |
|
112 |
c == global variables == |
113 |
#include "EEPARAMS.h" |
114 |
#include "SIZE.h" |
115 |
#ifdef ALLOW_PROFILES |
116 |
# include "profiles.h" |
117 |
#endif |
118 |
|
119 |
c == routine arguments == |
120 |
c active_var_file: filename |
121 |
c nactive_var: integer size of active_var |
122 |
c active_var: array |
123 |
c active_varname: name fo the quantity to save |
124 |
c irec: record number |
125 |
c myOptimIter: number of optimization iteration (default: 0) |
126 |
c mythid: thread number for this instance |
127 |
integer nactive_var,active_num_file, active_varnum |
128 |
_RL active_var(nactive_var) |
129 |
integer irec |
130 |
integer myOptimIter |
131 |
integer bi,bj,mythid |
132 |
_RL dummy |
133 |
|
134 |
#ifdef ALLOW_PROFILES |
135 |
|
136 |
call active_write_profile_rl( fidforward(active_num_file,bi,bj), |
137 |
& active_num_file, |
138 |
& nactive_var, active_var, active_varnum, |
139 |
& irec, prof_ind_glob(active_num_file,irec,bi,bj), |
140 |
& FORWARD_SIMULATION, myOptimIter,bi,bj, mythid) |
141 |
|
142 |
#endif |
143 |
|
144 |
return |
145 |
end |
146 |
|
147 |
c ================================================================== |
148 |
|
149 |
|