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