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