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