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