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