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