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