1 | SUBROUTINE write_3d_binary |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! qr and nr are restricted to precipitation |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: write_3d_binary.f90 1115 2013-03-26 18:16:16Z hoffmann $ |
---|
27 | ! |
---|
28 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
29 | ! necessary expansions according to the two new prognostic equations (nr, qr) |
---|
30 | ! of the two-moment cloud physics scheme: |
---|
31 | ! +prr, prr_av, *, *_av, *s, *sws, *swst |
---|
32 | ! |
---|
33 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
34 | ! code put under GPL (PALM 3.9) |
---|
35 | ! |
---|
36 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
37 | ! all actions concerning leapfrog- and ups-scheme removed |
---|
38 | ! |
---|
39 | ! 978 2012-08-09 08:28:32Z fricke |
---|
40 | ! +z0h, z0h_av |
---|
41 | ! |
---|
42 | ! 790 2011-11-29 03:11:20Z raasch |
---|
43 | ! bugfix: output of 'ql' also if cloud droplets are used |
---|
44 | ! |
---|
45 | ! 776 2011-10-31 08:02:51Z heinze |
---|
46 | ! bugfix: increase binary_version due to last commit |
---|
47 | ! |
---|
48 | ! 771 2011-10-27 10:56:21Z heinze |
---|
49 | ! +lpt |
---|
50 | ! |
---|
51 | ! 759 2011-09-15 13:58:31Z raasch |
---|
52 | ! cpu measurement and file opening moved to main program |
---|
53 | ! |
---|
54 | ! 587 2010-10-27 08:36:51Z helmke |
---|
55 | ! nothing done but text written for "Current revisions" by mistake |
---|
56 | ! |
---|
57 | ! 367 2009-08-25 08:35:52Z maronga |
---|
58 | ! +shf_av, qsws_av |
---|
59 | ! |
---|
60 | ! 145 2008-01-09 08:17:38Z raasch |
---|
61 | ! write_var_list is only called for pe0, -dopr_time_count, |
---|
62 | ! hom_sum moved, volume_flow_area, volume_flow_initial moved to write_var_list, |
---|
63 | ! writing of old profil parameters (cross_..., dopr_crossindex, profile_***) |
---|
64 | ! removed |
---|
65 | ! |
---|
66 | ! 102 2007-07-27 09:09:17Z raasch |
---|
67 | ! +uswst, uswst_m, vswst, vswst_m |
---|
68 | ! |
---|
69 | ! 96 2007-06-04 08:07:41Z raasch |
---|
70 | ! +rho_av, sa, sa_av, saswsb, saswst |
---|
71 | ! |
---|
72 | ! 75 2007-03-22 09:54:05Z raasch |
---|
73 | ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., |
---|
74 | ! z0_av, moisture renamed humidity |
---|
75 | ! |
---|
76 | ! 19 2007-02-23 04:53:48Z raasch |
---|
77 | ! +qswst, qswst_m, tswst, tswst_m |
---|
78 | ! |
---|
79 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
80 | ! |
---|
81 | ! Revision 1.21 2006/08/04 15:05:11 raasch |
---|
82 | ! +iran, iran_part |
---|
83 | ! |
---|
84 | ! Revision 1.1 1998/03/18 20:20:21 raasch |
---|
85 | ! Initial revision |
---|
86 | ! |
---|
87 | ! |
---|
88 | ! Description: |
---|
89 | ! ------------ |
---|
90 | ! Binary output of variables and arrays for restarts. |
---|
91 | !------------------------------------------------------------------------------! |
---|
92 | |
---|
93 | USE arrays_3d |
---|
94 | USE averaging |
---|
95 | USE cloud_parameters |
---|
96 | USE control_parameters |
---|
97 | USE cpulog |
---|
98 | USE indices |
---|
99 | USE interfaces |
---|
100 | USE particle_attributes |
---|
101 | USE pegrid |
---|
102 | USE profil_parameter |
---|
103 | USE random_function_mod |
---|
104 | USE statistics |
---|
105 | |
---|
106 | IMPLICIT NONE |
---|
107 | |
---|
108 | CHARACTER (LEN=10) :: binary_version |
---|
109 | |
---|
110 | |
---|
111 | ! |
---|
112 | !-- Write control parameters and other variables for restart. |
---|
113 | IF ( myid == 0 ) CALL write_var_list |
---|
114 | |
---|
115 | ! |
---|
116 | !-- Write arrays. |
---|
117 | binary_version = '3.4' |
---|
118 | |
---|
119 | WRITE ( 14 ) binary_version |
---|
120 | |
---|
121 | WRITE ( 14 ) numprocs, myid, nxl, nxr, nys, nyn, nzb, nzt |
---|
122 | |
---|
123 | ! |
---|
124 | !-- Attention: After changes to the following output commands the version number |
---|
125 | !-- --------- of the variable binary_version must be changed! |
---|
126 | !-- Also, the list of arrays to be read in read_3d_binary must be |
---|
127 | !-- adjusted accordingly. |
---|
128 | |
---|
129 | WRITE ( 14 ) 'e '; WRITE ( 14 ) e |
---|
130 | IF ( ALLOCATED( e_av ) ) THEN |
---|
131 | WRITE ( 14 ) 'e_av '; WRITE ( 14 ) e_av |
---|
132 | ENDIF |
---|
133 | WRITE ( 14 ) 'iran '; WRITE ( 14 ) iran, iran_part |
---|
134 | WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh |
---|
135 | WRITE ( 14 ) 'km '; WRITE ( 14 ) km |
---|
136 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
137 | WRITE ( 14 ) 'lpt_av '; WRITE ( 14 ) lpt_av |
---|
138 | ENDIF |
---|
139 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
140 | WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av |
---|
141 | ENDIF |
---|
142 | WRITE ( 14 ) 'p '; WRITE ( 14 ) p |
---|
143 | IF ( ALLOCATED( p_av ) ) THEN |
---|
144 | WRITE ( 14 ) 'p_av '; WRITE ( 14 ) p_av |
---|
145 | ENDIF |
---|
146 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
147 | WRITE ( 14 ) 'pc_av '; WRITE ( 14 ) pc_av |
---|
148 | ENDIF |
---|
149 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
150 | WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av |
---|
151 | ENDIF |
---|
152 | IF ( ALLOCATED( prr ) ) THEN |
---|
153 | WRITE ( 14 ) 'prr '; WRITE ( 14 ) prr |
---|
154 | ENDIF |
---|
155 | IF ( ALLOCATED( prr_av ) ) THEN |
---|
156 | WRITE ( 14 ) 'prr_av '; WRITE ( 14 ) prr_av |
---|
157 | ENDIF |
---|
158 | IF ( ALLOCATED( precipitation_amount ) ) THEN |
---|
159 | WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount |
---|
160 | ENDIF |
---|
161 | IF ( ALLOCATED( precipitation_rate_av ) ) THEN |
---|
162 | WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) & |
---|
163 | precipitation_rate_av |
---|
164 | ENDIF |
---|
165 | WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt |
---|
166 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
167 | WRITE ( 14 ) 'pt_av '; WRITE ( 14 ) pt_av |
---|
168 | ENDIF |
---|
169 | IF ( humidity .OR. passive_scalar ) THEN |
---|
170 | WRITE ( 14 ) 'q '; WRITE ( 14 ) q |
---|
171 | IF ( ALLOCATED( q_av ) ) THEN |
---|
172 | WRITE ( 14 ) 'q_av '; WRITE ( 14 ) q_av |
---|
173 | ENDIF |
---|
174 | IF ( cloud_physics .OR. cloud_droplets ) THEN |
---|
175 | WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql |
---|
176 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
177 | WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av |
---|
178 | ENDIF |
---|
179 | IF ( icloud_scheme == 0 ) THEN |
---|
180 | WRITE ( 14 ) 'qc '; WRITE ( 14 ) qc |
---|
181 | IF ( ALLOCATED( qc_av ) ) THEN |
---|
182 | WRITE ( 14 ) 'qc_av '; WRITE ( 14 ) qc_av |
---|
183 | ENDIF |
---|
184 | IF ( precipitation ) THEN |
---|
185 | WRITE ( 14 ) 'nr '; WRITE ( 14 ) nr |
---|
186 | IF ( ALLOCATED( nr_av ) ) THEN |
---|
187 | WRITE ( 14 ) 'nr_av '; WRITE ( 14 ) nr_av |
---|
188 | ENDIF |
---|
189 | WRITE ( 14 ) 'nrs '; WRITE ( 14 ) nrs |
---|
190 | WRITE ( 14 ) 'nrsws '; WRITE ( 14 ) nrsws |
---|
191 | WRITE ( 14 ) 'nrswst '; WRITE ( 14 ) nrswst |
---|
192 | WRITE ( 14 ) 'qr '; WRITE ( 14 ) qr |
---|
193 | IF ( ALLOCATED( qr_av ) ) THEN |
---|
194 | WRITE ( 14 ) 'qr_av '; WRITE ( 14 ) qr_av |
---|
195 | ENDIF |
---|
196 | WRITE ( 14 ) 'qrs '; WRITE ( 14 ) qrs |
---|
197 | WRITE ( 14 ) 'qrsws '; WRITE ( 14 ) qrsws |
---|
198 | WRITE ( 14 ) 'qrswst '; WRITE ( 14 ) qrswst |
---|
199 | ENDIF |
---|
200 | ENDIF |
---|
201 | ENDIF |
---|
202 | WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs |
---|
203 | WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws |
---|
204 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
205 | WRITE ( 14 ) 'qsws_av '; WRITE ( 14 ) qsws_av |
---|
206 | ENDIF |
---|
207 | WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst |
---|
208 | ENDIF |
---|
209 | IF ( ocean ) THEN |
---|
210 | IF ( ALLOCATED( rho_av ) ) THEN |
---|
211 | WRITE ( 14 ) 'rho_av '; WRITE ( 14 ) rho_av |
---|
212 | ENDIF |
---|
213 | WRITE ( 14 ) 'sa '; WRITE ( 14 ) sa |
---|
214 | IF ( ALLOCATED( sa_av ) ) THEN |
---|
215 | WRITE ( 14 ) 'sa_av '; WRITE ( 14 ) sa_av |
---|
216 | ENDIF |
---|
217 | WRITE ( 14 ) 'saswsb '; WRITE ( 14 ) saswsb |
---|
218 | WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst |
---|
219 | ENDIF |
---|
220 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
221 | WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av |
---|
222 | ENDIF |
---|
223 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
224 | WRITE ( 14 ) 'ql_v_av '; WRITE ( 14 ) ql_v_av |
---|
225 | ENDIF |
---|
226 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
227 | WRITE ( 14 ) 'ql_vp_av '; WRITE ( 14 ) ql_vp_av |
---|
228 | ENDIF |
---|
229 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
230 | WRITE ( 14 ) 'qv_av '; WRITE ( 14 ) qv_av |
---|
231 | ENDIF |
---|
232 | WRITE ( 14 ) 'random_iv '; WRITE ( 14 ) random_iv |
---|
233 | WRITE ( 14 ) random_iy |
---|
234 | WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif |
---|
235 | IF ( topography /= 'flat' ) THEN |
---|
236 | WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall |
---|
237 | ENDIF |
---|
238 | IF ( ALLOCATED( s_av ) ) THEN |
---|
239 | WRITE ( 14 ) 's_av '; WRITE ( 14 ) s_av |
---|
240 | ENDIF |
---|
241 | WRITE ( 14 ) 'shf '; WRITE ( 14 ) shf |
---|
242 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
243 | WRITE ( 14 ) 'shf_av '; WRITE ( 14 ) shf_av |
---|
244 | ENDIF |
---|
245 | IF ( ALLOCATED( spectrum_x ) ) THEN |
---|
246 | WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x |
---|
247 | WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y |
---|
248 | ENDIF |
---|
249 | WRITE ( 14 ) 'ts '; WRITE ( 14 ) ts |
---|
250 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
251 | WRITE ( 14 ) 'ts_av '; WRITE ( 14 ) ts_av |
---|
252 | ENDIF |
---|
253 | WRITE ( 14 ) 'tswst '; WRITE ( 14 ) tswst |
---|
254 | WRITE ( 14 ) 'u '; WRITE ( 14 ) u |
---|
255 | IF ( ALLOCATED( u_av ) ) THEN |
---|
256 | WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av |
---|
257 | ENDIF |
---|
258 | IF ( ALLOCATED( u_m_l ) ) THEN |
---|
259 | WRITE ( 14 ) 'u_m_l '; WRITE ( 14 ) u_m_l |
---|
260 | ENDIF |
---|
261 | IF ( ALLOCATED( u_m_n ) ) THEN |
---|
262 | WRITE ( 14 ) 'u_m_n '; WRITE ( 14 ) u_m_n |
---|
263 | ENDIF |
---|
264 | IF ( ALLOCATED( u_m_r ) ) THEN |
---|
265 | WRITE ( 14 ) 'u_m_r '; WRITE ( 14 ) u_m_r |
---|
266 | ENDIF |
---|
267 | IF ( ALLOCATED( u_m_s ) ) THEN |
---|
268 | WRITE ( 14 ) 'u_m_s '; WRITE ( 14 ) u_m_s |
---|
269 | ENDIF |
---|
270 | WRITE ( 14 ) 'us '; WRITE ( 14 ) us |
---|
271 | WRITE ( 14 ) 'usws '; WRITE ( 14 ) usws |
---|
272 | WRITE ( 14 ) 'uswst '; WRITE ( 14 ) uswst |
---|
273 | IF ( ALLOCATED( us_av ) ) THEN |
---|
274 | WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av |
---|
275 | ENDIF |
---|
276 | WRITE ( 14 ) 'v '; WRITE ( 14 ) v |
---|
277 | IF ( ALLOCATED( v_av ) ) THEN |
---|
278 | WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av |
---|
279 | ENDIF |
---|
280 | IF ( ALLOCATED( v_m_l ) ) THEN |
---|
281 | WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l |
---|
282 | ENDIF |
---|
283 | IF ( ALLOCATED( v_m_n ) ) THEN |
---|
284 | WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n |
---|
285 | ENDIF |
---|
286 | IF ( ALLOCATED( v_m_r ) ) THEN |
---|
287 | WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r |
---|
288 | ENDIF |
---|
289 | IF ( ALLOCATED( v_m_s ) ) THEN |
---|
290 | WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s |
---|
291 | ENDIF |
---|
292 | IF ( humidity ) THEN |
---|
293 | WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt |
---|
294 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
295 | WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av |
---|
296 | ENDIF |
---|
297 | ENDIF |
---|
298 | WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws |
---|
299 | WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst |
---|
300 | WRITE ( 14 ) 'w '; WRITE ( 14 ) w |
---|
301 | IF ( ALLOCATED( w_av ) ) THEN |
---|
302 | WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av |
---|
303 | ENDIF |
---|
304 | IF ( ALLOCATED( w_m_l ) ) THEN |
---|
305 | WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l |
---|
306 | ENDIF |
---|
307 | IF ( ALLOCATED( w_m_n ) ) THEN |
---|
308 | WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n |
---|
309 | ENDIF |
---|
310 | IF ( ALLOCATED( w_m_r ) ) THEN |
---|
311 | WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r |
---|
312 | ENDIF |
---|
313 | IF ( ALLOCATED( w_m_s ) ) THEN |
---|
314 | WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s |
---|
315 | ENDIF |
---|
316 | WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 |
---|
317 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
318 | WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av |
---|
319 | ENDIF |
---|
320 | WRITE ( 14 ) 'z0h '; WRITE ( 14 ) z0h |
---|
321 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
322 | WRITE ( 14 ) 'z0h_av '; WRITE ( 14 ) z0h_av |
---|
323 | ENDIF |
---|
324 | |
---|
325 | ! |
---|
326 | !-- Write end label. Unit 14 is closed in the main program. |
---|
327 | WRITE ( 14 ) '*** end *** ' |
---|
328 | |
---|
329 | END SUBROUTINE write_3d_binary |
---|