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