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