[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 257 2009-03-11 15:17:42Z raasch $ |
---|
| 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' |
---|
| 143 | CALL message( 'read_3d_binary', 'PA0284', 2, 2, 0, 6, 0 ) |
---|
| 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 |
---|
[257] | 206 | WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed in ', & |
---|
| 207 | 'restart run& PE', myid, ' will read from files ', & |
---|
| 208 | file_list(1:files_to_be_opened) |
---|
| 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 |
---|
[257] | 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 ), '"' |
---|
| 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 |
---|
[257] | 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' |
---|
| 258 | CALL message( 'read_3d_binary', 'PA0287', 2, 2, 0, 6, 0 ) |
---|
[146] | 259 | ENDIF |
---|
[1] | 260 | |
---|
[146] | 261 | IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN |
---|
[257] | 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' |
---|
| 267 | CALL message( 'read_3d_binary', 'PA0288', 2, 2, 0, 6, 0 ) |
---|
| 268 | |
---|
[146] | 269 | ENDIF |
---|
[1] | 270 | |
---|
[146] | 271 | IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN |
---|
[257] | 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), & |
---|
| 276 | '&from the index bound information array' |
---|
| 277 | CALL message( 'read_3d_binary', 'PA0289', 2, 2, 0, 6, 0 ) |
---|
[146] | 278 | ENDIF |
---|
[1] | 279 | |
---|
[146] | 280 | IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN |
---|
[257] | 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' |
---|
| 286 | CALL message( 'read_3d_binary', 'PA0290', 2, 2, 0, 6, 0 ) |
---|
[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 |
---|
[257] | 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', 0, 1, 0, 6, 0 ) |
---|
[216] | 621 | READ ( 13 ) rdummy |
---|
| 622 | ELSE |
---|
| 623 | READ ( 13 ) spectrum_x |
---|
| 624 | ENDIF |
---|
| 625 | ENDIF |
---|
[146] | 626 | |
---|
[216] | 627 | CASE ( 'spectrum_y' ) |
---|
| 628 | IF ( k == 1 ) THEN |
---|
| 629 | IF ( ny_on_file /= ny ) THEN |
---|
[257] | 630 | message_string = 'read_3d_binary: spectrum_y ' // & |
---|
| 631 | 'on restart file ignored because' // & |
---|
| 632 | '&total numbers of grid points (ny) '// & |
---|
| 633 | 'do not match' |
---|
| 634 | CALL message( 'read_3d_binary', 'PA0294', 0, 1, 0, 6, 0 ) |
---|
[216] | 635 | READ ( 13 ) rdummy |
---|
| 636 | ELSE |
---|
| 637 | READ ( 13 ) spectrum_y |
---|
| 638 | ENDIF |
---|
| 639 | ENDIF |
---|
[146] | 640 | |
---|
[216] | 641 | CASE ( 'ts' ) |
---|
| 642 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 643 | ts(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 644 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 645 | |
---|
[216] | 646 | CASE ( 'ts_av' ) |
---|
| 647 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
| 648 | ALLOCATE( ts_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 649 | ENDIF |
---|
| 650 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 651 | ts_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 652 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 653 | |
---|
[216] | 654 | CASE ( 'tswst' ) |
---|
| 655 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 656 | tswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 657 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 658 | |
---|
[216] | 659 | CASE ( 'tswst_m' ) |
---|
| 660 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 661 | tswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 662 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 663 | |
---|
[216] | 664 | CASE ( 'u' ) |
---|
| 665 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 666 | u(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 667 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 668 | |
---|
[216] | 669 | CASE ( 'u_av' ) |
---|
| 670 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
| 671 | ALLOCATE( u_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 672 | ENDIF |
---|
| 673 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 674 | u_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 675 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 676 | |
---|
[216] | 677 | CASE ( 'u_m' ) |
---|
| 678 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 679 | u_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 680 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 681 | |
---|
[216] | 682 | CASE ( 'u_m_l' ) |
---|
| 683 | IF ( k == 1 ) THEN |
---|
| 684 | ALLOCATE( tmp_3dwul(nzb:nzt+1, & |
---|
| 685 | nys_on_file-1:nyn_on_file+1,1:2) ) |
---|
| 686 | READ ( 13 ) tmp_3dwul |
---|
| 687 | ENDIF |
---|
| 688 | IF ( outflow_l ) THEN |
---|
| 689 | u_m_l(:,nysc-1:nync+1,:) = tmp_3dwul(:,nysf-1:nynf+1,:) |
---|
| 690 | ENDIF |
---|
[146] | 691 | |
---|
[216] | 692 | CASE ( 'u_m_n' ) |
---|
| 693 | IF ( k == 1 ) THEN |
---|
| 694 | ALLOCATE( tmp_3dwun(nzb:nzt+1,ny-1:ny, & |
---|
| 695 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 696 | READ ( 13 ) tmp_3dwun |
---|
| 697 | ENDIF |
---|
| 698 | IF ( outflow_n ) THEN |
---|
| 699 | u_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwun(:,:,nxlf-1:nxrf+1) |
---|
| 700 | ENDIF |
---|
[146] | 701 | |
---|
[216] | 702 | CASE ( 'u_m_r' ) |
---|
| 703 | IF ( k == 1 ) THEN |
---|
| 704 | ALLOCATE( tmp_3dwur(nzb:nzt+1,& |
---|
| 705 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
| 706 | READ ( 13 ) tmp_3dwur |
---|
| 707 | ENDIF |
---|
| 708 | IF ( outflow_r ) THEN |
---|
| 709 | u_m_r(:,nysc-1:nync+1,:) = tmp_3dwur(:,nysf-1:nynf+1,:) |
---|
| 710 | ENDIF |
---|
[146] | 711 | |
---|
[216] | 712 | CASE ( 'u_m_s' ) |
---|
| 713 | IF ( k == 1 ) THEN |
---|
| 714 | ALLOCATE( tmp_3dwus(nzb:nzt+1,0:1, & |
---|
| 715 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 716 | READ ( 13 ) tmp_3dwus |
---|
| 717 | ENDIF |
---|
| 718 | IF ( outflow_s ) THEN |
---|
| 719 | u_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwus(:,:,nxlf-1:nxrf+1) |
---|
| 720 | ENDIF |
---|
[146] | 721 | |
---|
[216] | 722 | CASE ( 'us' ) |
---|
| 723 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 724 | us(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 725 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 726 | |
---|
[216] | 727 | CASE ( 'usws' ) |
---|
| 728 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 729 | usws(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 730 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 731 | |
---|
[216] | 732 | CASE ( 'uswst' ) |
---|
| 733 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 734 | uswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 735 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 736 | |
---|
[216] | 737 | CASE ( 'usws_m' ) |
---|
| 738 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 739 | usws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 740 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 741 | |
---|
[216] | 742 | CASE ( 'uswst_m' ) |
---|
| 743 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 744 | uswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 745 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 746 | |
---|
[216] | 747 | CASE ( 'us_av' ) |
---|
| 748 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
| 749 | ALLOCATE( us_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 750 | ENDIF |
---|
| 751 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 752 | us_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 753 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 754 | |
---|
[216] | 755 | CASE ( 'v' ) |
---|
| 756 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 757 | v(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 758 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 759 | |
---|
[216] | 760 | CASE ( 'v_av' ) |
---|
| 761 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
| 762 | ALLOCATE( v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 763 | ENDIF |
---|
| 764 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 765 | v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 766 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 767 | |
---|
[216] | 768 | CASE ( 'v_m' ) |
---|
| 769 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 770 | v_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 771 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 772 | |
---|
[216] | 773 | CASE ( 'v_m_l' ) |
---|
| 774 | IF ( k == 1 ) THEN |
---|
| 775 | ALLOCATE( tmp_3dwvl(nzb:nzt+1,& |
---|
| 776 | nys_on_file-1:nyn_on_file+1,0:1) ) |
---|
| 777 | READ ( 13 ) tmp_3dwvl |
---|
| 778 | ENDIF |
---|
| 779 | IF ( outflow_l ) THEN |
---|
| 780 | v_m_l(:,nysc-1:nync+1,:) = tmp_3dwvl(:,nysf-1:nynf+1,:) |
---|
| 781 | ENDIF |
---|
[146] | 782 | |
---|
[216] | 783 | CASE ( 'v_m_n' ) |
---|
| 784 | IF ( k == 1 ) THEN |
---|
| 785 | ALLOCATE( tmp_3dwvn(nzb:nzt+1,ny-1:ny, & |
---|
| 786 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 787 | READ ( 13 ) tmp_3dwvn |
---|
| 788 | ENDIF |
---|
| 789 | IF ( outflow_n ) THEN |
---|
| 790 | v_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwvn(:,:,nxlf-1:nxrf+1) |
---|
| 791 | ENDIF |
---|
[146] | 792 | |
---|
[216] | 793 | CASE ( 'v_m_r' ) |
---|
| 794 | IF ( k == 1 ) THEN |
---|
| 795 | ALLOCATE( tmp_3dwvr(nzb:nzt+1,& |
---|
| 796 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
| 797 | READ ( 13 ) tmp_3dwvr |
---|
| 798 | ENDIF |
---|
| 799 | IF ( outflow_r ) THEN |
---|
| 800 | v_m_r(:,nysc-1:nync+1,:) = tmp_3dwvr(:,nysf-1:nynf+1,:) |
---|
| 801 | ENDIF |
---|
[146] | 802 | |
---|
[216] | 803 | CASE ( 'v_m_s' ) |
---|
| 804 | IF ( k == 1 ) THEN |
---|
| 805 | ALLOCATE( tmp_3dwvs(nzb:nzt+1,1:2, & |
---|
| 806 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 807 | READ ( 13 ) tmp_3dwvs |
---|
| 808 | ENDIF |
---|
| 809 | IF ( outflow_s ) THEN |
---|
| 810 | v_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwvs(:,:,nxlf-1:nxrf+1) |
---|
| 811 | ENDIF |
---|
[146] | 812 | |
---|
[216] | 813 | CASE ( 'vpt' ) |
---|
| 814 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 815 | vpt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 816 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 817 | |
---|
[216] | 818 | CASE ( 'vpt_av' ) |
---|
| 819 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
| 820 | ALLOCATE( vpt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 821 | ENDIF |
---|
| 822 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 823 | vpt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 824 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 825 | |
---|
[216] | 826 | CASE ( 'vpt_m' ) |
---|
| 827 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 828 | vpt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 829 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 830 | |
---|
[216] | 831 | CASE ( 'vsws' ) |
---|
| 832 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 833 | vsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 834 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 835 | |
---|
[216] | 836 | CASE ( 'vswst' ) |
---|
| 837 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 838 | vswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 839 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 840 | |
---|
[216] | 841 | CASE ( 'vsws_m' ) |
---|
| 842 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 843 | vsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 844 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 845 | |
---|
[216] | 846 | CASE ( 'vswst_m' ) |
---|
| 847 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 848 | vswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 849 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 850 | |
---|
[216] | 851 | CASE ( 'w' ) |
---|
| 852 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 853 | w(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 854 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 855 | |
---|
[216] | 856 | CASE ( 'w_av' ) |
---|
| 857 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
| 858 | ALLOCATE( w_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 859 | ENDIF |
---|
| 860 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 861 | w_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 862 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 863 | |
---|
[216] | 864 | CASE ( 'w_m' ) |
---|
| 865 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 866 | w_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 867 | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 868 | |
---|
[216] | 869 | CASE ( 'w_m_l' ) |
---|
| 870 | IF ( k == 1 ) THEN |
---|
| 871 | ALLOCATE( tmp_3dwwl(nzb:nzt+1,& |
---|
| 872 | nys_on_file-1:nyn_on_file+1,0:1) ) |
---|
| 873 | READ ( 13 ) tmp_3dwwl |
---|
| 874 | ENDIF |
---|
| 875 | IF ( outflow_l ) THEN |
---|
| 876 | w_m_l(:,nysc-1:nync+1,:) = tmp_3dwwl(:,nysf-1:nynf+1,:) |
---|
| 877 | ENDIF |
---|
[146] | 878 | |
---|
[216] | 879 | CASE ( 'w_m_n' ) |
---|
| 880 | IF ( k == 1 ) THEN |
---|
| 881 | ALLOCATE( tmp_3dwwn(nzb:nzt+1,ny-1:ny, & |
---|
| 882 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 883 | READ ( 13 ) tmp_3dwwn |
---|
| 884 | ENDIF |
---|
| 885 | IF ( outflow_n ) THEN |
---|
| 886 | w_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dwwn(:,:,nxlf-1:nxrf+1) |
---|
| 887 | ENDIF |
---|
[146] | 888 | |
---|
[216] | 889 | CASE ( 'w_m_r' ) |
---|
| 890 | IF ( k == 1 ) THEN |
---|
| 891 | ALLOCATE( tmp_3dwwr(nzb:nzt+1,& |
---|
| 892 | nys_on_file-1:nyn_on_file+1,nx-1:nx) ) |
---|
| 893 | READ ( 13 ) tmp_3dwwr |
---|
| 894 | ENDIF |
---|
| 895 | IF ( outflow_r ) THEN |
---|
| 896 | w_m_r(:,nysc-1:nync+1,:) = tmp_3dwwr(:,nysf-1:nynf+1,:) |
---|
| 897 | ENDIF |
---|
[146] | 898 | |
---|
[216] | 899 | CASE ( 'w_m_s' ) |
---|
| 900 | IF ( k == 1 ) THEN |
---|
| 901 | ALLOCATE( tmp_3dwws(nzb:nzt+1,0:1, & |
---|
| 902 | nxl_on_file-1:nxr_on_file+1) ) |
---|
| 903 | READ ( 13 ) tmp_3dwws |
---|
| 904 | ENDIF |
---|
| 905 | IF ( outflow_s ) THEN |
---|
| 906 | w_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dwws(:,:,nxlf-1:nxrf+1) |
---|
| 907 | ENDIF |
---|
| 908 | DEALLOCATE( tmp_3dwws ) |
---|
[146] | 909 | |
---|
[216] | 910 | CASE ( 'z0' ) |
---|
| 911 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 912 | z0(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 913 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 914 | |
---|
[216] | 915 | CASE ( 'z0_av' ) |
---|
| 916 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
| 917 | ALLOCATE( z0_av(nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
| 918 | ENDIF |
---|
| 919 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 920 | z0_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & |
---|
[147] | 921 | tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) |
---|
[146] | 922 | |
---|
[216] | 923 | CASE DEFAULT |
---|
[257] | 924 | WRITE( message_string, * ) 'unknown field named "', & |
---|
| 925 | TRIM( field_chr ), '" found in', & |
---|
| 926 | '&data from prior run on PE ',myid |
---|
| 927 | CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 ) |
---|
| 928 | |
---|
[216] | 929 | END SELECT |
---|
| 930 | |
---|
| 931 | ENDDO ! overlap loop |
---|
| 932 | |
---|
[1] | 933 | ! |
---|
[216] | 934 | !-- Deallocate arrays needed for specific variables only |
---|
| 935 | IF ( ALLOCATED( tmp_3dwul ) ) DEALLOCATE( tmp_3dwul ) |
---|
| 936 | IF ( ALLOCATED( tmp_3dwun ) ) DEALLOCATE( tmp_3dwun ) |
---|
| 937 | IF ( ALLOCATED( tmp_3dwur ) ) DEALLOCATE( tmp_3dwur ) |
---|
| 938 | IF ( ALLOCATED( tmp_3dwus ) ) DEALLOCATE( tmp_3dwus ) |
---|
| 939 | IF ( ALLOCATED( tmp_3dwvl ) ) DEALLOCATE( tmp_3dwvl ) |
---|
| 940 | IF ( ALLOCATED( tmp_3dwvn ) ) DEALLOCATE( tmp_3dwvn ) |
---|
| 941 | IF ( ALLOCATED( tmp_3dwvr ) ) DEALLOCATE( tmp_3dwvr ) |
---|
| 942 | IF ( ALLOCATED( tmp_3dwvs ) ) DEALLOCATE( tmp_3dwvs ) |
---|
| 943 | IF ( ALLOCATED( tmp_3dwwl ) ) DEALLOCATE( tmp_3dwwl ) |
---|
| 944 | IF ( ALLOCATED( tmp_3dwwn ) ) DEALLOCATE( tmp_3dwwn ) |
---|
| 945 | IF ( ALLOCATED( tmp_3dwwr ) ) DEALLOCATE( tmp_3dwwr ) |
---|
| 946 | IF ( ALLOCATED( tmp_3dwws ) ) DEALLOCATE( tmp_3dwws ) |
---|
| 947 | IF ( ALLOCATED( tmp_4d ) ) DEALLOCATE( tmp_4d ) |
---|
| 948 | |
---|
| 949 | ! |
---|
[146] | 950 | !-- Read next character string |
---|
| 951 | READ ( 13 ) field_chr |
---|
[1] | 952 | |
---|
[146] | 953 | ENDDO ! loop over variables |
---|
[1] | 954 | |
---|
| 955 | ! |
---|
[146] | 956 | !-- Read user-defined restart data |
---|
[220] | 957 | CALL user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
| 958 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
| 959 | offset_xa, offset_ya, overlap_count(i), & |
---|
[216] | 960 | tmp_2d, tmp_3d ) |
---|
[145] | 961 | |
---|
| 962 | ! |
---|
[146] | 963 | !-- Close the restart file |
---|
| 964 | CALL close_file( 13 ) |
---|
| 965 | |
---|
| 966 | DEALLOCATE( tmp_2d, tmp_3d ) |
---|
| 967 | |
---|
| 968 | ENDDO ! loop over restart files |
---|
| 969 | |
---|
| 970 | |
---|
| 971 | ! |
---|
| 972 | !-- Restore the original filename for the restart file to be written |
---|
| 973 | myid_char = myid_char_save |
---|
| 974 | |
---|
| 975 | |
---|
| 976 | ! |
---|
[1] | 977 | !-- End of time measuring for reading binary data |
---|
| 978 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'stop' ) |
---|
| 979 | |
---|
| 980 | END SUBROUTINE read_3d_binary |
---|