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