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