1 | SUBROUTINE read_3d_binary |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Current revisions: |
---|
5 | ! ----------------- |
---|
6 | ! Output of messages replaced by message handling routine. |
---|
7 | ! |
---|
8 | ! |
---|
9 | ! Former revisions: |
---|
10 | ! ----------------- |
---|
11 | ! $Id: read_3d_binary.f90 277 2009-03-31 09:13:47Z letzel $ |
---|
12 | ! |
---|
13 | ! 220 2008-12-18 07:00:36Z raasch |
---|
14 | ! reading mechanism completely revised (subdomain/total domain size can vary |
---|
15 | ! arbitrarily between current and previous run) |
---|
16 | ! Bugfix: reading of spectrum_x|y from restart files ignored if total numbers |
---|
17 | ! of grid points do not match |
---|
18 | ! |
---|
19 | ! 150 2008-02-29 08:19:58Z raasch |
---|
20 | ! Files from which restart data are to be read are determined and subsequently |
---|
21 | ! opened. The total domain on the restart file is allowed to be smaller than |
---|
22 | ! the current total domain. In this case it will be periodically mapped on the |
---|
23 | ! current domain (needed for recycling method). |
---|
24 | ! +call of user_read_restart_data, -dopr_time_count, |
---|
25 | ! hom_sum, volume_flow_area, volume_flow_initial moved to read_var_list, |
---|
26 | ! reading of old profil parameters (cross_..., dopr_crossindex, profile_***) |
---|
27 | ! removed, initialization of spectrum_x|y removed |
---|
28 | ! |
---|
29 | ! 102 2007-07-27 09:09:17Z raasch |
---|
30 | ! +uswst, uswst_m, vswst, vswst_m |
---|
31 | ! |
---|
32 | ! 96 2007-06-04 08:07:41Z raasch |
---|
33 | ! +rho_av, sa, sa_av, saswsb, saswst |
---|
34 | ! |
---|
35 | ! 73 2007-03-20 08:33:14Z raasch |
---|
36 | ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., |
---|
37 | ! z0_av |
---|
38 | ! |
---|
39 | ! 19 2007-02-23 04:53:48Z raasch |
---|
40 | ! +qswst, qswst_m, tswst, tswst_m |
---|
41 | ! |
---|
42 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
43 | ! |
---|
44 | ! Revision 1.4 2006/08/04 15:02:32 raasch |
---|
45 | ! +iran, iran_part |
---|
46 | ! |
---|
47 | ! Revision 1.1 2004/04/30 12:47:27 raasch |
---|
48 | ! Initial revision |
---|
49 | ! |
---|
50 | ! |
---|
51 | ! Description: |
---|
52 | ! ------------ |
---|
53 | ! Binary input of variables and arrays from restart file |
---|
54 | !------------------------------------------------------------------------------! |
---|
55 | |
---|
56 | USE arrays_3d |
---|
57 | USE averaging |
---|
58 | USE cloud_parameters |
---|
59 | USE control_parameters |
---|
60 | USE cpulog |
---|
61 | USE indices |
---|
62 | USE interfaces |
---|
63 | USE particle_attributes |
---|
64 | USE pegrid |
---|
65 | USE profil_parameter |
---|
66 | USE random_function_mod |
---|
67 | USE statistics |
---|
68 | |
---|
69 | IMPLICIT NONE |
---|
70 | |
---|
71 | CHARACTER (LEN=5) :: myid_char_save |
---|
72 | CHARACTER (LEN=10) :: binary_version, version_on_file |
---|
73 | CHARACTER (LEN=20) :: field_chr |
---|
74 | |
---|
75 | INTEGER :: files_to_be_opened, i, j, k, myid_on_file, & |
---|
76 | numprocs_on_file, nxlc, nxlf, nxlpr, nxl_on_file, nxrc, nxrf, & |
---|
77 | nxrpr, nxr_on_file, nync, nynf, nynpr, nyn_on_file, nysc, & |
---|
78 | nysf, nyspr, nys_on_file, nzb_on_file, nzt_on_file, offset_x, & |
---|
79 | offset_y, shift_x, shift_y |
---|
80 | |
---|
81 | INTEGER, DIMENSION(numprocs_previous_run) :: file_list, overlap_count |
---|
82 | |
---|
83 | INTEGER, DIMENSION(numprocs_previous_run,1000) :: nxlfa, nxrfa, nynfa, & |
---|
84 | nysfa, offset_xa, & |
---|
85 | offset_ya |
---|
86 | REAL :: rdummy |
---|
87 | |
---|
88 | REAL, DIMENSION(:,:), ALLOCATABLE :: tmp_2d |
---|
89 | REAL, DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d, tmp_3dwul, tmp_3dwun, & |
---|
90 | tmp_3dwur, tmp_3dwus, tmp_3dwvl, & |
---|
91 | tmp_3dwvn, tmp_3dwvr, tmp_3dwvs, & |
---|
92 | tmp_3dwwl, tmp_3dwwn, tmp_3dwwr, & |
---|
93 | tmp_3dwws |
---|
94 | REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: tmp_4d |
---|
95 | |
---|
96 | |
---|
97 | ! |
---|
98 | !-- Read data from previous model run. |
---|
99 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'start' ) |
---|
100 | |
---|
101 | ! |
---|
102 | !-- Check which of the restart files contain data needed for the subdomain |
---|
103 | !-- of this PE |
---|
104 | files_to_be_opened = 0 |
---|
105 | |
---|
106 | DO i = 1, numprocs_previous_run |
---|
107 | ! |
---|
108 | !-- Store array bounds of the previous run ("pr") in temporary scalars |
---|
109 | nxlpr = hor_index_bounds_previous_run(1,i-1) |
---|
110 | nxrpr = hor_index_bounds_previous_run(2,i-1) |
---|
111 | nyspr = hor_index_bounds_previous_run(3,i-1) |
---|
112 | nynpr = hor_index_bounds_previous_run(4,i-1) |
---|
113 | |
---|
114 | ! |
---|
115 | !-- Determine the offsets. They may be non-zero in case that the total domain |
---|
116 | !-- on file is smaller than the current total domain. |
---|
117 | offset_x = ( nxl / ( nx_on_file + 1 ) ) * ( nx_on_file + 1 ) |
---|
118 | offset_y = ( nys / ( ny_on_file + 1 ) ) * ( ny_on_file + 1 ) |
---|
119 | |
---|
120 | ! |
---|
121 | !-- Start with this offset and then check, if the subdomain on file |
---|
122 | !-- matches another time(s) in the current subdomain by shifting it |
---|
123 | !-- for nx_on_file+1, ny_on_file+1 respectively |
---|
124 | |
---|
125 | shift_y = 0 |
---|
126 | j = 0 ! counter for the number of files to be opened |
---|
127 | |
---|
128 | DO WHILE ( nyspr+shift_y <= nyn-offset_y .AND. & |
---|
129 | nynpr+shift_y >= nys-offset_y ) |
---|
130 | |
---|
131 | shift_x = 0 |
---|
132 | |
---|
133 | DO WHILE ( nxlpr+shift_x <= nxr-offset_x .AND. & |
---|
134 | nxrpr+shift_x >= nxl-offset_x ) |
---|
135 | |
---|
136 | j = j +1 |
---|
137 | |
---|
138 | IF ( j > 1000 ) THEN |
---|
139 | ! |
---|
140 | !-- Array bound exceeded |
---|
141 | message_string = 'data from subdomain of previous' // & |
---|
142 | ' run mapped more than 1000 times' |
---|
143 | CALL message( 'read_3d_binary', 'PA0284', 2, 2, -1, 6, 1 ) |
---|
144 | |
---|
145 | ENDIF |
---|
146 | |
---|
147 | IF ( j == 1 ) THEN |
---|
148 | files_to_be_opened = files_to_be_opened + 1 |
---|
149 | file_list(files_to_be_opened) = i-1 |
---|
150 | ENDIF |
---|
151 | |
---|
152 | offset_xa(files_to_be_opened,j) = offset_x + shift_x |
---|
153 | offset_ya(files_to_be_opened,j) = offset_y + shift_y |
---|
154 | |
---|
155 | ! |
---|
156 | !-- Index bounds of overlapping data |
---|
157 | nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) |
---|
158 | nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) |
---|
159 | nysfa(files_to_be_opened,j) = MAX( nys-offset_y, nyspr ) |
---|
160 | nynfa(files_to_be_opened,j) = MIN( nyn-offset_y, nynpr ) |
---|
161 | |
---|
162 | shift_x = shift_x + ( nx_on_file + 1 ) |
---|
163 | |
---|
164 | ENDDO |
---|
165 | |
---|
166 | shift_y = shift_y + ( ny_on_file + 1 ) |
---|
167 | |
---|
168 | ENDDO |
---|
169 | |
---|
170 | IF ( j > 0 ) overlap_count(files_to_be_opened) = j |
---|
171 | |
---|
172 | ! |
---|
173 | !-- Test output, to be removed later |
---|
174 | IF ( j > 0 ) THEN |
---|
175 | WRITE (9,*) '*** reading from file: ', i, j, ' times' |
---|
176 | WRITE (9,*) ' nxl = ', nxl, ' nxr = ', nxr, ' nys = ', nys, ' nyn = ', nyn |
---|
177 | WRITE (9,*) ' ' |
---|
178 | DO k = 1, j |
---|
179 | WRITE (9,*) 'k = ', k |
---|
180 | WRITE (9,'(6(A,I2))') 'nxlfa = ', nxlfa(files_to_be_opened,k), & |
---|
181 | ' nxrfa = ', nxrfa(files_to_be_opened,k), & |
---|
182 | ' offset_xa = ', offset_xa(files_to_be_opened,k), & |
---|
183 | ' nysfa = ', nysfa(files_to_be_opened,k), & |
---|
184 | ' nynfa = ', nynfa(files_to_be_opened,k), & |
---|
185 | ' offset_ya = ', offset_ya(files_to_be_opened,k) |
---|
186 | ENDDO |
---|
187 | CALL local_flush( 9 ) |
---|
188 | ENDIF |
---|
189 | |
---|
190 | ENDDO |
---|
191 | |
---|
192 | ! |
---|
193 | !-- Save the id-string of the current process, since myid_char may now be used |
---|
194 | !-- to open files created by PEs with other id. |
---|
195 | myid_char_save = myid_char |
---|
196 | |
---|
197 | ! |
---|
198 | !-- Test output (remove later) |
---|
199 | DO i = 1, numprocs_previous_run |
---|
200 | WRITE (9,*) 'i=',i-1, ' ibs= ',hor_index_bounds_previous_run(1:4,i-1) |
---|
201 | ENDDO |
---|
202 | CALL local_flush( 9 ) |
---|
203 | |
---|
204 | IF ( files_to_be_opened /= 1 .OR. numprocs /= numprocs_previous_run ) & |
---|
205 | THEN |
---|
206 | WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed ', & |
---|
207 | 'in restart run& PE', myid, ' will read from files ', & |
---|
208 | file_list(1:files_to_be_opened) |
---|
209 | CALL message( 'read_3d_binary', 'PA0285', 0, 0, 0, 6, 0 ) |
---|
210 | ENDIF |
---|
211 | |
---|
212 | ! |
---|
213 | !-- Read data from all restart files determined above |
---|
214 | DO i = 1, files_to_be_opened |
---|
215 | |
---|
216 | j = file_list(i) |
---|
217 | ! |
---|
218 | !-- Set the filename (underscore followed by four digit processor id) |
---|
219 | WRITE (myid_char,'(''_'',I4.4)') j |
---|
220 | WRITE (9,*) 'myid=',myid,' opening file "',myid_char,'"' |
---|
221 | CALL local_flush( 9 ) |
---|
222 | |
---|
223 | ! |
---|
224 | !-- Open the restart file. If this file has been created by PE0 (_0000), |
---|
225 | !-- the global variables at the beginning of the file have to be skipped |
---|
226 | !-- first. |
---|
227 | CALL check_open( 13 ) |
---|
228 | WRITE (9,*) 'before skipping' |
---|
229 | CALL local_flush( 9 ) |
---|
230 | IF ( j == 0 ) CALL skip_var_list |
---|
231 | WRITE (9,*) 'skipping done' |
---|
232 | CALL local_flush( 9 ) |
---|
233 | |
---|
234 | ! |
---|
235 | !-- First compare the version numbers |
---|
236 | READ ( 13 ) version_on_file |
---|
237 | binary_version = '3.1' |
---|
238 | IF ( TRIM( version_on_file ) /= TRIM( binary_version ) ) THEN |
---|
239 | WRITE( message_string, * ) 'version mismatch concerning data ', & |
---|
240 | 'from prior run', & |
---|
241 | '&version on file = "', TRIM( version_on_file ), '"', & |
---|
242 | '&version in program = "', TRIM( binary_version ), '"' |
---|
243 | CALL message( 'read_3d_binary', 'PA0286', 1, 2, 0, 6, 0 ) |
---|
244 | ENDIF |
---|
245 | |
---|
246 | ! |
---|
247 | !-- Read number of processors, processor-id, and array ranges. |
---|
248 | !-- Compare the array ranges with those stored in the index bound array. |
---|
249 | READ ( 13 ) numprocs_on_file, myid_on_file, nxl_on_file, nxr_on_file, & |
---|
250 | nys_on_file, nyn_on_file, nzb_on_file, nzt_on_file |
---|
251 | |
---|
252 | IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) ) THEN |
---|
253 | WRITE( message_string, * ) 'problem with index bound nxl on ', & |
---|
254 | 'restart file "', myid_char, '"', & |
---|
255 | '&nxl = ', nxl_on_file, ' but it should be', & |
---|
256 | '&= ', hor_index_bounds_previous_run(1,j), & |
---|
257 | '&from the index bound information array' |
---|
258 | CALL message( 'read_3d_binary', 'PA0287', 2, 2, -1, 6, 1 ) |
---|
259 | ENDIF |
---|
260 | |
---|
261 | IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN |
---|
262 | WRITE( message_string, * ) 'problem with index bound nxr on ', & |
---|
263 | 'restart file "', myid_char, '"' , & |
---|
264 | '&nxr = ', nxr_on_file, ' but it should be', & |
---|
265 | '&= ', hor_index_bounds_previous_run(2,j), & |
---|
266 | '&from the index bound information array' |
---|
267 | CALL message( 'read_3d_binary', 'PA0288', 2, 2, -1, 6, 1 ) |
---|
268 | |
---|
269 | ENDIF |
---|
270 | |
---|
271 | IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN |
---|
272 | WRITE( message_string, * ) 'problem with index bound nys on ', & |
---|
273 | 'restart file "', myid_char, '"', & |
---|
274 | '&nys = ', nys_on_file, ' but it should be', & |
---|
275 | '&= ', hor_index_bounds_previous_run(3,j), & |
---|
276 | '&from the index bound information array' |
---|
277 | CALL message( 'read_3d_binary', 'PA0289', 2, 2, -1, 6, 1 ) |
---|
278 | ENDIF |
---|
279 | |
---|
280 | IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN |
---|
281 | WRITE( message_string, * ) 'problem with index bound nyn on ', & |
---|
282 | 'restart file "', myid_char, '"', & |
---|
283 | '&nyn = ', nyn_on_file, ' but it should be', & |
---|
284 | '&= ', hor_index_bounds_previous_run(4,j), & |
---|
285 | '&from the index bound information array' |
---|
286 | CALL message( 'read_3d_binary', 'PA0290', 2, 2, -1, 6, 1 ) |
---|
287 | ENDIF |
---|
288 | |
---|
289 | IF ( nzb_on_file /= nzb ) THEN |
---|
290 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
291 | '&from prior run on PE ', myid, & |
---|
292 | '&nzb on file = ', nzb_on_file, & |
---|
293 | '&nzb = ', nzb |
---|
294 | CALL message( 'read_3d_binary', 'PA0291', 1, 2, 0, 6, 0 ) |
---|
295 | ENDIF |
---|
296 | |
---|
297 | IF ( nzt_on_file /= nzt ) THEN |
---|
298 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
299 | '&from prior run on PE ', myid, & |
---|
300 | '&nzt on file = ', nzt_on_file, & |
---|
301 | '&nzt = ', nzt |
---|
302 | CALL message( 'read_3d_binary', 'PA0292', 1, 2, 0, 6, 0 ) |
---|
303 | ENDIF |
---|
304 | |
---|
305 | ! |
---|
306 | !-- Allocate temporary arrays sized as the arrays on the restart file |
---|
307 | ALLOCATE( tmp_2d(nys_on_file-1:nyn_on_file+1, & |
---|
308 | nxl_on_file-1:nxr_on_file+1), & |
---|
309 | tmp_3d(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & |
---|
310 | nxl_on_file-1:nxr_on_file+1) ) |
---|
311 | |
---|
312 | ! |
---|
313 | !-- Read arrays |
---|
314 | !-- ATTENTION: If the following read commands have been altered, the |
---|
315 | !-- ---------- version number of the variable binary_version must be altered, |
---|
316 | !-- too. Furthermore, the output list of arrays in write_3d_binary |
---|
317 | !-- must also be altered accordingly. |
---|
318 | READ ( 13 ) field_chr |
---|
319 | DO WHILE ( TRIM( field_chr ) /= '*** end ***' ) |
---|
320 | |
---|
321 | ! |
---|
322 | !-- Map data on file as often as needed (data are read only for k=1) |
---|
323 | DO k = 1, overlap_count(i) |
---|
324 | |
---|
325 | ! |
---|
326 | !-- Get the index range of the subdomain on file which overlap with the |
---|
327 | !-- current subdomain |
---|
328 | nxlf = nxlfa(i,k) |
---|
329 | nxlc = nxlfa(i,k) + offset_xa(i,k) |
---|
330 | nxrf = nxrfa(i,k) |
---|
331 | nxrc = nxrfa(i,k) + offset_xa(i,k) |
---|
332 | nysf = nysfa(i,k) |
---|
333 | nysc = nysfa(i,k) + offset_ya(i,k) |
---|
334 | nynf = nynfa(i,k) |
---|
335 | nync = nynfa(i,k) + offset_ya(i,k) |
---|
336 | |
---|
337 | |
---|
338 | WRITE (9,*) 'var = ', field_chr |
---|
339 | CALL local_flush( 9 ) |
---|
340 | |
---|
341 | SELECT CASE ( TRIM( field_chr ) ) |
---|
342 | |
---|
343 | CASE ( 'e' ) |
---|
344 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
345 | e(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
346 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
347 | |
---|
348 | CASE ( 'e_av' ) |
---|
349 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
350 | ALLOCATE( e_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
351 | ENDIF |
---|
352 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
353 | e_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
354 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
355 | |
---|
356 | CASE ( 'e_m' ) |
---|
357 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
358 | e_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
359 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
360 | |
---|
361 | CASE ( 'iran' ) ! matching random numbers is still unresolved |
---|
362 | ! issue |
---|
363 | IF ( k == 1 ) READ ( 13 ) iran, iran_part |
---|
364 | |
---|
365 | CASE ( 'kh' ) |
---|
366 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
367 | kh(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
368 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
369 | |
---|
370 | CASE ( 'kh_m' ) |
---|
371 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
372 | kh_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
373 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
374 | |
---|
375 | CASE ( 'km' ) |
---|
376 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
377 | km(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
378 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
379 | |
---|
380 | CASE ( 'km_m' ) |
---|
381 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
382 | km_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
383 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
384 | |
---|
385 | CASE ( 'lwp_av' ) |
---|
386 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
387 | ALLOCATE( lwp_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
388 | ENDIF |
---|
389 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
390 | lwp_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
391 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
392 | |
---|
393 | CASE ( 'p' ) |
---|
394 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
395 | p(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
396 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
397 | |
---|
398 | CASE ( 'p_av' ) |
---|
399 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
400 | ALLOCATE( p_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
401 | ENDIF |
---|
402 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
403 | p_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
404 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
405 | |
---|
406 | CASE ( 'pc_av' ) |
---|
407 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
408 | ALLOCATE( pc_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
409 | ENDIF |
---|
410 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
411 | pc_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
412 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
413 | |
---|
414 | CASE ( 'pr_av' ) |
---|
415 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
416 | ALLOCATE( pr_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
417 | ENDIF |
---|
418 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
419 | pr_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
420 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
421 | |
---|
422 | CASE ( 'precipitation_amount' ) |
---|
423 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
424 | precipitation_amount(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
425 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
426 | |
---|
427 | CASE ( 'precipitation_rate_a' ) |
---|
428 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
429 | ALLOCATE( precipitation_rate_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
430 | ENDIF |
---|
431 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
432 | precipitation_rate_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
433 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
434 | |
---|
435 | CASE ( 'pt' ) |
---|
436 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
437 | pt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
438 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
439 | |
---|
440 | CASE ( 'pt_av' ) |
---|
441 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
442 | ALLOCATE( pt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
443 | ENDIF |
---|
444 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
445 | pt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
446 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
447 | |
---|
448 | CASE ( 'pt_m' ) |
---|
449 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
450 | pt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
451 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
452 | |
---|
453 | CASE ( 'q' ) |
---|
454 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
455 | q(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
456 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
457 | |
---|
458 | CASE ( 'q_av' ) |
---|
459 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
460 | ALLOCATE( q_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
461 | ENDIF |
---|
462 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
463 | q_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
464 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
465 | |
---|
466 | CASE ( 'q_m' ) |
---|
467 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
468 | q_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
469 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
470 | |
---|
471 | CASE ( 'ql' ) |
---|
472 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
473 | ql(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
474 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
475 | |
---|
476 | CASE ( 'ql_av' ) |
---|
477 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
478 | ALLOCATE( ql_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
479 | ENDIF |
---|
480 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
481 | ql_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
482 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
483 | |
---|
484 | CASE ( 'ql_c_av' ) |
---|
485 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
486 | ALLOCATE( ql_c_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
487 | ENDIF |
---|
488 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
489 | ql_c_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
490 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
491 | |
---|
492 | CASE ( 'ql_v_av' ) |
---|
493 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
494 | ALLOCATE( ql_v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
495 | ENDIF |
---|
496 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
497 | ql_v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
498 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
499 | |
---|
500 | CASE ( 'ql_vp_av' ) |
---|
501 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
502 | ALLOCATE( ql_vp_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
503 | ENDIF |
---|
504 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
505 | ql_vp_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
506 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
507 | |
---|
508 | CASE ( 'qs' ) |
---|
509 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
510 | qs(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
511 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
512 | |
---|
513 | CASE ( 'qsws' ) |
---|
514 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
515 | qsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
516 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
517 | |
---|
518 | CASE ( 'qsws_m' ) |
---|
519 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
520 | qsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
521 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
522 | |
---|
523 | CASE ( 'qswst' ) |
---|
524 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
525 | qswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
526 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
527 | |
---|
528 | CASE ( 'qswst_m' ) |
---|
529 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
530 | qswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
531 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
532 | |
---|
533 | CASE ( 'qv_av' ) |
---|
534 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
535 | ALLOCATE( qv_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
536 | ENDIF |
---|
537 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
538 | qv_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
539 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
540 | |
---|
541 | CASE ( 'random_iv' ) ! still unresolved issue |
---|
542 | IF ( k == 1 ) READ ( 13 ) random_iv |
---|
543 | IF ( k == 1 ) READ ( 13 ) random_iy |
---|
544 | |
---|
545 | CASE ( 'rho_av' ) |
---|
546 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
547 | ALLOCATE( rho_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
548 | ENDIF |
---|
549 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
550 | rho_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
551 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
552 | |
---|
553 | CASE ( 'rif' ) |
---|
554 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
555 | rif(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
556 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
557 | |
---|
558 | CASE ( 'rif_m' ) |
---|
559 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
560 | rif_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
561 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
562 | |
---|
563 | CASE ( 'rif_wall' ) |
---|
564 | IF ( k == 1 ) THEN |
---|
565 | ALLOCATE( tmp_4d(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & |
---|
566 | nxl_on_file-1:nxr_on_file+1,1:4) ) |
---|
567 | READ ( 13 ) tmp_4d |
---|
568 | ENDIF |
---|
569 | rif_wall(:,nysc-1:nync+1,nxlc-1:nxrc+1,:) = & |
---|
570 | tmp_4d(:,nysf-1:nynf+1,nxlf-1:nxrf+1,:) |
---|
571 | |
---|
572 | CASE ( 's_av' ) |
---|
573 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
574 | ALLOCATE( s_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
575 | ENDIF |
---|
576 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
577 | s_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
578 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
579 | |
---|
580 | CASE ( 'sa' ) |
---|
581 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
582 | sa(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
583 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
584 | |
---|
585 | CASE ( 'sa_av' ) |
---|
586 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
587 | ALLOCATE( sa_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
588 | ENDIF |
---|
589 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
590 | sa_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
591 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
592 | |
---|
593 | CASE ( 'saswsb' ) |
---|
594 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
595 | saswsb(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
596 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
597 | |
---|
598 | CASE ( 'saswst' ) |
---|
599 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
600 | saswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
601 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
602 | |
---|
603 | CASE ( 'shf' ) |
---|
604 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
605 | shf(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
606 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
607 | |
---|
608 | CASE ( 'shf_m' ) |
---|
609 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
610 | shf_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
611 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
612 | |
---|
613 | CASE ( 'spectrum_x' ) |
---|
614 | IF ( k == 1 ) THEN |
---|
615 | IF ( nx_on_file /= nx ) THEN |
---|
616 | message_string = 'read_3d_binary: spectrum_x ' // & |
---|
617 | 'on restart file ignored because' // & |
---|
618 | '&total numbers of grid points (nx) ' // & |
---|
619 | 'do not match' |
---|
620 | CALL message( 'read_3d_binary', 'PA0293',& |
---|
621 | 0, 1, 0, 6, 0 ) |
---|
622 | READ ( 13 ) rdummy |
---|
623 | ELSE |
---|
624 | READ ( 13 ) spectrum_x |
---|
625 | ENDIF |
---|
626 | ENDIF |
---|
627 | |
---|
628 | CASE ( 'spectrum_y' ) |
---|
629 | IF ( k == 1 ) THEN |
---|
630 | IF ( ny_on_file /= ny ) THEN |
---|
631 | message_string = 'read_3d_binary: spectrum_y ' // & |
---|
632 | 'on restart file ignored because' // & |
---|
633 | '&total numbers of grid points (ny) '// & |
---|
634 | 'do not match' |
---|
635 | CALL message( 'read_3d_binary', 'PA0294', & |
---|
636 | 0, 1, 0, 6, 0 ) |
---|
637 | READ ( 13 ) rdummy |
---|
638 | ELSE |
---|
639 | READ ( 13 ) spectrum_y |
---|
640 | ENDIF |
---|
641 | ENDIF |
---|
642 | |
---|
643 | CASE ( 'ts' ) |
---|
644 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
645 | ts(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
646 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
647 | |
---|
648 | CASE ( 'ts_av' ) |
---|
649 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
650 | ALLOCATE( ts_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
651 | ENDIF |
---|
652 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
653 | ts_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
654 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
655 | |
---|
656 | CASE ( 'tswst' ) |
---|
657 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
658 | tswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
659 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
660 | |
---|
661 | CASE ( 'tswst_m' ) |
---|
662 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
663 | tswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
664 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
665 | |
---|
666 | CASE ( 'u' ) |
---|
667 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
668 | u(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
669 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
670 | |
---|
671 | CASE ( 'u_av' ) |
---|
672 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
673 | ALLOCATE( u_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
674 | ENDIF |
---|
675 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
676 | u_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
677 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
678 | |
---|
679 | CASE ( 'u_m' ) |
---|
680 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
681 | u_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
682 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
683 | |
---|
684 | CASE ( 'u_m_l' ) |
---|
685 | IF ( k == 1 ) THEN |
---|
686 | ALLOCATE( tmp_3dwul(nzb:nzt+1, & |
---|
687 | nys_on_file-1:nyn_on_file+1,1:2) ) |
---|
688 | READ ( 13 ) tmp_3dwul |
---|
689 | ENDIF |
---|
690 | IF ( outflow_l ) THEN |
---|
691 | u_m_l(:,nysc-1:nync+1,:) = tmp_3dwul(:,nysf-1:nynf+1,:) |
---|
692 | ENDIF |
---|
693 | |
---|
694 | CASE ( 'u_m_n' ) |
---|
695 | IF ( k == 1 ) THEN |
---|
696 | ALLOCATE( tmp_3dwun(nzb:nzt+1,ny-1:ny, & |
---|
697 | nxl_on_file-1:nxr_on_file+1) ) |
---|
698 | READ ( 13 ) tmp_3dwun |
---|
699 | ENDIF |
---|
700 | IF ( outflow_n ) THEN |
---|
701 | u_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwun(:,:,nxlf-1:nxrf+1) |
---|
702 | ENDIF |
---|
703 | |
---|
704 | CASE ( 'u_m_r' ) |
---|
705 | IF ( k == 1 ) THEN |
---|
706 | ALLOCATE( tmp_3dwur(nzb:nzt+1,& |
---|
707 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
708 | READ ( 13 ) tmp_3dwur |
---|
709 | ENDIF |
---|
710 | IF ( outflow_r ) THEN |
---|
711 | u_m_r(:,nysc-1:nync+1,:) = tmp_3dwur(:,nysf-1:nynf+1,:) |
---|
712 | ENDIF |
---|
713 | |
---|
714 | CASE ( 'u_m_s' ) |
---|
715 | IF ( k == 1 ) THEN |
---|
716 | ALLOCATE( tmp_3dwus(nzb:nzt+1,0:1, & |
---|
717 | nxl_on_file-1:nxr_on_file+1) ) |
---|
718 | READ ( 13 ) tmp_3dwus |
---|
719 | ENDIF |
---|
720 | IF ( outflow_s ) THEN |
---|
721 | u_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwus(:,:,nxlf-1:nxrf+1) |
---|
722 | ENDIF |
---|
723 | |
---|
724 | CASE ( 'us' ) |
---|
725 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
726 | us(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
727 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
728 | |
---|
729 | CASE ( 'usws' ) |
---|
730 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
731 | usws(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
732 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
733 | |
---|
734 | CASE ( 'uswst' ) |
---|
735 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
736 | uswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
737 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
738 | |
---|
739 | CASE ( 'usws_m' ) |
---|
740 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
741 | usws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
742 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
743 | |
---|
744 | CASE ( 'uswst_m' ) |
---|
745 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
746 | uswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
747 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
748 | |
---|
749 | CASE ( 'us_av' ) |
---|
750 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
751 | ALLOCATE( us_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
752 | ENDIF |
---|
753 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
754 | us_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
755 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
756 | |
---|
757 | CASE ( 'v' ) |
---|
758 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
759 | v(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
760 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
761 | |
---|
762 | CASE ( 'v_av' ) |
---|
763 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
764 | ALLOCATE( v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
765 | ENDIF |
---|
766 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
767 | v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
768 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
769 | |
---|
770 | CASE ( 'v_m' ) |
---|
771 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
772 | v_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
773 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
774 | |
---|
775 | CASE ( 'v_m_l' ) |
---|
776 | IF ( k == 1 ) THEN |
---|
777 | ALLOCATE( tmp_3dwvl(nzb:nzt+1,& |
---|
778 | nys_on_file-1:nyn_on_file+1,0:1) ) |
---|
779 | READ ( 13 ) tmp_3dwvl |
---|
780 | ENDIF |
---|
781 | IF ( outflow_l ) THEN |
---|
782 | v_m_l(:,nysc-1:nync+1,:) = tmp_3dwvl(:,nysf-1:nynf+1,:) |
---|
783 | ENDIF |
---|
784 | |
---|
785 | CASE ( 'v_m_n' ) |
---|
786 | IF ( k == 1 ) THEN |
---|
787 | ALLOCATE( tmp_3dwvn(nzb:nzt+1,ny-1:ny, & |
---|
788 | nxl_on_file-1:nxr_on_file+1) ) |
---|
789 | READ ( 13 ) tmp_3dwvn |
---|
790 | ENDIF |
---|
791 | IF ( outflow_n ) THEN |
---|
792 | v_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwvn(:,:,nxlf-1:nxrf+1) |
---|
793 | ENDIF |
---|
794 | |
---|
795 | CASE ( 'v_m_r' ) |
---|
796 | IF ( k == 1 ) THEN |
---|
797 | ALLOCATE( tmp_3dwvr(nzb:nzt+1,& |
---|
798 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
799 | READ ( 13 ) tmp_3dwvr |
---|
800 | ENDIF |
---|
801 | IF ( outflow_r ) THEN |
---|
802 | v_m_r(:,nysc-1:nync+1,:) = tmp_3dwvr(:,nysf-1:nynf+1,:) |
---|
803 | ENDIF |
---|
804 | |
---|
805 | CASE ( 'v_m_s' ) |
---|
806 | IF ( k == 1 ) THEN |
---|
807 | ALLOCATE( tmp_3dwvs(nzb:nzt+1,1:2, & |
---|
808 | nxl_on_file-1:nxr_on_file+1) ) |
---|
809 | READ ( 13 ) tmp_3dwvs |
---|
810 | ENDIF |
---|
811 | IF ( outflow_s ) THEN |
---|
812 | v_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwvs(:,:,nxlf-1:nxrf+1) |
---|
813 | ENDIF |
---|
814 | |
---|
815 | CASE ( 'vpt' ) |
---|
816 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
817 | vpt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
818 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
819 | |
---|
820 | CASE ( 'vpt_av' ) |
---|
821 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
822 | ALLOCATE( vpt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
823 | ENDIF |
---|
824 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
825 | vpt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
826 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
827 | |
---|
828 | CASE ( 'vpt_m' ) |
---|
829 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
830 | vpt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
831 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
832 | |
---|
833 | CASE ( 'vsws' ) |
---|
834 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
835 | vsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
836 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
837 | |
---|
838 | CASE ( 'vswst' ) |
---|
839 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
840 | vswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
841 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
842 | |
---|
843 | CASE ( 'vsws_m' ) |
---|
844 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
845 | vsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
846 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
847 | |
---|
848 | CASE ( 'vswst_m' ) |
---|
849 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
850 | vswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
851 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
852 | |
---|
853 | CASE ( 'w' ) |
---|
854 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
855 | w(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
856 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
857 | |
---|
858 | CASE ( 'w_av' ) |
---|
859 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
860 | ALLOCATE( w_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
861 | ENDIF |
---|
862 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
863 | w_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
864 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
865 | |
---|
866 | CASE ( 'w_m' ) |
---|
867 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
868 | w_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
869 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
870 | |
---|
871 | CASE ( 'w_m_l' ) |
---|
872 | IF ( k == 1 ) THEN |
---|
873 | ALLOCATE( tmp_3dwwl(nzb:nzt+1,& |
---|
874 | nys_on_file-1:nyn_on_file+1,0:1) ) |
---|
875 | READ ( 13 ) tmp_3dwwl |
---|
876 | ENDIF |
---|
877 | IF ( outflow_l ) THEN |
---|
878 | w_m_l(:,nysc-1:nync+1,:) = tmp_3dwwl(:,nysf-1:nynf+1,:) |
---|
879 | ENDIF |
---|
880 | |
---|
881 | CASE ( 'w_m_n' ) |
---|
882 | IF ( k == 1 ) THEN |
---|
883 | ALLOCATE( tmp_3dwwn(nzb:nzt+1,ny-1:ny, & |
---|
884 | nxl_on_file-1:nxr_on_file+1) ) |
---|
885 | READ ( 13 ) tmp_3dwwn |
---|
886 | ENDIF |
---|
887 | IF ( outflow_n ) THEN |
---|
888 | w_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwwn(:,:,nxlf-1:nxrf+1) |
---|
889 | ENDIF |
---|
890 | |
---|
891 | CASE ( 'w_m_r' ) |
---|
892 | IF ( k == 1 ) THEN |
---|
893 | ALLOCATE( tmp_3dwwr(nzb:nzt+1,& |
---|
894 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
895 | READ ( 13 ) tmp_3dwwr |
---|
896 | ENDIF |
---|
897 | IF ( outflow_r ) THEN |
---|
898 | w_m_r(:,nysc-1:nync+1,:) = tmp_3dwwr(:,nysf-1:nynf+1,:) |
---|
899 | ENDIF |
---|
900 | |
---|
901 | CASE ( 'w_m_s' ) |
---|
902 | IF ( k == 1 ) THEN |
---|
903 | ALLOCATE( tmp_3dwws(nzb:nzt+1,0:1, & |
---|
904 | nxl_on_file-1:nxr_on_file+1) ) |
---|
905 | READ ( 13 ) tmp_3dwws |
---|
906 | ENDIF |
---|
907 | IF ( outflow_s ) THEN |
---|
908 | w_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwws(:,:,nxlf-1:nxrf+1) |
---|
909 | ENDIF |
---|
910 | DEALLOCATE( tmp_3dwws ) |
---|
911 | |
---|
912 | CASE ( 'z0' ) |
---|
913 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
914 | z0(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
915 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
916 | |
---|
917 | CASE ( 'z0_av' ) |
---|
918 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
919 | ALLOCATE( z0_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
920 | ENDIF |
---|
921 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
922 | z0_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
923 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
924 | |
---|
925 | CASE DEFAULT |
---|
926 | WRITE( message_string, * ) 'unknown field named "', & |
---|
927 | TRIM( field_chr ), '" found in', & |
---|
928 | '&data from prior run on PE ',myid |
---|
929 | CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 ) |
---|
930 | |
---|
931 | END SELECT |
---|
932 | |
---|
933 | ENDDO ! overlap loop |
---|
934 | |
---|
935 | ! |
---|
936 | !-- Deallocate arrays needed for specific variables only |
---|
937 | IF ( ALLOCATED( tmp_3dwul ) ) DEALLOCATE( tmp_3dwul ) |
---|
938 | IF ( ALLOCATED( tmp_3dwun ) ) DEALLOCATE( tmp_3dwun ) |
---|
939 | IF ( ALLOCATED( tmp_3dwur ) ) DEALLOCATE( tmp_3dwur ) |
---|
940 | IF ( ALLOCATED( tmp_3dwus ) ) DEALLOCATE( tmp_3dwus ) |
---|
941 | IF ( ALLOCATED( tmp_3dwvl ) ) DEALLOCATE( tmp_3dwvl ) |
---|
942 | IF ( ALLOCATED( tmp_3dwvn ) ) DEALLOCATE( tmp_3dwvn ) |
---|
943 | IF ( ALLOCATED( tmp_3dwvr ) ) DEALLOCATE( tmp_3dwvr ) |
---|
944 | IF ( ALLOCATED( tmp_3dwvs ) ) DEALLOCATE( tmp_3dwvs ) |
---|
945 | IF ( ALLOCATED( tmp_3dwwl ) ) DEALLOCATE( tmp_3dwwl ) |
---|
946 | IF ( ALLOCATED( tmp_3dwwn ) ) DEALLOCATE( tmp_3dwwn ) |
---|
947 | IF ( ALLOCATED( tmp_3dwwr ) ) DEALLOCATE( tmp_3dwwr ) |
---|
948 | IF ( ALLOCATED( tmp_3dwws ) ) DEALLOCATE( tmp_3dwws ) |
---|
949 | IF ( ALLOCATED( tmp_4d ) ) DEALLOCATE( tmp_4d ) |
---|
950 | |
---|
951 | ! |
---|
952 | !-- Read next character string |
---|
953 | READ ( 13 ) field_chr |
---|
954 | |
---|
955 | ENDDO ! loop over variables |
---|
956 | |
---|
957 | ! |
---|
958 | !-- Read user-defined restart data |
---|
959 | CALL user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
960 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
961 | offset_xa, offset_ya, overlap_count(i), & |
---|
962 | tmp_2d, tmp_3d ) |
---|
963 | |
---|
964 | ! |
---|
965 | !-- Close the restart file |
---|
966 | CALL close_file( 13 ) |
---|
967 | |
---|
968 | DEALLOCATE( tmp_2d, tmp_3d ) |
---|
969 | |
---|
970 | ENDDO ! loop over restart files |
---|
971 | |
---|
972 | |
---|
973 | ! |
---|
974 | !-- Restore the original filename for the restart file to be written |
---|
975 | myid_char = myid_char_save |
---|
976 | |
---|
977 | |
---|
978 | ! |
---|
979 | !-- End of time measuring for reading binary data |
---|
980 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'stop' ) |
---|
981 | |
---|
982 | END SUBROUTINE read_3d_binary |
---|