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