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