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