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