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