[1] | 1 | SUBROUTINE read_3d_binary |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 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 | ! |
---|
| 17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
| 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[257] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[226] | 22 | ! |
---|
[1002] | 23 | ! |
---|
[226] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: read_3d_binary.f90 1037 2012-10-22 14:10:22Z raasch $ |
---|
| 27 | ! |
---|
[1037] | 28 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 29 | ! code put under GPL (PALM 3.9) |
---|
| 30 | ! |
---|
[1002] | 31 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
| 32 | ! all actions concerning leapfrog scheme removed |
---|
| 33 | ! |
---|
[979] | 34 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 35 | ! +z0h, z0h_av |
---|
| 36 | ! |
---|
[777] | 37 | ! 776 2011-10-31 08:02:51Z heinze |
---|
| 38 | ! bugfix: increase binary_version due to last commit |
---|
| 39 | ! |
---|
[772] | 40 | ! 771 2011-10-27 10:56:21Z heinze |
---|
| 41 | ! +lpt_av |
---|
| 42 | ! |
---|
[668] | 43 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
| 44 | ! +/- 1 replaced with +/- nbgp when swapping and allocating variables. |
---|
| 45 | ! Bugfix: When using initializing_actions = 'cyclic_fill' in some cases |
---|
| 46 | ! not the whole model domain was filled with data of the prerun. |
---|
| 47 | ! |
---|
[449] | 48 | ! 410 2009-12-04 17:05:40Z letzel |
---|
| 49 | ! format changed in test output from I2 to I4 |
---|
| 50 | ! |
---|
[392] | 51 | ! 367 2009-08-25 08:35:52Z maronga |
---|
| 52 | ! Output of messages replaced by message handling routine. |
---|
| 53 | ! +shf_av, qsws_av |
---|
| 54 | ! |
---|
[226] | 55 | ! 220 2008-12-18 07:00:36Z raasch |
---|
[216] | 56 | ! reading mechanism completely revised (subdomain/total domain size can vary |
---|
| 57 | ! arbitrarily between current and previous run) |
---|
| 58 | ! Bugfix: reading of spectrum_x|y from restart files ignored if total numbers |
---|
| 59 | ! of grid points do not match |
---|
[198] | 60 | ! |
---|
| 61 | ! 150 2008-02-29 08:19:58Z raasch |
---|
[146] | 62 | ! Files from which restart data are to be read are determined and subsequently |
---|
[147] | 63 | ! opened. The total domain on the restart file is allowed to be smaller than |
---|
| 64 | ! the current total domain. In this case it will be periodically mapped on the |
---|
| 65 | ! current domain (needed for recycling method). |
---|
[146] | 66 | ! +call of user_read_restart_data, -dopr_time_count, |
---|
[145] | 67 | ! hom_sum, volume_flow_area, volume_flow_initial moved to read_var_list, |
---|
[143] | 68 | ! reading of old profil parameters (cross_..., dopr_crossindex, profile_***) |
---|
[146] | 69 | ! removed, initialization of spectrum_x|y removed |
---|
[1] | 70 | ! |
---|
[110] | 71 | ! 102 2007-07-27 09:09:17Z raasch |
---|
| 72 | ! +uswst, uswst_m, vswst, vswst_m |
---|
| 73 | ! |
---|
[98] | 74 | ! 96 2007-06-04 08:07:41Z raasch |
---|
| 75 | ! +rho_av, sa, sa_av, saswsb, saswst |
---|
| 76 | ! |
---|
[77] | 77 | ! 73 2007-03-20 08:33:14Z raasch |
---|
| 78 | ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., |
---|
| 79 | ! z0_av |
---|
| 80 | ! |
---|
[39] | 81 | ! 19 2007-02-23 04:53:48Z raasch |
---|
[77] | 82 | ! +qswst, qswst_m, tswst, tswst_m |
---|
[39] | 83 | ! |
---|
[3] | 84 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 85 | ! |
---|
[1] | 86 | ! Revision 1.4 2006/08/04 15:02:32 raasch |
---|
| 87 | ! +iran, iran_part |
---|
| 88 | ! |
---|
| 89 | ! Revision 1.1 2004/04/30 12:47:27 raasch |
---|
| 90 | ! Initial revision |
---|
| 91 | ! |
---|
| 92 | ! |
---|
| 93 | ! Description: |
---|
| 94 | ! ------------ |
---|
| 95 | ! Binary input of variables and arrays from restart file |
---|
| 96 | !------------------------------------------------------------------------------! |
---|
| 97 | |
---|
| 98 | USE arrays_3d |
---|
| 99 | USE averaging |
---|
[72] | 100 | USE cloud_parameters |
---|
[1] | 101 | USE control_parameters |
---|
| 102 | USE cpulog |
---|
| 103 | USE indices |
---|
| 104 | USE interfaces |
---|
| 105 | USE particle_attributes |
---|
| 106 | USE pegrid |
---|
| 107 | USE profil_parameter |
---|
| 108 | USE random_function_mod |
---|
| 109 | USE statistics |
---|
| 110 | |
---|
| 111 | IMPLICIT NONE |
---|
| 112 | |
---|
[146] | 113 | CHARACTER (LEN=5) :: myid_char_save |
---|
[1] | 114 | CHARACTER (LEN=10) :: binary_version, version_on_file |
---|
| 115 | CHARACTER (LEN=20) :: field_chr |
---|
| 116 | |
---|
[216] | 117 | INTEGER :: files_to_be_opened, i, j, k, myid_on_file, & |
---|
[147] | 118 | numprocs_on_file, nxlc, nxlf, nxlpr, nxl_on_file, nxrc, nxrf, & |
---|
| 119 | nxrpr, nxr_on_file, nync, nynf, nynpr, nyn_on_file, nysc, & |
---|
| 120 | nysf, nyspr, nys_on_file, nzb_on_file, nzt_on_file, offset_x, & |
---|
[216] | 121 | offset_y, shift_x, shift_y |
---|
[1] | 122 | |
---|
[216] | 123 | INTEGER, DIMENSION(numprocs_previous_run) :: file_list, overlap_count |
---|
[146] | 124 | |
---|
[216] | 125 | INTEGER, DIMENSION(numprocs_previous_run,1000) :: nxlfa, nxrfa, nynfa, & |
---|
| 126 | nysfa, offset_xa, & |
---|
| 127 | offset_ya |
---|
| 128 | REAL :: rdummy |
---|
| 129 | |
---|
[146] | 130 | REAL, DIMENSION(:,:), ALLOCATABLE :: tmp_2d |
---|
[216] | 131 | REAL, DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d, tmp_3dwul, tmp_3dwun, & |
---|
| 132 | tmp_3dwur, tmp_3dwus, tmp_3dwvl, & |
---|
| 133 | tmp_3dwvn, tmp_3dwvr, tmp_3dwvs, & |
---|
| 134 | tmp_3dwwl, tmp_3dwwn, tmp_3dwwr, & |
---|
| 135 | tmp_3dwws |
---|
[146] | 136 | REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: tmp_4d |
---|
| 137 | |
---|
| 138 | |
---|
[1] | 139 | ! |
---|
[146] | 140 | !-- Read data from previous model run. |
---|
[1] | 141 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'start' ) |
---|
| 142 | |
---|
| 143 | ! |
---|
[146] | 144 | !-- Check which of the restart files contain data needed for the subdomain |
---|
| 145 | !-- of this PE |
---|
| 146 | files_to_be_opened = 0 |
---|
[143] | 147 | |
---|
[146] | 148 | DO i = 1, numprocs_previous_run |
---|
[216] | 149 | ! |
---|
| 150 | !-- Store array bounds of the previous run ("pr") in temporary scalars |
---|
[147] | 151 | nxlpr = hor_index_bounds_previous_run(1,i-1) |
---|
| 152 | nxrpr = hor_index_bounds_previous_run(2,i-1) |
---|
| 153 | nyspr = hor_index_bounds_previous_run(3,i-1) |
---|
| 154 | nynpr = hor_index_bounds_previous_run(4,i-1) |
---|
| 155 | |
---|
[143] | 156 | ! |
---|
[147] | 157 | !-- Determine the offsets. They may be non-zero in case that the total domain |
---|
| 158 | !-- on file is smaller than the current total domain. |
---|
| 159 | offset_x = ( nxl / ( nx_on_file + 1 ) ) * ( nx_on_file + 1 ) |
---|
| 160 | offset_y = ( nys / ( ny_on_file + 1 ) ) * ( ny_on_file + 1 ) |
---|
| 161 | |
---|
| 162 | ! |
---|
[216] | 163 | !-- Start with this offset and then check, if the subdomain on file |
---|
| 164 | !-- matches another time(s) in the current subdomain by shifting it |
---|
| 165 | !-- for nx_on_file+1, ny_on_file+1 respectively |
---|
[667] | 166 | |
---|
[216] | 167 | shift_y = 0 |
---|
[667] | 168 | j = 0 |
---|
| 169 | DO WHILE ( nyspr+shift_y <= nyn-offset_y ) |
---|
| 170 | |
---|
| 171 | IF ( nynpr+shift_y >= nys-offset_y ) THEN |
---|
[146] | 172 | |
---|
[667] | 173 | shift_x = 0 |
---|
| 174 | DO WHILE ( nxlpr+shift_x <= nxr-offset_x ) |
---|
| 175 | |
---|
| 176 | IF ( nxrpr+shift_x >= nxl-offset_x ) THEN |
---|
| 177 | j = j +1 |
---|
| 178 | IF ( j > 1000 ) THEN |
---|
[147] | 179 | ! |
---|
[667] | 180 | !-- Array bound exceeded |
---|
| 181 | message_string = 'data from subdomain of previous' // & |
---|
| 182 | ' run mapped more than 1000 times' |
---|
| 183 | CALL message( 'read_3d_binary', 'PA0284', 2, 2, -1, & |
---|
| 184 | 6, 1 ) |
---|
| 185 | ENDIF |
---|
[147] | 186 | |
---|
[667] | 187 | IF ( j == 1 ) THEN |
---|
| 188 | files_to_be_opened = files_to_be_opened + 1 |
---|
| 189 | file_list(files_to_be_opened) = i-1 |
---|
| 190 | ENDIF |
---|
| 191 | |
---|
| 192 | offset_xa(files_to_be_opened,j) = offset_x + shift_x |
---|
| 193 | offset_ya(files_to_be_opened,j) = offset_y + shift_y |
---|
[147] | 194 | ! |
---|
[667] | 195 | !-- Index bounds of overlapping data |
---|
| 196 | nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) |
---|
| 197 | nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) |
---|
| 198 | nysfa(files_to_be_opened,j) = MAX( nys-offset_y-shift_y, nyspr ) |
---|
| 199 | nynfa(files_to_be_opened,j) = MIN( nyn-offset_y-shift_y, nynpr ) |
---|
[147] | 200 | |
---|
[667] | 201 | ENDIF |
---|
[147] | 202 | |
---|
[667] | 203 | shift_x = shift_x + ( nx_on_file + 1 ) |
---|
| 204 | ENDDO |
---|
| 205 | |
---|
| 206 | ENDIF |
---|
| 207 | |
---|
| 208 | shift_y = shift_y + ( ny_on_file + 1 ) |
---|
[216] | 209 | ENDDO |
---|
[667] | 210 | |
---|
[216] | 211 | IF ( j > 0 ) overlap_count(files_to_be_opened) = j |
---|
[147] | 212 | |
---|
| 213 | ! |
---|
[216] | 214 | !-- Test output, to be removed later |
---|
| 215 | IF ( j > 0 ) THEN |
---|
| 216 | WRITE (9,*) '*** reading from file: ', i, j, ' times' |
---|
[667] | 217 | WRITE (9,*) ' nxl = ', nxl, ' nxr = ', nxr, ' nys = ', & |
---|
| 218 | nys, ' nyn = ', nyn |
---|
[216] | 219 | WRITE (9,*) ' ' |
---|
| 220 | DO k = 1, j |
---|
| 221 | WRITE (9,*) 'k = ', k |
---|
[667] | 222 | WRITE (9,'(6(A,I4))') 'nxlfa = ', nxlfa(files_to_be_opened,k),& |
---|
| 223 | ' nxrfa = ', nxrfa(files_to_be_opened,k), & |
---|
| 224 | ' offset_xa = ', offset_xa(files_to_be_opened,k), & |
---|
| 225 | ' nysfa = ', nysfa(files_to_be_opened,k), & |
---|
| 226 | ' nynfa = ', nynfa(files_to_be_opened,k), & |
---|
| 227 | ' offset_ya = ', offset_ya(files_to_be_opened,k) |
---|
[216] | 228 | ENDDO |
---|
[147] | 229 | CALL local_flush( 9 ) |
---|
| 230 | ENDIF |
---|
| 231 | |
---|
[667] | 232 | |
---|
[146] | 233 | ENDDO |
---|
[667] | 234 | |
---|
[147] | 235 | ! |
---|
| 236 | !-- Save the id-string of the current process, since myid_char may now be used |
---|
| 237 | !-- to open files created by PEs with other id. |
---|
[667] | 238 | myid_char_save = myid_char |
---|
[146] | 239 | |
---|
[147] | 240 | ! |
---|
| 241 | !-- Test output (remove later) |
---|
[667] | 242 | |
---|
[146] | 243 | DO i = 1, numprocs_previous_run |
---|
| 244 | WRITE (9,*) 'i=',i-1, ' ibs= ',hor_index_bounds_previous_run(1:4,i-1) |
---|
| 245 | ENDDO |
---|
| 246 | CALL local_flush( 9 ) |
---|
| 247 | |
---|
| 248 | IF ( files_to_be_opened /= 1 .OR. numprocs /= numprocs_previous_run ) & |
---|
| 249 | THEN |
---|
[274] | 250 | WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed ', & |
---|
| 251 | 'in restart run& PE', myid, ' will read from files ', & |
---|
| 252 | file_list(1:files_to_be_opened) |
---|
[257] | 253 | CALL message( 'read_3d_binary', 'PA0285', 0, 0, 0, 6, 0 ) |
---|
[1] | 254 | ENDIF |
---|
| 255 | |
---|
| 256 | ! |
---|
[146] | 257 | !-- Read data from all restart files determined above |
---|
| 258 | DO i = 1, files_to_be_opened |
---|
[1] | 259 | |
---|
[146] | 260 | j = file_list(i) |
---|
| 261 | ! |
---|
| 262 | !-- Set the filename (underscore followed by four digit processor id) |
---|
| 263 | WRITE (myid_char,'(''_'',I4.4)') j |
---|
| 264 | WRITE (9,*) 'myid=',myid,' opening file "',myid_char,'"' |
---|
| 265 | CALL local_flush( 9 ) |
---|
[1] | 266 | |
---|
[146] | 267 | ! |
---|
| 268 | !-- Open the restart file. If this file has been created by PE0 (_0000), |
---|
| 269 | !-- the global variables at the beginning of the file have to be skipped |
---|
| 270 | !-- first. |
---|
| 271 | CALL check_open( 13 ) |
---|
[147] | 272 | WRITE (9,*) 'before skipping' |
---|
| 273 | CALL local_flush( 9 ) |
---|
[146] | 274 | IF ( j == 0 ) CALL skip_var_list |
---|
[147] | 275 | WRITE (9,*) 'skipping done' |
---|
| 276 | CALL local_flush( 9 ) |
---|
[1] | 277 | |
---|
[146] | 278 | ! |
---|
| 279 | !-- First compare the version numbers |
---|
| 280 | READ ( 13 ) version_on_file |
---|
[776] | 281 | binary_version = '3.2' |
---|
[146] | 282 | IF ( TRIM( version_on_file ) /= TRIM( binary_version ) ) THEN |
---|
[274] | 283 | WRITE( message_string, * ) 'version mismatch concerning data ', & |
---|
| 284 | 'from prior run', & |
---|
| 285 | '&version on file = "', TRIM( version_on_file ), '"', & |
---|
| 286 | '&version in program = "', TRIM( binary_version ), '"' |
---|
[257] | 287 | CALL message( 'read_3d_binary', 'PA0286', 1, 2, 0, 6, 0 ) |
---|
[146] | 288 | ENDIF |
---|
| 289 | |
---|
| 290 | ! |
---|
| 291 | !-- Read number of processors, processor-id, and array ranges. |
---|
| 292 | !-- Compare the array ranges with those stored in the index bound array. |
---|
| 293 | READ ( 13 ) numprocs_on_file, myid_on_file, nxl_on_file, nxr_on_file, & |
---|
| 294 | nys_on_file, nyn_on_file, nzb_on_file, nzt_on_file |
---|
| 295 | |
---|
| 296 | IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) ) THEN |
---|
[274] | 297 | WRITE( message_string, * ) 'problem with index bound nxl on ', & |
---|
| 298 | 'restart file "', myid_char, '"', & |
---|
| 299 | '&nxl = ', nxl_on_file, ' but it should be', & |
---|
| 300 | '&= ', hor_index_bounds_previous_run(1,j), & |
---|
| 301 | '&from the index bound information array' |
---|
[277] | 302 | CALL message( 'read_3d_binary', 'PA0287', 2, 2, -1, 6, 1 ) |
---|
[146] | 303 | ENDIF |
---|
[1] | 304 | |
---|
[146] | 305 | IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN |
---|
[274] | 306 | WRITE( message_string, * ) 'problem with index bound nxr on ', & |
---|
| 307 | 'restart file "', myid_char, '"' , & |
---|
| 308 | '&nxr = ', nxr_on_file, ' but it should be', & |
---|
| 309 | '&= ', hor_index_bounds_previous_run(2,j), & |
---|
| 310 | '&from the index bound information array' |
---|
[277] | 311 | CALL message( 'read_3d_binary', 'PA0288', 2, 2, -1, 6, 1 ) |
---|
[257] | 312 | |
---|
[146] | 313 | ENDIF |
---|
[1] | 314 | |
---|
[146] | 315 | IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN |
---|
[274] | 316 | WRITE( message_string, * ) 'problem with index bound nys on ', & |
---|
| 317 | 'restart file "', myid_char, '"', & |
---|
| 318 | '&nys = ', nys_on_file, ' but it should be', & |
---|
| 319 | '&= ', hor_index_bounds_previous_run(3,j), & |
---|
[257] | 320 | '&from the index bound information array' |
---|
[277] | 321 | CALL message( 'read_3d_binary', 'PA0289', 2, 2, -1, 6, 1 ) |
---|
[146] | 322 | ENDIF |
---|
[1] | 323 | |
---|
[146] | 324 | IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN |
---|
[274] | 325 | WRITE( message_string, * ) 'problem with index bound nyn on ', & |
---|
| 326 | 'restart file "', myid_char, '"', & |
---|
| 327 | '&nyn = ', nyn_on_file, ' but it should be', & |
---|
| 328 | '&= ', hor_index_bounds_previous_run(4,j), & |
---|
| 329 | '&from the index bound information array' |
---|
[277] | 330 | CALL message( 'read_3d_binary', 'PA0290', 2, 2, -1, 6, 1 ) |
---|
[146] | 331 | ENDIF |
---|
[1] | 332 | |
---|
[146] | 333 | IF ( nzb_on_file /= nzb ) THEN |
---|
[257] | 334 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
| 335 | '&from prior run on PE ', myid, & |
---|
| 336 | '&nzb on file = ', nzb_on_file, & |
---|
| 337 | '&nzb = ', nzb |
---|
| 338 | CALL message( 'read_3d_binary', 'PA0291', 1, 2, 0, 6, 0 ) |
---|
[146] | 339 | ENDIF |
---|
[1] | 340 | |
---|
[146] | 341 | IF ( nzt_on_file /= nzt ) THEN |
---|
[257] | 342 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
| 343 | '&from prior run on PE ', myid, & |
---|
| 344 | '&nzt on file = ', nzt_on_file, & |
---|
| 345 | '&nzt = ', nzt |
---|
| 346 | CALL message( 'read_3d_binary', 'PA0292', 1, 2, 0, 6, 0 ) |
---|
[146] | 347 | ENDIF |
---|
[1] | 348 | |
---|
| 349 | ! |
---|
[146] | 350 | !-- Allocate temporary arrays sized as the arrays on the restart file |
---|
[667] | 351 | ALLOCATE( tmp_2d(nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 352 | nxl_on_file-nbgp:nxr_on_file+nbgp), & |
---|
| 353 | tmp_3d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 354 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[1] | 355 | |
---|
| 356 | ! |
---|
[146] | 357 | !-- Read arrays |
---|
| 358 | !-- ATTENTION: If the following read commands have been altered, the |
---|
| 359 | !-- ---------- version number of the variable binary_version must be altered, |
---|
| 360 | !-- too. Furthermore, the output list of arrays in write_3d_binary |
---|
| 361 | !-- must also be altered accordingly. |
---|
| 362 | READ ( 13 ) field_chr |
---|
| 363 | DO WHILE ( TRIM( field_chr ) /= '*** end ***' ) |
---|
[1] | 364 | |
---|
[216] | 365 | ! |
---|
| 366 | !-- Map data on file as often as needed (data are read only for k=1) |
---|
| 367 | DO k = 1, overlap_count(i) |
---|
[1] | 368 | |
---|
[216] | 369 | ! |
---|
| 370 | !-- Get the index range of the subdomain on file which overlap with the |
---|
| 371 | !-- current subdomain |
---|
| 372 | nxlf = nxlfa(i,k) |
---|
| 373 | nxlc = nxlfa(i,k) + offset_xa(i,k) |
---|
| 374 | nxrf = nxrfa(i,k) |
---|
| 375 | nxrc = nxrfa(i,k) + offset_xa(i,k) |
---|
| 376 | nysf = nysfa(i,k) |
---|
| 377 | nysc = nysfa(i,k) + offset_ya(i,k) |
---|
| 378 | nynf = nynfa(i,k) |
---|
| 379 | nync = nynfa(i,k) + offset_ya(i,k) |
---|
| 380 | |
---|
| 381 | |
---|
| 382 | WRITE (9,*) 'var = ', field_chr |
---|
| 383 | CALL local_flush( 9 ) |
---|
| 384 | |
---|
| 385 | SELECT CASE ( TRIM( field_chr ) ) |
---|
| 386 | |
---|
| 387 | CASE ( 'e' ) |
---|
| 388 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 389 | e(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 390 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1] | 391 | |
---|
[216] | 392 | CASE ( 'e_av' ) |
---|
| 393 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 394 | ALLOCATE( e_av(nzb:nzt+1,nys-nbgp:nyn+nbgp,nxl-nbgp:nxr+nbgp) ) |
---|
[216] | 395 | ENDIF |
---|
| 396 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 397 | e_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 398 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 399 | |
---|
[216] | 400 | CASE ( 'iran' ) ! matching random numbers is still unresolved |
---|
| 401 | ! issue |
---|
| 402 | IF ( k == 1 ) READ ( 13 ) iran, iran_part |
---|
[146] | 403 | |
---|
[216] | 404 | CASE ( 'kh' ) |
---|
| 405 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 406 | kh(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 407 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 408 | |
---|
[216] | 409 | CASE ( 'km' ) |
---|
| 410 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 411 | km(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 412 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 413 | |
---|
[771] | 414 | CASE ( 'lpt_av' ) |
---|
| 415 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 416 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) |
---|
| 417 | ENDIF |
---|
| 418 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 419 | lpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 420 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 421 | |
---|
[216] | 422 | CASE ( 'lwp_av' ) |
---|
| 423 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 424 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 425 | ENDIF |
---|
| 426 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 427 | lwp_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 428 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 429 | |
---|
[216] | 430 | CASE ( 'p' ) |
---|
| 431 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 432 | p(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 433 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 434 | |
---|
[216] | 435 | CASE ( 'p_av' ) |
---|
| 436 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 437 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 438 | ENDIF |
---|
| 439 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 440 | p_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 441 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 442 | |
---|
[216] | 443 | CASE ( 'pc_av' ) |
---|
| 444 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 445 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 446 | ENDIF |
---|
| 447 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 448 | pc_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 449 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 450 | |
---|
[216] | 451 | CASE ( 'pr_av' ) |
---|
| 452 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 453 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 454 | ENDIF |
---|
| 455 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 456 | pr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 457 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 458 | |
---|
[216] | 459 | CASE ( 'precipitation_amount' ) |
---|
| 460 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 461 | precipitation_amount(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 462 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 463 | |
---|
[216] | 464 | CASE ( 'precipitation_rate_a' ) |
---|
| 465 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
[667] | 466 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 467 | ENDIF |
---|
| 468 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 469 | precipitation_rate_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 470 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 471 | |
---|
[216] | 472 | CASE ( 'pt' ) |
---|
| 473 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 474 | pt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 475 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 476 | |
---|
[216] | 477 | CASE ( 'pt_av' ) |
---|
| 478 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 479 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 480 | ENDIF |
---|
| 481 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 482 | pt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 483 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 484 | |
---|
[216] | 485 | CASE ( 'q' ) |
---|
| 486 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 487 | q(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 488 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 489 | |
---|
[216] | 490 | CASE ( 'q_av' ) |
---|
| 491 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 492 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) |
---|
[216] | 493 | ENDIF |
---|
| 494 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 495 | q_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 496 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 497 | |
---|
[216] | 498 | CASE ( 'ql' ) |
---|
| 499 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 500 | ql(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 501 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 502 | |
---|
[216] | 503 | CASE ( 'ql_av' ) |
---|
| 504 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 505 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 506 | ENDIF |
---|
| 507 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 508 | ql_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 509 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 510 | |
---|
[216] | 511 | CASE ( 'ql_c_av' ) |
---|
| 512 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 513 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 514 | ENDIF |
---|
| 515 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 516 | ql_c_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 517 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 518 | |
---|
[216] | 519 | CASE ( 'ql_v_av' ) |
---|
| 520 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 521 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 522 | ENDIF |
---|
| 523 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 524 | ql_v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 525 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 526 | |
---|
[216] | 527 | CASE ( 'ql_vp_av' ) |
---|
| 528 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 529 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 530 | ENDIF |
---|
| 531 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 532 | ql_vp_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 533 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 534 | |
---|
[216] | 535 | CASE ( 'qs' ) |
---|
| 536 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 537 | qs(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 538 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 539 | |
---|
[216] | 540 | CASE ( 'qsws' ) |
---|
| 541 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 542 | qsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 543 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 544 | |
---|
[354] | 545 | CASE ( 'qsws_av' ) |
---|
| 546 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 547 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 548 | ENDIF |
---|
| 549 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 550 | qsws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 551 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[354] | 552 | |
---|
[216] | 553 | CASE ( 'qswst' ) |
---|
| 554 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 555 | qswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 556 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 557 | |
---|
[216] | 558 | CASE ( 'qv_av' ) |
---|
| 559 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 560 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 561 | ENDIF |
---|
| 562 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 563 | qv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 564 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 565 | |
---|
[216] | 566 | CASE ( 'random_iv' ) ! still unresolved issue |
---|
| 567 | IF ( k == 1 ) READ ( 13 ) random_iv |
---|
| 568 | IF ( k == 1 ) READ ( 13 ) random_iy |
---|
[146] | 569 | |
---|
[216] | 570 | CASE ( 'rho_av' ) |
---|
| 571 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
[667] | 572 | ALLOCATE( rho_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 573 | ENDIF |
---|
| 574 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 575 | rho_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 576 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 577 | |
---|
[216] | 578 | CASE ( 'rif' ) |
---|
| 579 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 580 | rif(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 581 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 582 | |
---|
[216] | 583 | CASE ( 'rif_wall' ) |
---|
| 584 | IF ( k == 1 ) THEN |
---|
[667] | 585 | ALLOCATE( tmp_4d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 586 | nxl_on_file-nbgp:nxr_on_file+nbgp,1:4) ) |
---|
[216] | 587 | READ ( 13 ) tmp_4d |
---|
| 588 | ENDIF |
---|
[667] | 589 | rif_wall(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp,:) = & |
---|
| 590 | tmp_4d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp,:) |
---|
[146] | 591 | |
---|
[216] | 592 | CASE ( 's_av' ) |
---|
| 593 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 594 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) |
---|
[216] | 595 | ENDIF |
---|
| 596 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 597 | s_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 ( 'sa' ) |
---|
| 601 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 602 | sa(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 603 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 604 | |
---|
[216] | 605 | CASE ( 'sa_av' ) |
---|
| 606 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
[667] | 607 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 608 | ENDIF |
---|
| 609 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 610 | sa_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 611 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 612 | |
---|
[216] | 613 | CASE ( 'saswsb' ) |
---|
| 614 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 615 | saswsb(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 616 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 617 | |
---|
[216] | 618 | CASE ( 'saswst' ) |
---|
| 619 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 620 | saswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 621 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 622 | |
---|
[216] | 623 | CASE ( 'shf' ) |
---|
| 624 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 625 | shf(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 626 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 627 | |
---|
[354] | 628 | CASE ( 'shf_av' ) |
---|
| 629 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 630 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 631 | ENDIF |
---|
| 632 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 633 | shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 634 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1001] | 635 | |
---|
[216] | 636 | CASE ( 'spectrum_x' ) |
---|
| 637 | IF ( k == 1 ) THEN |
---|
| 638 | IF ( nx_on_file /= nx ) THEN |
---|
[274] | 639 | message_string = 'read_3d_binary: spectrum_x ' // & |
---|
| 640 | 'on restart file ignored because' // & |
---|
| 641 | '&total numbers of grid points (nx) ' // & |
---|
| 642 | 'do not match' |
---|
| 643 | CALL message( 'read_3d_binary', 'PA0293',& |
---|
| 644 | 0, 1, 0, 6, 0 ) |
---|
[216] | 645 | READ ( 13 ) rdummy |
---|
| 646 | ELSE |
---|
| 647 | READ ( 13 ) spectrum_x |
---|
| 648 | ENDIF |
---|
| 649 | ENDIF |
---|
[146] | 650 | |
---|
[216] | 651 | CASE ( 'spectrum_y' ) |
---|
| 652 | IF ( k == 1 ) THEN |
---|
| 653 | IF ( ny_on_file /= ny ) THEN |
---|
[274] | 654 | message_string = 'read_3d_binary: spectrum_y ' // & |
---|
| 655 | 'on restart file ignored because' // & |
---|
| 656 | '&total numbers of grid points (ny) '// & |
---|
| 657 | 'do not match' |
---|
| 658 | CALL message( 'read_3d_binary', 'PA0294', & |
---|
| 659 | 0, 1, 0, 6, 0 ) |
---|
| 660 | READ ( 13 ) rdummy |
---|
[216] | 661 | ELSE |
---|
| 662 | READ ( 13 ) spectrum_y |
---|
| 663 | ENDIF |
---|
| 664 | ENDIF |
---|
[146] | 665 | |
---|
[216] | 666 | CASE ( 'ts' ) |
---|
| 667 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 668 | ts(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 669 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 670 | |
---|
[216] | 671 | CASE ( 'ts_av' ) |
---|
| 672 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 673 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 674 | ENDIF |
---|
| 675 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 676 | ts_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 677 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 678 | |
---|
[216] | 679 | CASE ( 'tswst' ) |
---|
| 680 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 681 | tswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 682 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 683 | |
---|
[216] | 684 | CASE ( 'u' ) |
---|
| 685 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 686 | u(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 687 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 688 | |
---|
[216] | 689 | CASE ( 'u_av' ) |
---|
| 690 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 691 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 692 | ENDIF |
---|
| 693 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 694 | u_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 695 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 696 | |
---|
[216] | 697 | CASE ( 'u_m_l' ) |
---|
| 698 | IF ( k == 1 ) THEN |
---|
| 699 | ALLOCATE( tmp_3dwul(nzb:nzt+1, & |
---|
[667] | 700 | nys_on_file-nbgp:nyn_on_file+nbgp,1:2) ) |
---|
[216] | 701 | READ ( 13 ) tmp_3dwul |
---|
| 702 | ENDIF |
---|
| 703 | IF ( outflow_l ) THEN |
---|
[667] | 704 | u_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwul(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 705 | ENDIF |
---|
[146] | 706 | |
---|
[216] | 707 | CASE ( 'u_m_n' ) |
---|
| 708 | IF ( k == 1 ) THEN |
---|
| 709 | ALLOCATE( tmp_3dwun(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 710 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 711 | READ ( 13 ) tmp_3dwun |
---|
| 712 | ENDIF |
---|
| 713 | IF ( outflow_n ) THEN |
---|
[667] | 714 | u_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwun(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 715 | ENDIF |
---|
[146] | 716 | |
---|
[216] | 717 | CASE ( 'u_m_r' ) |
---|
| 718 | IF ( k == 1 ) THEN |
---|
| 719 | ALLOCATE( tmp_3dwur(nzb:nzt+1,& |
---|
[667] | 720 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 721 | READ ( 13 ) tmp_3dwur |
---|
| 722 | ENDIF |
---|
| 723 | IF ( outflow_r ) THEN |
---|
[667] | 724 | u_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwur(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 725 | ENDIF |
---|
[146] | 726 | |
---|
[216] | 727 | CASE ( 'u_m_s' ) |
---|
| 728 | IF ( k == 1 ) THEN |
---|
| 729 | ALLOCATE( tmp_3dwus(nzb:nzt+1,0:1, & |
---|
[667] | 730 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 731 | READ ( 13 ) tmp_3dwus |
---|
| 732 | ENDIF |
---|
| 733 | IF ( outflow_s ) THEN |
---|
[667] | 734 | u_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwus(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 735 | ENDIF |
---|
[146] | 736 | |
---|
[216] | 737 | CASE ( 'us' ) |
---|
| 738 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 739 | us(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 740 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 741 | |
---|
[216] | 742 | CASE ( 'usws' ) |
---|
| 743 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 744 | usws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 745 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 746 | |
---|
[216] | 747 | CASE ( 'uswst' ) |
---|
| 748 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 749 | uswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 750 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 751 | |
---|
[216] | 752 | CASE ( 'us_av' ) |
---|
| 753 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 754 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 755 | ENDIF |
---|
| 756 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 757 | us_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 758 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 759 | |
---|
[216] | 760 | CASE ( 'v' ) |
---|
| 761 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 762 | v(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 763 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 764 | |
---|
[216] | 765 | CASE ( 'v_av' ) |
---|
| 766 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 767 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 768 | ENDIF |
---|
| 769 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 770 | v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 771 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 772 | |
---|
[216] | 773 | CASE ( 'v_m_l' ) |
---|
| 774 | IF ( k == 1 ) THEN |
---|
| 775 | ALLOCATE( tmp_3dwvl(nzb:nzt+1,& |
---|
[667] | 776 | nys_on_file-nbgp:nyn_on_file+nbgp,0:1) ) |
---|
[216] | 777 | READ ( 13 ) tmp_3dwvl |
---|
| 778 | ENDIF |
---|
| 779 | IF ( outflow_l ) THEN |
---|
[667] | 780 | v_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwvl(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 781 | ENDIF |
---|
[146] | 782 | |
---|
[216] | 783 | CASE ( 'v_m_n' ) |
---|
| 784 | IF ( k == 1 ) THEN |
---|
| 785 | ALLOCATE( tmp_3dwvn(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 786 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 787 | READ ( 13 ) tmp_3dwvn |
---|
| 788 | ENDIF |
---|
| 789 | IF ( outflow_n ) THEN |
---|
[667] | 790 | v_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwvn(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 791 | ENDIF |
---|
[146] | 792 | |
---|
[216] | 793 | CASE ( 'v_m_r' ) |
---|
| 794 | IF ( k == 1 ) THEN |
---|
| 795 | ALLOCATE( tmp_3dwvr(nzb:nzt+1,& |
---|
[667] | 796 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 797 | READ ( 13 ) tmp_3dwvr |
---|
| 798 | ENDIF |
---|
| 799 | IF ( outflow_r ) THEN |
---|
[667] | 800 | v_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwvr(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 801 | ENDIF |
---|
[146] | 802 | |
---|
[216] | 803 | CASE ( 'v_m_s' ) |
---|
| 804 | IF ( k == 1 ) THEN |
---|
| 805 | ALLOCATE( tmp_3dwvs(nzb:nzt+1,1:2, & |
---|
[667] | 806 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 807 | READ ( 13 ) tmp_3dwvs |
---|
| 808 | ENDIF |
---|
| 809 | IF ( outflow_s ) THEN |
---|
[667] | 810 | v_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwvs(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 811 | ENDIF |
---|
[146] | 812 | |
---|
[216] | 813 | CASE ( 'vpt' ) |
---|
| 814 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 815 | vpt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 816 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 817 | |
---|
[216] | 818 | CASE ( 'vpt_av' ) |
---|
| 819 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 820 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 821 | ENDIF |
---|
| 822 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 823 | vpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 824 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 825 | |
---|
[216] | 826 | CASE ( 'vsws' ) |
---|
| 827 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 828 | vsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 829 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 830 | |
---|
[216] | 831 | CASE ( 'vswst' ) |
---|
| 832 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 833 | vswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 834 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 835 | |
---|
[216] | 836 | CASE ( 'w' ) |
---|
| 837 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 838 | w(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 839 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 840 | |
---|
[216] | 841 | CASE ( 'w_av' ) |
---|
| 842 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 843 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 844 | ENDIF |
---|
| 845 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 846 | w_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 847 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 848 | |
---|
[216] | 849 | CASE ( 'w_m_l' ) |
---|
| 850 | IF ( k == 1 ) THEN |
---|
| 851 | ALLOCATE( tmp_3dwwl(nzb:nzt+1,& |
---|
[667] | 852 | nys_on_file-nbgp:nyn_on_file+nbgp,0:1) ) |
---|
[216] | 853 | READ ( 13 ) tmp_3dwwl |
---|
| 854 | ENDIF |
---|
| 855 | IF ( outflow_l ) THEN |
---|
[667] | 856 | w_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwwl(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 857 | ENDIF |
---|
[146] | 858 | |
---|
[216] | 859 | CASE ( 'w_m_n' ) |
---|
| 860 | IF ( k == 1 ) THEN |
---|
| 861 | ALLOCATE( tmp_3dwwn(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 862 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 863 | READ ( 13 ) tmp_3dwwn |
---|
| 864 | ENDIF |
---|
| 865 | IF ( outflow_n ) THEN |
---|
[667] | 866 | w_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwwn(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 867 | ENDIF |
---|
[146] | 868 | |
---|
[216] | 869 | CASE ( 'w_m_r' ) |
---|
| 870 | IF ( k == 1 ) THEN |
---|
| 871 | ALLOCATE( tmp_3dwwr(nzb:nzt+1,& |
---|
[667] | 872 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 873 | READ ( 13 ) tmp_3dwwr |
---|
| 874 | ENDIF |
---|
| 875 | IF ( outflow_r ) THEN |
---|
[667] | 876 | w_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwwr(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 877 | ENDIF |
---|
[146] | 878 | |
---|
[216] | 879 | CASE ( 'w_m_s' ) |
---|
| 880 | IF ( k == 1 ) THEN |
---|
| 881 | ALLOCATE( tmp_3dwws(nzb:nzt+1,0:1, & |
---|
[667] | 882 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 883 | READ ( 13 ) tmp_3dwws |
---|
| 884 | ENDIF |
---|
| 885 | IF ( outflow_s ) THEN |
---|
[667] | 886 | w_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwws(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 887 | ENDIF |
---|
| 888 | DEALLOCATE( tmp_3dwws ) |
---|
[146] | 889 | |
---|
[216] | 890 | CASE ( 'z0' ) |
---|
| 891 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 892 | z0(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 893 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 894 | |
---|
[216] | 895 | CASE ( 'z0_av' ) |
---|
| 896 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 897 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 898 | ENDIF |
---|
| 899 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 900 | z0_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 901 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 902 | |
---|
[978] | 903 | CASE ( 'z0h' ) |
---|
| 904 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 905 | z0h(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 906 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 907 | |
---|
| 908 | CASE ( 'z0h_av' ) |
---|
| 909 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 910 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 911 | ENDIF |
---|
| 912 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 913 | z0h_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 914 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 915 | |
---|
[216] | 916 | CASE DEFAULT |
---|
[257] | 917 | WRITE( message_string, * ) 'unknown field named "', & |
---|
| 918 | TRIM( field_chr ), '" found in', & |
---|
| 919 | '&data from prior run on PE ',myid |
---|
| 920 | CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 ) |
---|
| 921 | |
---|
[216] | 922 | END SELECT |
---|
| 923 | |
---|
| 924 | ENDDO ! overlap loop |
---|
| 925 | |
---|
[1] | 926 | ! |
---|
[216] | 927 | !-- Deallocate arrays needed for specific variables only |
---|
| 928 | IF ( ALLOCATED( tmp_3dwul ) ) DEALLOCATE( tmp_3dwul ) |
---|
| 929 | IF ( ALLOCATED( tmp_3dwun ) ) DEALLOCATE( tmp_3dwun ) |
---|
| 930 | IF ( ALLOCATED( tmp_3dwur ) ) DEALLOCATE( tmp_3dwur ) |
---|
| 931 | IF ( ALLOCATED( tmp_3dwus ) ) DEALLOCATE( tmp_3dwus ) |
---|
| 932 | IF ( ALLOCATED( tmp_3dwvl ) ) DEALLOCATE( tmp_3dwvl ) |
---|
| 933 | IF ( ALLOCATED( tmp_3dwvn ) ) DEALLOCATE( tmp_3dwvn ) |
---|
| 934 | IF ( ALLOCATED( tmp_3dwvr ) ) DEALLOCATE( tmp_3dwvr ) |
---|
| 935 | IF ( ALLOCATED( tmp_3dwvs ) ) DEALLOCATE( tmp_3dwvs ) |
---|
| 936 | IF ( ALLOCATED( tmp_3dwwl ) ) DEALLOCATE( tmp_3dwwl ) |
---|
| 937 | IF ( ALLOCATED( tmp_3dwwn ) ) DEALLOCATE( tmp_3dwwn ) |
---|
| 938 | IF ( ALLOCATED( tmp_3dwwr ) ) DEALLOCATE( tmp_3dwwr ) |
---|
| 939 | IF ( ALLOCATED( tmp_3dwws ) ) DEALLOCATE( tmp_3dwws ) |
---|
| 940 | IF ( ALLOCATED( tmp_4d ) ) DEALLOCATE( tmp_4d ) |
---|
| 941 | |
---|
| 942 | ! |
---|
[146] | 943 | !-- Read next character string |
---|
| 944 | READ ( 13 ) field_chr |
---|
[1] | 945 | |
---|
[146] | 946 | ENDDO ! loop over variables |
---|
[1] | 947 | |
---|
| 948 | ! |
---|
[146] | 949 | !-- Read user-defined restart data |
---|
[220] | 950 | CALL user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
| 951 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
| 952 | offset_xa, offset_ya, overlap_count(i), & |
---|
[216] | 953 | tmp_2d, tmp_3d ) |
---|
[145] | 954 | |
---|
| 955 | ! |
---|
[146] | 956 | !-- Close the restart file |
---|
| 957 | CALL close_file( 13 ) |
---|
| 958 | |
---|
| 959 | DEALLOCATE( tmp_2d, tmp_3d ) |
---|
| 960 | |
---|
| 961 | ENDDO ! loop over restart files |
---|
| 962 | |
---|
| 963 | |
---|
| 964 | ! |
---|
| 965 | !-- Restore the original filename for the restart file to be written |
---|
| 966 | myid_char = myid_char_save |
---|
| 967 | |
---|
| 968 | |
---|
| 969 | ! |
---|
[1] | 970 | !-- End of time measuring for reading binary data |
---|
| 971 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'stop' ) |
---|
| 972 | |
---|
| 973 | END SUBROUTINE read_3d_binary |
---|