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