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