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