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