1 | SUBROUTINE write_3d_binary |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: write_3d_binary.f90 98 2007-06-21 09:36:33Z 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 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
204 | WRITE ( 14 ) 'usws_m '; WRITE ( 14 ) usws_m |
---|
205 | ENDIF |
---|
206 | IF ( ALLOCATED( us_av ) ) THEN |
---|
207 | WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av |
---|
208 | ENDIF |
---|
209 | WRITE ( 14 ) 'v '; WRITE ( 14 ) v |
---|
210 | WRITE ( 14 ) 'volume_flow_area '; WRITE ( 14 ) volume_flow_area |
---|
211 | WRITE ( 14 ) 'volume_flow_initial '; WRITE ( 14 ) volume_flow_initial |
---|
212 | IF ( ALLOCATED( v_av ) ) THEN |
---|
213 | WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av |
---|
214 | ENDIF |
---|
215 | WRITE ( 14 ) 'v_m '; WRITE ( 14 ) v_m |
---|
216 | IF ( ALLOCATED( v_m_l ) ) THEN |
---|
217 | WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l |
---|
218 | ENDIF |
---|
219 | IF ( ALLOCATED( v_m_n ) ) THEN |
---|
220 | WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n |
---|
221 | ENDIF |
---|
222 | IF ( ALLOCATED( v_m_r ) ) THEN |
---|
223 | WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r |
---|
224 | ENDIF |
---|
225 | IF ( ALLOCATED( v_m_s ) ) THEN |
---|
226 | WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s |
---|
227 | ENDIF |
---|
228 | IF ( humidity ) THEN |
---|
229 | WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt |
---|
230 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
231 | WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av |
---|
232 | ENDIF |
---|
233 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
234 | WRITE ( 14 ) 'vpt_m '; WRITE ( 14 ) vpt_m |
---|
235 | ENDIF |
---|
236 | ENDIF |
---|
237 | WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws |
---|
238 | IF ( timestep_scheme(1:5) /= 'runge' ) THEN |
---|
239 | WRITE ( 14 ) 'vsws_m '; WRITE ( 14 ) vsws_m |
---|
240 | ENDIF |
---|
241 | WRITE ( 14 ) 'w '; WRITE ( 14 ) w |
---|
242 | IF ( ALLOCATED( w_av ) ) THEN |
---|
243 | WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av |
---|
244 | ENDIF |
---|
245 | WRITE ( 14 ) 'w_m '; WRITE ( 14 ) w_m |
---|
246 | IF ( ALLOCATED( w_m_l ) ) THEN |
---|
247 | WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l |
---|
248 | ENDIF |
---|
249 | IF ( ALLOCATED( w_m_n ) ) THEN |
---|
250 | WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n |
---|
251 | ENDIF |
---|
252 | IF ( ALLOCATED( w_m_r ) ) THEN |
---|
253 | WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r |
---|
254 | ENDIF |
---|
255 | IF ( ALLOCATED( w_m_s ) ) THEN |
---|
256 | WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s |
---|
257 | ENDIF |
---|
258 | WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 |
---|
259 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
260 | WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av |
---|
261 | ENDIF |
---|
262 | |
---|
263 | WRITE ( 14 ) 'cross_linecolors '; WRITE ( 14 ) cross_linecolors |
---|
264 | WRITE ( 14 ) 'cross_linestyles '; WRITE ( 14 ) cross_linestyles |
---|
265 | WRITE ( 14 ) 'cross_normalized_x '; WRITE ( 14 ) cross_normalized_x |
---|
266 | WRITE ( 14 ) 'cross_normalized_y '; WRITE ( 14 ) cross_normalized_y |
---|
267 | WRITE ( 14 ) 'cross_normx_factor '; WRITE ( 14 ) cross_normx_factor |
---|
268 | WRITE ( 14 ) 'cross_normy_factor '; WRITE ( 14 ) cross_normy_factor |
---|
269 | WRITE ( 14 ) 'cross_profiles '; WRITE ( 14 ) cross_profiles |
---|
270 | WRITE ( 14 ) 'cross_profile_n_coun' |
---|
271 | WRITE ( 14 ) cross_profile_number_count |
---|
272 | WRITE ( 14 ) 'cross_profile_number'; WRITE ( 14 ) cross_profile_numbers |
---|
273 | WRITE ( 14 ) 'cross_uxmax '; WRITE ( 14 ) cross_uxmax |
---|
274 | WRITE ( 14 ) 'cross_uxmax_computed'; WRITE ( 14 ) cross_uxmax_computed |
---|
275 | WRITE ( 14 ) 'cross_uxmax_normaliz'; WRITE ( 14 ) cross_uxmax_normalized |
---|
276 | WRITE ( 14 ) 'cross_uxmax_norm_com' |
---|
277 | WRITE ( 14 ) cross_uxmax_normalized_computed |
---|
278 | WRITE ( 14 ) 'cross_uxmin '; WRITE ( 14 ) cross_uxmin |
---|
279 | WRITE ( 14 ) 'cross_uxmin_computed'; WRITE ( 14 ) cross_uxmin_computed |
---|
280 | WRITE ( 14 ) 'cross_uxmin_normaliz'; WRITE ( 14 ) cross_uxmin_normalized |
---|
281 | WRITE ( 14 ) 'cross_uxmin_norm_com' |
---|
282 | WRITE ( 14 ) cross_uxmin_normalized_computed |
---|
283 | WRITE ( 14 ) 'cross_uymax '; WRITE ( 14 ) cross_uymax |
---|
284 | WRITE ( 14 ) 'cross_uymin '; WRITE ( 14 ) cross_uymin |
---|
285 | WRITE ( 14 ) 'cross_xtext '; WRITE ( 14 ) cross_xtext |
---|
286 | WRITE ( 14 ) 'dopr_crossindex '; WRITE ( 14 ) dopr_crossindex |
---|
287 | WRITE ( 14 ) 'dopr_time_count '; WRITE ( 14 ) dopr_time_count |
---|
288 | WRITE ( 14 ) 'hom_sum '; WRITE ( 14 ) hom_sum |
---|
289 | WRITE ( 14 ) 'profile_columns '; WRITE ( 14 ) profile_columns |
---|
290 | WRITE ( 14 ) 'profile_number '; WRITE ( 14 ) profile_number |
---|
291 | WRITE ( 14 ) 'profile_rows '; WRITE ( 14 ) profile_rows |
---|
292 | IF ( ALLOCATED( spectrum_x ) ) THEN |
---|
293 | WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x |
---|
294 | WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y |
---|
295 | ENDIF |
---|
296 | |
---|
297 | ! |
---|
298 | !-- Write end label. Unit 14 is closed in the main program. |
---|
299 | WRITE ( 14 ) '*** end *** ' |
---|
300 | |
---|
301 | |
---|
302 | CALL cpu_log( log_point(22), 'write_3d_binary', 'stop' ) |
---|
303 | |
---|
304 | |
---|
305 | END SUBROUTINE write_3d_binary |
---|