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