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