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