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