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