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