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