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