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