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