1 | SUBROUTINE write_3d_binary |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! +uswst, uswst_m, vswst, vswst_m |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: write_3d_binary.f90 102 2007-07-27 09:09:17Z raasch $ |
---|
11 | ! |
---|
12 | ! 96 2007-06-04 08:07:41Z raasch |
---|
13 | ! +rho_av, sa, sa_av, saswsb, saswst |
---|
14 | ! |
---|
15 | ! 75 2007-03-22 09:54:05Z raasch |
---|
16 | ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., |
---|
17 | ! z0_av, moisture renamed humidity |
---|
18 | ! |
---|
19 | ! 19 2007-02-23 04:53:48Z raasch |
---|
20 | ! +qswst, qswst_m, tswst, tswst_m |
---|
21 | ! |
---|
22 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
23 | ! |
---|
24 | ! Revision 1.21 2006/08/04 15:05:11 raasch |
---|
25 | ! +iran, iran_part |
---|
26 | ! |
---|
27 | ! Revision 1.1 1998/03/18 20:20:21 raasch |
---|
28 | ! Initial revision |
---|
29 | ! |
---|
30 | ! |
---|
31 | ! Description: |
---|
32 | ! ------------ |
---|
33 | ! Binary output of variables and arrays for restarts. |
---|
34 | !------------------------------------------------------------------------------! |
---|
35 | |
---|
36 | USE arrays_3d |
---|
37 | USE averaging |
---|
38 | USE cloud_parameters |
---|
39 | USE control_parameters |
---|
40 | USE cpulog |
---|
41 | USE indices |
---|
42 | USE interfaces |
---|
43 | USE particle_attributes |
---|
44 | USE pegrid |
---|
45 | USE profil_parameter |
---|
46 | USE random_function_mod |
---|
47 | USE statistics |
---|
48 | |
---|
49 | IMPLICIT NONE |
---|
50 | |
---|
51 | CHARACTER (LEN=10) :: binary_version |
---|
52 | |
---|
53 | |
---|
54 | CALL cpu_log( log_point(22), 'write_3d_binary', 'start' ) |
---|
55 | |
---|
56 | CALL check_open( 14 ) |
---|
57 | |
---|
58 | ! |
---|
59 | !-- Write control parameters and other variables for restart. |
---|
60 | CALL write_var_list |
---|
61 | |
---|
62 | ! |
---|
63 | !-- Write arrays. |
---|
64 | binary_version = '3.0' |
---|
65 | |
---|
66 | WRITE ( 14 ) binary_version |
---|
67 | |
---|
68 | WRITE ( 14 ) numprocs, myid, nxl, nxr, nys, nyn, nzb, nzt |
---|
69 | |
---|
70 | ! |
---|
71 | !-- Attention: After changes to the following output commands the version number |
---|
72 | !-- --------- of the variable binary_version must be changed! |
---|
73 | !-- Also, the list of arrays to be read in read_3d_binary must be |
---|
74 | !-- adjusted accordingly. |
---|
75 | |
---|
76 | WRITE ( 14 ) 'e '; WRITE ( 14 ) e |
---|
77 | IF ( ALLOCATED( e_av ) ) THEN |
---|
78 | WRITE ( 14 ) 'e_av '; WRITE ( 14 ) e_av |
---|
79 | ENDIF |
---|
80 | WRITE ( 14 ) 'e_m '; WRITE ( 14 ) e_m |
---|
81 | WRITE ( 14 ) 'iran '; WRITE ( 14 ) iran, iran_part |
---|
82 | WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh |
---|
83 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
84 | WRITE ( 14 ) 'kh_m '; WRITE ( 14 ) kh_m |
---|
85 | ENDIF |
---|
86 | WRITE ( 14 ) 'km '; WRITE ( 14 ) km |
---|
87 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
88 | WRITE ( 14 ) 'km_m '; WRITE ( 14 ) km_m |
---|
89 | ENDIF |
---|
90 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
91 | WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av |
---|
92 | ENDIF |
---|
93 | WRITE ( 14 ) 'p '; WRITE ( 14 ) p |
---|
94 | IF ( ALLOCATED( p_av ) ) THEN |
---|
95 | WRITE ( 14 ) 'p_av '; WRITE ( 14 ) p_av |
---|
96 | ENDIF |
---|
97 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
98 | WRITE ( 14 ) 'pc_av '; WRITE ( 14 ) pc_av |
---|
99 | ENDIF |
---|
100 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
101 | WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av |
---|
102 | ENDIF |
---|
103 | IF ( ALLOCATED( precipitation_amount ) ) THEN |
---|
104 | WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount |
---|
105 | ENDIF |
---|
106 | IF ( ALLOCATED( precipitation_rate_av ) ) THEN |
---|
107 | WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) & |
---|
108 | precipitation_rate_av |
---|
109 | ENDIF |
---|
110 | WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt |
---|
111 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
112 | WRITE ( 14 ) 'pt_av '; WRITE ( 14 ) pt_av |
---|
113 | ENDIF |
---|
114 | WRITE ( 14 ) 'pt_m '; WRITE ( 14 ) pt_m |
---|
115 | IF ( humidity .OR. passive_scalar ) THEN |
---|
116 | WRITE ( 14 ) 'q '; WRITE ( 14 ) q |
---|
117 | IF ( ALLOCATED( q_av ) ) THEN |
---|
118 | WRITE ( 14 ) 'q_av '; WRITE ( 14 ) q_av |
---|
119 | ENDIF |
---|
120 | WRITE ( 14 ) 'q_m '; WRITE ( 14 ) q_m |
---|
121 | IF ( cloud_physics ) THEN |
---|
122 | WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql |
---|
123 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
124 | WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av |
---|
125 | ENDIF |
---|
126 | ENDIF |
---|
127 | WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs |
---|
128 | WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws |
---|
129 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
130 | WRITE ( 14 ) 'qsws_m '; WRITE ( 14 ) qsws_m |
---|
131 | ENDIF |
---|
132 | WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst |
---|
133 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
134 | WRITE ( 14 ) 'qswst_m '; WRITE ( 14 ) qswst_m |
---|
135 | ENDIF |
---|
136 | ENDIF |
---|
137 | IF ( ocean ) THEN |
---|
138 | IF ( ALLOCATED( rho_av ) ) THEN |
---|
139 | WRITE ( 14 ) 'rho_av '; WRITE ( 14 ) rho_av |
---|
140 | ENDIF |
---|
141 | WRITE ( 14 ) 'sa '; WRITE ( 14 ) sa |
---|
142 | IF ( ALLOCATED( sa_av ) ) THEN |
---|
143 | WRITE ( 14 ) 'sa_av '; WRITE ( 14 ) sa_av |
---|
144 | ENDIF |
---|
145 | WRITE ( 14 ) 'saswsb '; WRITE ( 14 ) saswsb |
---|
146 | WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst |
---|
147 | ENDIF |
---|
148 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
149 | WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av |
---|
150 | ENDIF |
---|
151 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
152 | WRITE ( 14 ) 'ql_v_av '; WRITE ( 14 ) ql_v_av |
---|
153 | ENDIF |
---|
154 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
155 | WRITE ( 14 ) 'ql_vp_av '; WRITE ( 14 ) ql_vp_av |
---|
156 | ENDIF |
---|
157 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
158 | WRITE ( 14 ) 'qv_av '; WRITE ( 14 ) qv_av |
---|
159 | ENDIF |
---|
160 | WRITE ( 14 ) 'random_iv '; WRITE ( 14 ) random_iv |
---|
161 | WRITE ( 14 ) random_iy |
---|
162 | WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif |
---|
163 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
164 | WRITE ( 14 ) 'rif_m '; WRITE ( 14 ) rif_m |
---|
165 | ENDIF |
---|
166 | IF ( topography /= 'flat' ) THEN |
---|
167 | WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall |
---|
168 | ENDIF |
---|
169 | IF ( ALLOCATED( s_av ) ) THEN |
---|
170 | WRITE ( 14 ) 's_av '; WRITE ( 14 ) s_av |
---|
171 | ENDIF |
---|
172 | WRITE ( 14 ) 'shf '; WRITE ( 14 ) shf |
---|
173 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
174 | WRITE ( 14 ) 'shf_m '; WRITE ( 14 ) shf_m |
---|
175 | ENDIF |
---|
176 | WRITE ( 14 ) 'ts '; WRITE ( 14 ) ts |
---|
177 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
178 | WRITE ( 14 ) 'ts_av '; WRITE ( 14 ) ts_av |
---|
179 | ENDIF |
---|
180 | WRITE ( 14 ) 'tswst '; WRITE ( 14 ) tswst |
---|
181 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
182 | WRITE ( 14 ) 'tswst_m '; WRITE ( 14 ) tswst_m |
---|
183 | ENDIF |
---|
184 | WRITE ( 14 ) 'u '; WRITE ( 14 ) u |
---|
185 | IF ( ALLOCATED( u_av ) ) THEN |
---|
186 | WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av |
---|
187 | ENDIF |
---|
188 | WRITE ( 14 ) 'u_m '; WRITE ( 14 ) u_m |
---|
189 | IF ( ALLOCATED( u_m_l ) ) THEN |
---|
190 | WRITE ( 14 ) 'u_m_l '; WRITE ( 14 ) u_m_l |
---|
191 | ENDIF |
---|
192 | IF ( ALLOCATED( u_m_n ) ) THEN |
---|
193 | WRITE ( 14 ) 'u_m_n '; WRITE ( 14 ) u_m_n |
---|
194 | ENDIF |
---|
195 | IF ( ALLOCATED( u_m_r ) ) THEN |
---|
196 | WRITE ( 14 ) 'u_m_r '; WRITE ( 14 ) u_m_r |
---|
197 | ENDIF |
---|
198 | IF ( ALLOCATED( u_m_s ) ) THEN |
---|
199 | WRITE ( 14 ) 'u_m_s '; WRITE ( 14 ) u_m_s |
---|
200 | ENDIF |
---|
201 | WRITE ( 14 ) 'us '; WRITE ( 14 ) us |
---|
202 | WRITE ( 14 ) 'usws '; WRITE ( 14 ) usws |
---|
203 | WRITE ( 14 ) 'uswst '; WRITE ( 14 ) uswst |
---|
204 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
205 | WRITE ( 14 ) 'usws_m '; WRITE ( 14 ) usws_m |
---|
206 | WRITE ( 14 ) 'uswst_m '; WRITE ( 14 ) uswst_m |
---|
207 | ENDIF |
---|
208 | IF ( ALLOCATED( us_av ) ) THEN |
---|
209 | WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av |
---|
210 | ENDIF |
---|
211 | WRITE ( 14 ) 'v '; WRITE ( 14 ) v |
---|
212 | WRITE ( 14 ) 'volume_flow_area '; WRITE ( 14 ) volume_flow_area |
---|
213 | WRITE ( 14 ) 'volume_flow_initial '; WRITE ( 14 ) volume_flow_initial |
---|
214 | IF ( ALLOCATED( v_av ) ) THEN |
---|
215 | WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av |
---|
216 | ENDIF |
---|
217 | WRITE ( 14 ) 'v_m '; WRITE ( 14 ) v_m |
---|
218 | IF ( ALLOCATED( v_m_l ) ) THEN |
---|
219 | WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l |
---|
220 | ENDIF |
---|
221 | IF ( ALLOCATED( v_m_n ) ) THEN |
---|
222 | WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n |
---|
223 | ENDIF |
---|
224 | IF ( ALLOCATED( v_m_r ) ) THEN |
---|
225 | WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r |
---|
226 | ENDIF |
---|
227 | IF ( ALLOCATED( v_m_s ) ) THEN |
---|
228 | WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s |
---|
229 | ENDIF |
---|
230 | IF ( humidity ) THEN |
---|
231 | WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt |
---|
232 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
233 | WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av |
---|
234 | ENDIF |
---|
235 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
236 | WRITE ( 14 ) 'vpt_m '; WRITE ( 14 ) vpt_m |
---|
237 | ENDIF |
---|
238 | ENDIF |
---|
239 | WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws |
---|
240 | WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst |
---|
241 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
242 | WRITE ( 14 ) 'vsws_m '; WRITE ( 14 ) vsws_m |
---|
243 | WRITE ( 14 ) 'vswst_m '; WRITE ( 14 ) vswst_m |
---|
244 | ENDIF |
---|
245 | WRITE ( 14 ) 'w '; WRITE ( 14 ) w |
---|
246 | IF ( ALLOCATED( w_av ) ) THEN |
---|
247 | WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av |
---|
248 | ENDIF |
---|
249 | WRITE ( 14 ) 'w_m '; WRITE ( 14 ) w_m |
---|
250 | IF ( ALLOCATED( w_m_l ) ) THEN |
---|
251 | WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l |
---|
252 | ENDIF |
---|
253 | IF ( ALLOCATED( w_m_n ) ) THEN |
---|
254 | WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n |
---|
255 | ENDIF |
---|
256 | IF ( ALLOCATED( w_m_r ) ) THEN |
---|
257 | WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r |
---|
258 | ENDIF |
---|
259 | IF ( ALLOCATED( w_m_s ) ) THEN |
---|
260 | WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s |
---|
261 | ENDIF |
---|
262 | WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 |
---|
263 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
264 | WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av |
---|
265 | ENDIF |
---|
266 | |
---|
267 | WRITE ( 14 ) 'cross_linecolors '; WRITE ( 14 ) cross_linecolors |
---|
268 | WRITE ( 14 ) 'cross_linestyles '; WRITE ( 14 ) cross_linestyles |
---|
269 | WRITE ( 14 ) 'cross_normalized_x '; WRITE ( 14 ) cross_normalized_x |
---|
270 | WRITE ( 14 ) 'cross_normalized_y '; WRITE ( 14 ) cross_normalized_y |
---|
271 | WRITE ( 14 ) 'cross_normx_factor '; WRITE ( 14 ) cross_normx_factor |
---|
272 | WRITE ( 14 ) 'cross_normy_factor '; WRITE ( 14 ) cross_normy_factor |
---|
273 | WRITE ( 14 ) 'cross_profiles '; WRITE ( 14 ) cross_profiles |
---|
274 | WRITE ( 14 ) 'cross_profile_n_coun' |
---|
275 | WRITE ( 14 ) cross_profile_number_count |
---|
276 | WRITE ( 14 ) 'cross_profile_number'; WRITE ( 14 ) cross_profile_numbers |
---|
277 | WRITE ( 14 ) 'cross_uxmax '; WRITE ( 14 ) cross_uxmax |
---|
278 | WRITE ( 14 ) 'cross_uxmax_computed'; WRITE ( 14 ) cross_uxmax_computed |
---|
279 | WRITE ( 14 ) 'cross_uxmax_normaliz'; WRITE ( 14 ) cross_uxmax_normalized |
---|
280 | WRITE ( 14 ) 'cross_uxmax_norm_com' |
---|
281 | WRITE ( 14 ) cross_uxmax_normalized_computed |
---|
282 | WRITE ( 14 ) 'cross_uxmin '; WRITE ( 14 ) cross_uxmin |
---|
283 | WRITE ( 14 ) 'cross_uxmin_computed'; WRITE ( 14 ) cross_uxmin_computed |
---|
284 | WRITE ( 14 ) 'cross_uxmin_normaliz'; WRITE ( 14 ) cross_uxmin_normalized |
---|
285 | WRITE ( 14 ) 'cross_uxmin_norm_com' |
---|
286 | WRITE ( 14 ) cross_uxmin_normalized_computed |
---|
287 | WRITE ( 14 ) 'cross_uymax '; WRITE ( 14 ) cross_uymax |
---|
288 | WRITE ( 14 ) 'cross_uymin '; WRITE ( 14 ) cross_uymin |
---|
289 | WRITE ( 14 ) 'cross_xtext '; WRITE ( 14 ) cross_xtext |
---|
290 | WRITE ( 14 ) 'dopr_crossindex '; WRITE ( 14 ) dopr_crossindex |
---|
291 | WRITE ( 14 ) 'dopr_time_count '; WRITE ( 14 ) dopr_time_count |
---|
292 | WRITE ( 14 ) 'hom_sum '; WRITE ( 14 ) hom_sum |
---|
293 | WRITE ( 14 ) 'profile_columns '; WRITE ( 14 ) profile_columns |
---|
294 | WRITE ( 14 ) 'profile_number '; WRITE ( 14 ) profile_number |
---|
295 | WRITE ( 14 ) 'profile_rows '; WRITE ( 14 ) profile_rows |
---|
296 | IF ( ALLOCATED( spectrum_x ) ) THEN |
---|
297 | WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x |
---|
298 | WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y |
---|
299 | ENDIF |
---|
300 | |
---|
301 | ! |
---|
302 | !-- Write end label. Unit 14 is closed in the main program. |
---|
303 | WRITE ( 14 ) '*** end *** ' |
---|
304 | |
---|
305 | |
---|
306 | CALL cpu_log( log_point(22), 'write_3d_binary', 'stop' ) |
---|
307 | |
---|
308 | |
---|
309 | END SUBROUTINE write_3d_binary |
---|