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