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