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