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