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