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