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