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