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