- Timestamp:
- Nov 25, 2008 7:12:43 AM (16 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/CURRENT_MODIFICATIONS
r215 r216 21 21 User interface has been split into single files. 22 22 23 Reading mechanism from restart files completely revised. The subdomain/total 24 domain size can vary arbitrarily between current and previous run. 25 (read_var_list, read_3d_binary, user_read_restart_data) 26 23 27 Precompilation mechanism (mbuild) completely revised: the source tarfile remains in 24 28 the source directory. One depository per block (given in the config-file) is … … 32 36 by this routine step by step within the next revisions. 33 37 34 Makefile, mbuild, mrun, check_parameters, local_stop, modules 38 Neumann boundary condition at k=nzb is explicitly set for better reading, 39 although this has been already done in boundary_conds. (advec_s_bc) 40 41 Origin of the xy-coordinate system shifted from the center of the first 42 grid cell (indices i=0, j=0) to the south-left corner of this cell. (netcdf) 43 44 Makefile, mbuild, mrun, advec_s_bc, check_parameters, local_stop, modules, netcdf, read_var_list, read_3d_binary, user_read_restart_data 35 45 36 46 New: handle_palm_message, user_3d_data_averaging user_actions user_advec_particles user_check_data_output user_check_data_output_pr user_data_output_2d user_data_output_3d user_data_output_dvrp user_define_netcdf_grid user_dvrp_coltab user_header user_init user_init_3d_model user_init_grid user_init_particles user_init_plant_canopy user_last_actions user_module user_parin user_particle_attributes user_read_restart_data user_spectra user_statistics 37 47 38 48 Removed: user_interface 49 39 50 40 51 Errors: … … 57 68 have been started (data_output_2d) 58 69 70 Bugfix: reading of spectrum_x|y from restart files ignored if total numbers 71 of grid points do not match (read_3d_binary) 59 72 60 advec_particles, combine_plot_fields, data_output_2d, header, production_e 73 advec_particles, combine_plot_fields, data_output_2d, header, production_e, read_3d_binary -
palm/trunk/SOURCE/advec_s_bc.f90
r98 r216 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! 6 ! Neumann boundary condition at k=nzb is explicitly set for better reading, 7 ! although this has been already done in boundary_conds 7 8 ! 8 9 ! Former revisions: … … 728 729 DO i = nxl, nxr 729 730 DO j = nys, nyn 731 sk_p(nzb,j,i) = sk_p(nzb+1,j,i) 730 732 sk_p(nzb-1,j,i) = sk_p(nzb,j,i) 731 733 sk_p(nzb-2,j,i) = sk_p(nzb,j,i) … … 766 768 DO i = nxl, nxr 767 769 DO j = nys, nyn 770 sk_p(nzb,j,i) = sk_p(nzb+1,j,i) 768 771 sk_p(nzb-1,j,i) = sk_p(nzb,j,i) 769 772 sk_p(nzb-2,j,i) = sk_p(nzb,j,i) … … 788 791 DO i = nxl, nxr 789 792 DO j = nys, nyn 793 sk_p(nzb,j,i) = sk_p(nzb+1,j,i) 790 794 sk_p(nzb-1,j,i) = sk_p(nzb,j,i) 791 795 sk_p(nzb-2,j,i) = sk_p(nzb,j,i) … … 823 827 DO i = nxl, nxr 824 828 DO j = nys, nyn 829 sk_p(nzb,j,i) = sk_p(nzb+1,j,i) 825 830 sk_p(nzb-1,j,i) = sk_p(nzb,j,i) 826 831 sk_p(nzb-2,j,i) = sk_p(nzb,j,i) -
palm/trunk/SOURCE/modules.f90
r213 r216 301 301 CHARACTER (LEN=10), DIMENSION(0:1,100) :: do2d = ' ', do3d = ' ' 302 302 303 INTEGER :: abort_mode = 0, average_count_pr = 0, average_count_sp = 0, &303 INTEGER :: abort_mode = 1, average_count_pr = 0, average_count_sp = 0, & 304 304 average_count_3d = 0, current_timestep_number = 0, & 305 305 dist_range = 0, disturbance_level_ind_b, & -
palm/trunk/SOURCE/netcdf.f90
r198 r216 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! 9 ! Origin of the xy-coordinate system shifted from the center of the first 10 ! grid cell (indices i=0, j=0) to the south-left corner of this cell. 10 11 ! 11 12 ! Former revisions: … … 457 458 458 459 ! 459 !-- Write data for x and xu axis (shifted by -dx/2)460 !-- Write data for x (shifted by +dx/2) and xu axis 460 461 ALLOCATE( netcdf_data(0:nx+1) ) 461 462 462 463 DO i = 0, nx+1 463 netcdf_data(i) = i* dx464 netcdf_data(i) = ( i + 0.5 ) * dx 464 465 ENDDO 465 466 … … 469 470 470 471 DO i = 0, nx+1 471 netcdf_data(i) = ( i - 0.5 )* dx472 netcdf_data(i) = i * dx 472 473 ENDDO 473 474 … … 480 481 481 482 ! 482 !-- Write data for y and yv axis (shifted by -dy/2)483 !-- Write data for y (shifted by +dy/2) and yv axis 483 484 ALLOCATE( netcdf_data(0:ny+1) ) 484 485 485 486 DO i = 0, ny+1 486 netcdf_data(i) = i* dy487 netcdf_data(i) = ( i + 0.5 ) * dy 487 488 ENDDO 488 489 … … 492 493 493 494 DO i = 0, ny+1 494 netcdf_data(i) = ( i - 0.5 )* dy495 netcdf_data(i) = i * dy 495 496 ENDDO 496 497 … … 1034 1035 1035 1036 ! 1036 !-- Write data for x and xu axis (shifted by -dx/2)1037 !-- Write data for x (shifted by +dx/2) and xu axis 1037 1038 ALLOCATE( netcdf_data(0:nx+1) ) 1038 1039 1039 1040 DO i = 0, nx+1 1040 netcdf_data(i) = i* dx1041 netcdf_data(i) = ( i + 0.5 ) * dx 1041 1042 ENDDO 1042 1043 … … 1046 1047 1047 1048 DO i = 0, nx+1 1048 netcdf_data(i) = ( i - 0.5 )* dx1049 netcdf_data(i) = i * dx 1049 1050 ENDDO 1050 1051 … … 1057 1058 1058 1059 ! 1059 !-- Write data for y and yv axis (shifted by -dy/2)1060 !-- Write data for y (shifted by +dy/2) and yv axis 1060 1061 ALLOCATE( netcdf_data(0:ny+1) ) 1061 1062 1062 1063 DO i = 0, ny+1 1063 netcdf_data(i) = i* dy1064 netcdf_data(i) = ( i + 0.5 ) * dy 1064 1065 ENDDO 1065 1066 … … 1069 1070 1070 1071 DO i = 0, ny+1 1071 netcdf_data(i) = ( i - 0.5 )* dy1072 netcdf_data(i) = i * dy 1072 1073 ENDDO 1073 1074 … … 1531 1532 1532 1533 ! 1533 !-- Write y_xz data 1534 !-- Write y_xz data (shifted by +dy/2) 1535 DO i = 1, ns 1536 IF( section(i,2) == -1 ) THEN 1537 netcdf_data(i) = -1.0 ! section averaged along y 1538 ELSE 1539 netcdf_data(i) = ( section(i,2) + 0.5 ) * dy 1540 ENDIF 1541 ENDDO 1542 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data, & 1543 start = (/ 1 /), count = (/ ns /) ) 1544 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 163 ) 1545 1546 ! 1547 !-- Write yv_xz data 1534 1548 DO i = 1, ns 1535 1549 IF( section(i,2) == -1 ) THEN … … 1539 1553 ENDIF 1540 1554 ENDDO 1541 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data, &1542 start = (/ 1 /), count = (/ ns /) )1543 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 163 )1544 1545 !1546 !-- Write yv_xz data1547 DO i = 1, ns1548 IF( section(i,2) == -1 ) THEN1549 netcdf_data(i) = -1.0 ! section averaged along y1550 ELSE1551 netcdf_data(i) = ( section(i,2) - 0.5 ) * dy1552 ENDIF1553 ENDDO1554 1555 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_yv_xz(av), & 1555 1556 netcdf_data, start = (/ 1 /), & … … 1568 1569 1569 1570 ! 1570 !-- Write data for x and xu axis (shifted by -dx/2)1571 !-- Write data for x (shifted by +dx/2) and xu axis 1571 1572 ALLOCATE( netcdf_data(0:nx+1) ) 1572 1573 1573 1574 DO i = 0, nx+1 1574 netcdf_data(i) = i* dx1575 netcdf_data(i) = ( i + 0.5 ) * dx 1575 1576 ENDDO 1576 1577 … … 1580 1581 1581 1582 DO i = 0, nx+1 1582 netcdf_data(i) = ( i - 0.5 )* dx1583 netcdf_data(i) = i * dx 1583 1584 ENDDO 1584 1585 … … 2042 2043 2043 2044 ! 2044 !-- Write x_yz data 2045 !-- Write x_yz data (shifted by +dx/2) 2046 DO i = 1, ns 2047 IF( section(i,3) == -1 ) THEN 2048 netcdf_data(i) = -1.0 ! section averaged along x 2049 ELSE 2050 netcdf_data(i) = ( section(i,3) + 0.5 ) * dx 2051 ENDIF 2052 ENDDO 2053 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data, & 2054 start = (/ 1 /), count = (/ ns /) ) 2055 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 202 ) 2056 2057 ! 2058 !-- Write x_yz data (xu grid) 2045 2059 DO i = 1, ns 2046 2060 IF( section(i,3) == -1 ) THEN … … 2050 2064 ENDIF 2051 2065 ENDDO 2052 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data, &2053 start = (/ 1 /), count = (/ ns /) )2054 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 202 )2055 2056 !2057 !-- Write x_yz data (xu grid)2058 DO i = 1, ns2059 IF( section(i,3) == -1 ) THEN2060 netcdf_data(i) = -1.0 ! section averaged along x2061 ELSE2062 netcdf_data(i) = (section(i,3)-0.5) * dx2063 ENDIF2064 ENDDO2065 2066 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_xu_yz(av), netcdf_data, & 2066 2067 start = (/ 1 /), count = (/ ns /) ) … … 2078 2079 2079 2080 ! 2080 !-- Write data for y and yv axis (shifted by -dy/2)2081 !-- Write data for y (shifted by +dy/2) and yv axis 2081 2082 ALLOCATE( netcdf_data(0:ny+1) ) 2082 2083 2083 2084 DO j = 0, ny+1 2084 netcdf_data(j) = j* dy2085 netcdf_data(j) = ( j + 0.5 ) * dy 2085 2086 ENDDO 2086 2087 … … 2090 2091 2091 2092 DO j = 0, ny+1 2092 netcdf_data(j) = ( j - 0.5 )* dy2093 netcdf_data(j) = j * dy 2093 2094 ENDDO 2094 2095 -
palm/trunk/SOURCE/read_3d_binary.f90
r198 r216 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! 6 ! reading mechanism completely revised (subdomain/total domain size can vary 7 ! arbitrarily between current and previous run) 8 ! Bugfix: reading of spectrum_x|y from restart files ignored if total numbers 9 ! of grid points do not match 7 10 ! 8 11 ! Former revisions: … … 66 69 CHARACTER (LEN=20) :: field_chr 67 70 68 INTEGER :: files_to_be_opened, i, j, myid_on_file,&71 INTEGER :: files_to_be_opened, i, j, k, myid_on_file, & 69 72 numprocs_on_file, nxlc, nxlf, nxlpr, nxl_on_file, nxrc, nxrf, & 70 73 nxrpr, nxr_on_file, nync, nynf, nynpr, nyn_on_file, nysc, & 71 74 nysf, nyspr, nys_on_file, nzb_on_file, nzt_on_file, offset_x, & 72 offset_y 73 74 INTEGER, DIMENSION(numprocs_previous_run*4) :: file_list, nxlfa, nxrfa, & 75 nynfa, nysfa, offset_xa, offset_ya 75 offset_y, shift_x, shift_y 76 77 INTEGER, DIMENSION(numprocs_previous_run) :: file_list, overlap_count 78 79 INTEGER, DIMENSION(numprocs_previous_run,1000) :: nxlfa, nxrfa, nynfa, & 80 nysfa, offset_xa, & 81 offset_ya 82 REAL :: rdummy 76 83 77 84 REAL, DIMENSION(:,:), ALLOCATABLE :: tmp_2d 78 REAL, DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d, tmp_3dw 85 REAL, DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d, tmp_3dwul, tmp_3dwun, & 86 tmp_3dwur, tmp_3dwus, tmp_3dwvl, & 87 tmp_3dwvn, tmp_3dwvr, tmp_3dwvs, & 88 tmp_3dwwl, tmp_3dwwn, tmp_3dwwr, & 89 tmp_3dwws 79 90 REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: tmp_4d 80 91 … … 90 101 91 102 DO i = 1, numprocs_previous_run 92 103 ! 104 !-- Store array bounds of the previous run ("pr") in temporary scalars 93 105 nxlpr = hor_index_bounds_previous_run(1,i-1) 94 106 nxrpr = hor_index_bounds_previous_run(2,i-1) … … 103 115 104 116 ! 105 !-- Only data which overlap with the current subdomain have to be read 106 IF ( nxlpr <= nxr-offset_x .AND. nxrpr >= nxl-offset_x .AND. & 107 nyspr <= nyn-offset_y .AND. nynpr >= nys-offset_y ) THEN 108 109 files_to_be_opened = files_to_be_opened + 1 110 file_list(files_to_be_opened) = i-1 111 ! 112 !-- Index bounds of overlapping data 113 nxlfa(files_to_be_opened) = MAX( nxl-offset_x, nxlpr ) 114 nxrfa(files_to_be_opened) = MIN( nxr-offset_x, nxrpr ) 115 nysfa(files_to_be_opened) = MAX( nys-offset_y, nyspr ) 116 nynfa(files_to_be_opened) = MIN( nyn-offset_y, nynpr ) 117 118 WRITE (9,*) '*** reading from file: ', i 119 WRITE (9,*) ' index bounds on file:' 120 WRITE (9,*) ' nxlpr=', nxlpr, ' nxrpr=', nxrpr 121 WRITE (9,*) ' nyspr=', nyspr, ' nynpr=', nynpr 122 WRITE (9,*) ' index bounds of current subdmain:' 123 WRITE (9,*) ' nxl =', nxl, ' nxr =', nxr 124 WRITE (9,*) ' nys =', nys, ' nyn =', nyn 125 WRITE (9,*) ' offset used:' 126 WRITE (9,*) ' offset_x=', offset_x, ' offset_y=', offset_y 127 WRITE (9,*) ' bounds of overlapping data:' 128 WRITE (9,*) ' nxlfa=', nxlfa(files_to_be_opened), ' nxrfa=', nxrfa(files_to_be_opened) 129 WRITE (9,*) ' nysfa=', nysfa(files_to_be_opened), ' nynfa=', nynfa(files_to_be_opened) 117 !-- Start with this offset and then check, if the subdomain on file 118 !-- matches another time(s) in the current subdomain by shifting it 119 !-- for nx_on_file+1, ny_on_file+1 respectively 120 121 shift_y = 0 122 j = 0 ! counter for the number of files to be opened 123 124 DO WHILE ( nyspr+shift_y <= nyn-offset_y .AND. & 125 nynpr+shift_y >= nys-offset_y ) 126 127 shift_x = 0 128 129 DO WHILE ( nxlpr+shift_x <= nxr-offset_x .AND. & 130 nxrpr+shift_x >= nxl-offset_x ) 131 132 j = j +1 133 134 IF ( j > 1000 ) THEN 135 ! 136 !-- Array bound exceeded 137 PRINT*, '+++ read_3d_binary: data from subdomain of previous', & 138 ' run mapped more than 1000 times' 139 #if defined( __parallel ) 140 CALL MPI_ABORT( comm2d, 9999, ierr ) 141 #else 142 STOP 143 #endif 144 ENDIF 145 146 IF ( j == 1 ) THEN 147 files_to_be_opened = files_to_be_opened + 1 148 file_list(files_to_be_opened) = i-1 149 ENDIF 150 151 offset_xa(files_to_be_opened,j) = offset_x + shift_x 152 offset_ya(files_to_be_opened,j) = offset_y + shift_y 153 154 ! 155 !-- Index bounds of overlapping data 156 nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) 157 nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) 158 nysfa(files_to_be_opened,j) = MAX( nys-offset_y, nyspr ) 159 nynfa(files_to_be_opened,j) = MIN( nyn-offset_y, nynpr ) 160 161 shift_x = shift_x + ( nx_on_file + 1 ) 162 163 ENDDO 164 165 shift_y = shift_y + ( ny_on_file + 1 ) 166 167 ENDDO 168 169 IF ( j > 0 ) overlap_count(files_to_be_opened) = j 170 171 ! 172 !-- Test output, to be removed later 173 IF ( j > 0 ) THEN 174 WRITE (9,*) '*** reading from file: ', i, j, ' times' 175 WRITE (9,*) ' nxl = ', nxl, ' nxr = ', nxr, ' nys = ', nys, ' nyn = ', nyn 176 WRITE (9,*) ' ' 177 DO k = 1, j 178 WRITE (9,*) 'k = ', k 179 WRITE (9,'(6(A,I2))') 'nxlfa = ', nxlfa(files_to_be_opened,k), & 180 ' nxrfa = ', nxrfa(files_to_be_opened,k), & 181 ' offset_xa = ', offset_xa(files_to_be_opened,k), & 182 ' nysfa = ', nysfa(files_to_be_opened,k), & 183 ' nynfa = ', nynfa(files_to_be_opened,k), & 184 ' offset_ya = ', offset_ya(files_to_be_opened,k) 185 ENDDO 130 186 CALL local_flush( 9 ) 131 offset_xa(files_to_be_opened) = offset_x132 offset_ya(files_to_be_opened) = offset_y133 134 ENDIF135 136 !137 !-- If the total domain on file is smaller than the current total domain,138 !-- and if the current subdomain extends beyond the limits of the total139 !-- domain of file, the respective file may be opened again (three times140 !-- maximum) to read the still missing parts, which are then added141 !-- "cyclically".142 !-- Overlap along x:143 IF ( ( nxr - offset_x ) > nx_on_file ) THEN144 145 offset_x = offset_x + ( nx_on_file + 1 )146 147 IF ( nxlpr <= nxr-offset_x .AND. nxrpr >= nxl-offset_x .AND. &148 nyspr <= nyn-offset_y .AND. nynpr >= nys-offset_y ) THEN149 150 files_to_be_opened = files_to_be_opened + 1151 file_list(files_to_be_opened) = i-1152 !153 !-- Index bounds of overlapping data154 nxlfa(files_to_be_opened) = MAX( nxl-offset_x, nxlpr )155 nxrfa(files_to_be_opened) = MIN( nxr-offset_x, nxrpr )156 nysfa(files_to_be_opened) = MAX( nys-offset_y, nyspr )157 nynfa(files_to_be_opened) = MIN( nyn-offset_y, nynpr )158 159 WRITE (9,*) '*** reading from file: ', i160 WRITE (9,*) ' index bounds on file:'161 WRITE (9,*) ' nxlpr=', nxlpr, ' nxrpr=', nxrpr162 WRITE (9,*) ' nyspr=', nyspr, ' nynpr=', nynpr163 WRITE (9,*) ' index bounds of current subdmain:'164 WRITE (9,*) ' nxl =', nxl, ' nxr =', nxr165 WRITE (9,*) ' nys =', nys, ' nyn =', nyn166 WRITE (9,*) ' offset used:'167 WRITE (9,*) ' offset_x=', offset_x, ' offset_y=', offset_y168 WRITE (9,*) ' bounds of overlapping data:'169 WRITE (9,*) ' nxlfa=', nxlfa(files_to_be_opened), ' nxrfa=', nxrfa(files_to_be_opened)170 WRITE (9,*) ' nysfa=', nysfa(files_to_be_opened), ' nynfa=', nynfa(files_to_be_opened)171 CALL local_flush( 9 )172 offset_xa(files_to_be_opened) = offset_x173 offset_ya(files_to_be_opened) = offset_y174 175 ENDIF176 177 offset_x = offset_x - ( nx_on_file + 1 )178 179 ENDIF180 181 182 !183 !-- Overlap along y:184 IF ( ( nyn - offset_y ) > ny_on_file ) THEN185 186 offset_y = offset_y + ( ny_on_file + 1 )187 188 IF ( nxlpr <= nxr-offset_x .AND. nxrpr >= nxl-offset_x .AND. &189 nyspr <= nyn-offset_y .AND. nynpr >= nys-offset_y ) THEN190 191 files_to_be_opened = files_to_be_opened + 1192 file_list(files_to_be_opened) = i-1193 !194 !-- Index bounds of overlapping data195 nxlfa(files_to_be_opened) = MAX( nxl-offset_x, nxlpr )196 nxrfa(files_to_be_opened) = MIN( nxr-offset_x, nxrpr )197 nysfa(files_to_be_opened) = MAX( nys-offset_y, nyspr )198 nynfa(files_to_be_opened) = MIN( nyn-offset_y, nynpr )199 200 WRITE (9,*) '*** reading from file: ', i201 WRITE (9,*) ' index bounds on file:'202 WRITE (9,*) ' nxlpr=', nxlpr, ' nxrpr=', nxrpr203 WRITE (9,*) ' nyspr=', nyspr, ' nynpr=', nynpr204 WRITE (9,*) ' index bounds of current subdmain:'205 WRITE (9,*) ' nxl =', nxl, ' nxr =', nxr206 WRITE (9,*) ' nys =', nys, ' nyn =', nyn207 WRITE (9,*) ' offset used:'208 WRITE (9,*) ' offset_x=', offset_x, ' offset_y=', offset_y209 WRITE (9,*) ' bounds of overlapping data:'210 WRITE (9,*) ' nxlfa=', nxlfa(files_to_be_opened), ' nxrfa=', nxrfa(files_to_be_opened)211 WRITE (9,*) ' nysfa=', nysfa(files_to_be_opened), ' nynfa=', nynfa(files_to_be_opened)212 CALL local_flush( 9 )213 offset_xa(files_to_be_opened) = offset_x214 offset_ya(files_to_be_opened) = offset_y215 216 ENDIF217 218 offset_y = offset_y - ( ny_on_file + 1 )219 220 ENDIF221 222 !-- Overlap along x and y:223 IF ( ( nxr - offset_x ) > nx_on_file .AND. &224 ( nyn - offset_y ) > ny_on_file ) THEN225 226 offset_x = offset_x + ( nx_on_file + 1 )227 offset_y = offset_y + ( ny_on_file + 1 )228 229 IF ( nxlpr <= nxr-offset_x .AND. nxrpr >= nxl-offset_x .AND. &230 nyspr <= nyn-offset_y .AND. nynpr >= nys-offset_y ) THEN231 232 files_to_be_opened = files_to_be_opened + 1233 file_list(files_to_be_opened) = i-1234 !235 !-- Index bounds of overlapping data236 nxlfa(files_to_be_opened) = MAX( nxl-offset_x, nxlpr )237 nxrfa(files_to_be_opened) = MIN( nxr-offset_x, nxrpr )238 nysfa(files_to_be_opened) = MAX( nys-offset_y, nyspr )239 nynfa(files_to_be_opened) = MIN( nyn-offset_y, nynpr )240 241 WRITE (9,*) '*** reading from file: ', i242 WRITE (9,*) ' index bounds on file:'243 WRITE (9,*) ' nxlpr=', nxlpr, ' nxrpr=', nxrpr244 WRITE (9,*) ' nyspr=', nyspr, ' nynpr=', nynpr245 WRITE (9,*) ' index bounds of current subdmain:'246 WRITE (9,*) ' nxl =', nxl, ' nxr =', nxr247 WRITE (9,*) ' nys =', nys, ' nyn =', nyn248 WRITE (9,*) ' offset used:'249 WRITE (9,*) ' offset_x=', offset_x, ' offset_y=', offset_y250 WRITE (9,*) ' bounds of overlapping data:'251 WRITE (9,*) ' nxlfa=', nxlfa(files_to_be_opened), ' nxrfa=', nxrfa(files_to_be_opened)252 WRITE (9,*) ' nysfa=', nysfa(files_to_be_opened), ' nynfa=', nynfa(files_to_be_opened)253 CALL local_flush( 9 )254 offset_xa(files_to_be_opened) = offset_x255 offset_ya(files_to_be_opened) = offset_y256 257 ENDIF258 259 offset_x = offset_x - ( nx_on_file + 1 )260 offset_y = offset_y - ( ny_on_file + 1 )261 262 187 ENDIF 263 188 … … 403 328 404 329 ! 405 !-- Get the index range of the subdomain on file which overlap with the406 !-- current subdomain407 nxlf = nxlfa(i)408 nxlc = nxlfa(i) + offset_xa(i)409 nxrf = nxrfa(i)410 nxrc = nxrfa(i) + offset_xa(i)411 nysf = nysfa(i)412 nysc = nysfa(i) + offset_ya(i)413 nynf = nynfa(i)414 nync = nynfa(i) + offset_ya(i)415 416 !417 330 !-- Read arrays 418 331 !-- ATTENTION: If the following read commands have been altered, the … … 423 336 DO WHILE ( TRIM( field_chr ) /= '*** end ***' ) 424 337 425 WRITE (9,*) 'var = ', field_chr 426 CALL local_flush( 9 ) 427 SELECT CASE ( TRIM( field_chr ) ) 428 429 CASE ( 'e' ) 430 READ ( 13 ) tmp_3d 431 e(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 432 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 433 434 CASE ( 'e_av' ) 435 IF ( .NOT. ALLOCATED( e_av ) ) THEN 436 ALLOCATE( e_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 437 ENDIF 438 READ ( 13 ) tmp_3d 439 e_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 440 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 441 442 CASE ( 'e_m' ) 443 READ ( 13 ) tmp_3d 444 e_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 445 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 446 447 CASE ( 'iran' ) ! matching random numbers is still unresolved issue 448 READ ( 13 ) iran, iran_part 449 450 CASE ( 'kh' ) 451 READ ( 13 ) tmp_3d 452 kh(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 453 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 454 455 CASE ( 'kh_m' ) 456 READ ( 13 ) tmp_3d 457 kh_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 458 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 459 460 CASE ( 'km' ) 461 READ ( 13 ) tmp_3d 462 km(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 463 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 464 465 CASE ( 'km_m' ) 466 READ ( 13 ) tmp_3d 467 km_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 468 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 469 470 CASE ( 'lwp_av' ) 471 IF ( .NOT. ALLOCATED( lwp_av ) ) THEN 472 ALLOCATE( lwp_av(nys-1:nyn+1,nxl-1:nxr+1) ) 473 ENDIF 474 READ ( 13 ) tmp_2d 475 lwp_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 476 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 477 478 CASE ( 'p' ) 479 READ ( 13 ) tmp_3d 480 p(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 481 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 482 483 CASE ( 'p_av' ) 484 IF ( .NOT. ALLOCATED( p_av ) ) THEN 485 ALLOCATE( p_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 486 ENDIF 487 READ ( 13 ) tmp_3d 488 p_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 489 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 490 491 CASE ( 'pc_av' ) 492 IF ( .NOT. ALLOCATED( pc_av ) ) THEN 493 ALLOCATE( pc_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 494 ENDIF 495 READ ( 13 ) tmp_3d 496 pc_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 497 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 498 499 CASE ( 'pr_av' ) 500 IF ( .NOT. ALLOCATED( pr_av ) ) THEN 501 ALLOCATE( pr_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 502 ENDIF 503 READ ( 13 ) tmp_3d 504 pr_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 505 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 506 507 CASE ( 'precipitation_amount' ) 508 READ ( 13 ) tmp_2d 509 precipitation_amount(nysc-1:nync+1,nxlc-1:nxrc+1) = & 510 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 511 512 CASE ( 'precipitation_rate_a' ) 513 IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN 514 ALLOCATE( precipitation_rate_av(nys-1:nyn+1,nxl-1:nxr+1) ) 515 ENDIF 516 READ ( 13 ) tmp_2d 517 precipitation_rate_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 518 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 519 520 CASE ( 'pt' ) 521 READ ( 13 ) tmp_3d 522 pt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 523 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 524 525 CASE ( 'pt_av' ) 526 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 527 ALLOCATE( pt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 528 ENDIF 529 READ ( 13 ) tmp_3d 530 pt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 531 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 532 533 CASE ( 'pt_m' ) 534 READ ( 13 ) tmp_3d 535 pt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 536 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 537 538 CASE ( 'q' ) 539 READ ( 13 ) tmp_3d 540 q(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 541 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 542 543 CASE ( 'q_av' ) 544 IF ( .NOT. ALLOCATED( q_av ) ) THEN 545 ALLOCATE( q_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 546 ENDIF 547 READ ( 13 ) tmp_3d 548 q_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 549 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 550 551 CASE ( 'q_m' ) 552 READ ( 13 ) tmp_3d 553 q_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 554 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 555 556 CASE ( 'ql' ) 557 READ ( 13 ) tmp_3d 558 ql(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 559 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 560 561 CASE ( 'ql_av' ) 562 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 563 ALLOCATE( ql_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 564 ENDIF 565 READ ( 13 ) tmp_3d 566 ql_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 567 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 568 569 CASE ( 'ql_c_av' ) 570 IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN 571 ALLOCATE( ql_c_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 572 ENDIF 573 READ ( 13 ) tmp_3d 574 ql_c_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 575 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 576 577 CASE ( 'ql_v_av' ) 578 IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN 579 ALLOCATE( ql_v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 580 ENDIF 581 READ ( 13 ) tmp_3d 582 ql_v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 583 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 584 585 CASE ( 'ql_vp_av' ) 586 IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN 587 ALLOCATE( ql_vp_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 588 ENDIF 589 READ ( 13 ) tmp_3d 590 ql_vp_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 591 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 592 593 CASE ( 'qs' ) 594 READ ( 13 ) tmp_2d 595 qs(nysc-1:nync+1,nxlc-1:nxrc+1) = & 596 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 597 598 CASE ( 'qsws' ) 599 READ ( 13 ) tmp_2d 600 qsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 601 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 602 603 CASE ( 'qsws_m' ) 604 READ ( 13 ) tmp_2d 605 qsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 606 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 607 608 CASE ( 'qswst' ) 609 READ ( 13 ) tmp_2d 610 qswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 611 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 612 613 CASE ( 'qswst_m' ) 614 READ ( 13 ) tmp_2d 615 qswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 616 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 617 618 CASE ( 'qv_av' ) 619 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 620 ALLOCATE( qv_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 621 ENDIF 622 READ ( 13 ) tmp_3d 623 qv_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 624 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 625 626 CASE ( 'random_iv' ) ! still unresolved issue 627 READ ( 13 ) random_iv 628 READ ( 13 ) random_iy 629 630 CASE ( 'rho_av' ) 631 IF ( .NOT. ALLOCATED( rho_av ) ) THEN 632 ALLOCATE( rho_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 633 ENDIF 634 READ ( 13 ) tmp_3d 635 rho_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 636 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 637 638 CASE ( 'rif' ) 639 READ ( 13 ) tmp_2d 640 rif(nysc-1:nync+1,nxlc-1:nxrc+1) = & 641 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 642 643 CASE ( 'rif_m' ) 644 READ ( 13 ) tmp_2d 645 rif_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 646 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 647 648 CASE ( 'rif_wall' ) 649 ALLOCATE( tmp_4d(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & 650 nxl_on_file-1:nxr_on_file+1,1:4) ) 651 READ ( 13 ) tmp_4d 652 rif_wall(:,nysc-1:nync+1,nxlc-1:nxrc+1,:) = & 338 ! 339 !-- Map data on file as often as needed (data are read only for k=1) 340 DO k = 1, overlap_count(i) 341 342 ! 343 !-- Get the index range of the subdomain on file which overlap with the 344 !-- current subdomain 345 nxlf = nxlfa(i,k) 346 nxlc = nxlfa(i,k) + offset_xa(i,k) 347 nxrf = nxrfa(i,k) 348 nxrc = nxrfa(i,k) + offset_xa(i,k) 349 nysf = nysfa(i,k) 350 nysc = nysfa(i,k) + offset_ya(i,k) 351 nynf = nynfa(i,k) 352 nync = nynfa(i,k) + offset_ya(i,k) 353 354 355 WRITE (9,*) 'var = ', field_chr 356 CALL local_flush( 9 ) 357 358 SELECT CASE ( TRIM( field_chr ) ) 359 360 CASE ( 'e' ) 361 IF ( k == 1 ) READ ( 13 ) tmp_3d 362 e(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 363 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 364 365 CASE ( 'e_av' ) 366 IF ( .NOT. ALLOCATED( e_av ) ) THEN 367 ALLOCATE( e_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 368 ENDIF 369 IF ( k == 1 ) READ ( 13 ) tmp_3d 370 e_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 371 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 372 373 CASE ( 'e_m' ) 374 IF ( k == 1 ) READ ( 13 ) tmp_3d 375 e_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 376 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 377 378 CASE ( 'iran' ) ! matching random numbers is still unresolved 379 ! issue 380 IF ( k == 1 ) READ ( 13 ) iran, iran_part 381 382 CASE ( 'kh' ) 383 IF ( k == 1 ) READ ( 13 ) tmp_3d 384 kh(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 385 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 386 387 CASE ( 'kh_m' ) 388 IF ( k == 1 ) READ ( 13 ) tmp_3d 389 kh_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 390 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 391 392 CASE ( 'km' ) 393 IF ( k == 1 ) READ ( 13 ) tmp_3d 394 km(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 395 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 396 397 CASE ( 'km_m' ) 398 IF ( k == 1 ) READ ( 13 ) tmp_3d 399 km_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 400 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 401 402 CASE ( 'lwp_av' ) 403 IF ( .NOT. ALLOCATED( lwp_av ) ) THEN 404 ALLOCATE( lwp_av(nys-1:nyn+1,nxl-1:nxr+1) ) 405 ENDIF 406 IF ( k == 1 ) READ ( 13 ) tmp_2d 407 lwp_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 408 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 409 410 CASE ( 'p' ) 411 IF ( k == 1 ) READ ( 13 ) tmp_3d 412 p(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 413 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 414 415 CASE ( 'p_av' ) 416 IF ( .NOT. ALLOCATED( p_av ) ) THEN 417 ALLOCATE( p_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 418 ENDIF 419 IF ( k == 1 ) READ ( 13 ) tmp_3d 420 p_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 421 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 422 423 CASE ( 'pc_av' ) 424 IF ( .NOT. ALLOCATED( pc_av ) ) THEN 425 ALLOCATE( pc_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 426 ENDIF 427 IF ( k == 1 ) READ ( 13 ) tmp_3d 428 pc_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 429 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 430 431 CASE ( 'pr_av' ) 432 IF ( .NOT. ALLOCATED( pr_av ) ) THEN 433 ALLOCATE( pr_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 434 ENDIF 435 IF ( k == 1 ) READ ( 13 ) tmp_3d 436 pr_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 437 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 438 439 CASE ( 'precipitation_amount' ) 440 IF ( k == 1 ) READ ( 13 ) tmp_2d 441 precipitation_amount(nysc-1:nync+1,nxlc-1:nxrc+1) = & 442 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 443 444 CASE ( 'precipitation_rate_a' ) 445 IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN 446 ALLOCATE( precipitation_rate_av(nys-1:nyn+1,nxl-1:nxr+1) ) 447 ENDIF 448 IF ( k == 1 ) READ ( 13 ) tmp_2d 449 precipitation_rate_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 450 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 451 452 CASE ( 'pt' ) 453 IF ( k == 1 ) READ ( 13 ) tmp_3d 454 pt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 455 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 456 457 CASE ( 'pt_av' ) 458 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 459 ALLOCATE( pt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 460 ENDIF 461 IF ( k == 1 ) READ ( 13 ) tmp_3d 462 pt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 463 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 464 465 CASE ( 'pt_m' ) 466 IF ( k == 1 ) READ ( 13 ) tmp_3d 467 pt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 468 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 469 470 CASE ( 'q' ) 471 IF ( k == 1 ) READ ( 13 ) tmp_3d 472 q(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 473 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 474 475 CASE ( 'q_av' ) 476 IF ( .NOT. ALLOCATED( q_av ) ) THEN 477 ALLOCATE( q_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 478 ENDIF 479 IF ( k == 1 ) READ ( 13 ) tmp_3d 480 q_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 481 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 482 483 CASE ( 'q_m' ) 484 IF ( k == 1 ) READ ( 13 ) tmp_3d 485 q_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 486 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 487 488 CASE ( 'ql' ) 489 IF ( k == 1 ) READ ( 13 ) tmp_3d 490 ql(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 491 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 492 493 CASE ( 'ql_av' ) 494 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 495 ALLOCATE( ql_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 496 ENDIF 497 IF ( k == 1 ) READ ( 13 ) tmp_3d 498 ql_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 499 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 500 501 CASE ( 'ql_c_av' ) 502 IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN 503 ALLOCATE( ql_c_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 504 ENDIF 505 IF ( k == 1 ) READ ( 13 ) tmp_3d 506 ql_c_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 507 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 508 509 CASE ( 'ql_v_av' ) 510 IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN 511 ALLOCATE( ql_v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 512 ENDIF 513 IF ( k == 1 ) READ ( 13 ) tmp_3d 514 ql_v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 515 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 516 517 CASE ( 'ql_vp_av' ) 518 IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN 519 ALLOCATE( ql_vp_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 520 ENDIF 521 IF ( k == 1 ) READ ( 13 ) tmp_3d 522 ql_vp_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 523 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 524 525 CASE ( 'qs' ) 526 IF ( k == 1 ) READ ( 13 ) tmp_2d 527 qs(nysc-1:nync+1,nxlc-1:nxrc+1) = & 528 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 529 530 CASE ( 'qsws' ) 531 IF ( k == 1 ) READ ( 13 ) tmp_2d 532 qsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 533 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 534 535 CASE ( 'qsws_m' ) 536 IF ( k == 1 ) READ ( 13 ) tmp_2d 537 qsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 538 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 539 540 CASE ( 'qswst' ) 541 IF ( k == 1 ) READ ( 13 ) tmp_2d 542 qswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 543 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 544 545 CASE ( 'qswst_m' ) 546 IF ( k == 1 ) READ ( 13 ) tmp_2d 547 qswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 548 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 549 550 CASE ( 'qv_av' ) 551 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 552 ALLOCATE( qv_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 553 ENDIF 554 IF ( k == 1 ) READ ( 13 ) tmp_3d 555 qv_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 556 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 557 558 CASE ( 'random_iv' ) ! still unresolved issue 559 IF ( k == 1 ) READ ( 13 ) random_iv 560 IF ( k == 1 ) READ ( 13 ) random_iy 561 562 CASE ( 'rho_av' ) 563 IF ( .NOT. ALLOCATED( rho_av ) ) THEN 564 ALLOCATE( rho_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 565 ENDIF 566 IF ( k == 1 ) READ ( 13 ) tmp_3d 567 rho_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 568 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 569 570 CASE ( 'rif' ) 571 IF ( k == 1 ) READ ( 13 ) tmp_2d 572 rif(nysc-1:nync+1,nxlc-1:nxrc+1) = & 573 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 574 575 CASE ( 'rif_m' ) 576 IF ( k == 1 ) READ ( 13 ) tmp_2d 577 rif_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 578 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 579 580 CASE ( 'rif_wall' ) 581 IF ( k == 1 ) THEN 582 ALLOCATE( tmp_4d(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & 583 nxl_on_file-1:nxr_on_file+1,1:4) ) 584 READ ( 13 ) tmp_4d 585 ENDIF 586 rif_wall(:,nysc-1:nync+1,nxlc-1:nxrc+1,:) = & 653 587 tmp_4d(:,nysf-1:nynf+1,nxlf-1:nxrf+1,:) 654 DEALLOCATE( tmp_4d ) 655 656 CASE ( 's_av' ) 657 IF ( .NOT. ALLOCATED( s_av ) ) THEN 658 ALLOCATE( s_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 659 ENDIF 660 READ ( 13 ) tmp_3d 661 s_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 662 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 663 664 CASE ( 'sa' ) 665 READ ( 13 ) tmp_3d 666 sa(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 667 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 668 669 CASE ( 'sa_av' ) 670 IF ( .NOT. ALLOCATED( sa_av ) ) THEN 671 ALLOCATE( sa_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 672 ENDIF 673 READ ( 13 ) tmp_3d 674 sa_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 675 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 676 677 CASE ( 'saswsb' ) 678 READ ( 13 ) tmp_2d 679 saswsb(nysc-1:nync+1,nxlc-1:nxrc+1) = & 680 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 681 682 CASE ( 'saswst' ) 683 READ ( 13 ) tmp_2d 684 saswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 685 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 686 687 CASE ( 'shf' ) 688 READ ( 13 ) tmp_2d 689 shf(nysc-1:nync+1,nxlc-1:nxrc+1) = & 690 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 691 692 CASE ( 'shf_m' ) 693 READ ( 13 ) tmp_2d 694 shf_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 695 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 696 697 CASE ( 'spectrum_x' ) 698 READ ( 13 ) spectrum_x 699 700 CASE ( 'spectrum_y' ) 701 READ ( 13 ) spectrum_y 702 703 CASE ( 'ts' ) 704 READ ( 13 ) tmp_2d 705 ts(nysc-1:nync+1,nxlc-1:nxrc+1) = & 706 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 707 708 CASE ( 'ts_av' ) 709 IF ( .NOT. ALLOCATED( ts_av ) ) THEN 710 ALLOCATE( ts_av(nys-1:nyn+1,nxl-1:nxr+1) ) 711 ENDIF 712 READ ( 13 ) tmp_2d 713 ts_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 714 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 715 716 CASE ( 'tswst' ) 717 READ ( 13 ) tmp_2d 718 tswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 719 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 720 721 CASE ( 'tswst_m' ) 722 READ ( 13 ) tmp_2d 723 tswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 724 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 725 726 CASE ( 'u' ) 727 READ ( 13 ) tmp_3d 728 u(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 729 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 730 731 CASE ( 'u_av' ) 732 IF ( .NOT. ALLOCATED( u_av ) ) THEN 733 ALLOCATE( u_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 734 ENDIF 735 READ ( 13 ) tmp_3d 736 u_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 737 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 738 739 CASE ( 'u_m' ) 740 READ ( 13 ) tmp_3d 741 u_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 742 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 743 744 CASE ( 'u_m_l' ) 745 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1,1:2) ) 746 READ ( 13 ) tmp_3dw 747 IF ( outflow_l ) THEN 748 u_m_l(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 749 ENDIF 750 DEALLOCATE( tmp_3dw ) 751 752 CASE ( 'u_m_n' ) 753 ALLOCATE( tmp_3dw(nzb:nzt+1,ny-1:ny, & 754 nxl_on_file-1:nxr_on_file+1) ) 755 READ ( 13 ) tmp_3dw 756 IF ( outflow_n ) THEN 757 u_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 758 ENDIF 759 DEALLOCATE( tmp_3dw ) 760 761 CASE ( 'u_m_r' ) 762 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & 763 nx-1:nx) ) 764 READ ( 13 ) tmp_3dw 765 IF ( outflow_r ) THEN 766 u_m_r(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 767 ENDIF 768 DEALLOCATE( tmp_3dw ) 769 770 CASE ( 'u_m_s' ) 771 ALLOCATE( tmp_3dw(nzb:nzt+1,0:1, & 772 nxl_on_file-1:nxr_on_file+1) ) 773 READ ( 13 ) tmp_3dw 774 IF ( outflow_s ) THEN 775 u_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 776 ENDIF 777 DEALLOCATE( tmp_3dw ) 778 779 CASE ( 'us' ) 780 READ ( 13 ) tmp_2d 781 us(nysc-1:nync+1,nxlc-1:nxrc+1) = & 782 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 783 784 CASE ( 'usws' ) 785 READ ( 13 ) tmp_2d 786 usws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 787 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 788 789 CASE ( 'uswst' ) 790 READ ( 13 ) tmp_2d 791 uswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 792 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 793 794 CASE ( 'usws_m' ) 795 READ ( 13 ) tmp_2d 796 usws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 797 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 798 799 CASE ( 'uswst_m' ) 800 READ ( 13 ) tmp_2d 801 uswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 802 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 803 804 CASE ( 'us_av' ) 805 IF ( .NOT. ALLOCATED( us_av ) ) THEN 806 ALLOCATE( us_av(nys-1:nyn+1,nxl-1:nxr+1) ) 807 ENDIF 808 READ ( 13 ) tmp_2d 809 us_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 810 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 811 812 CASE ( 'v' ) 813 READ ( 13 ) tmp_3d 814 v(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 815 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 816 817 CASE ( 'v_av' ) 818 IF ( .NOT. ALLOCATED( v_av ) ) THEN 819 ALLOCATE( v_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 820 ENDIF 821 READ ( 13 ) tmp_3d 822 v_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 823 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 824 825 CASE ( 'v_m' ) 826 READ ( 13 ) tmp_3d 827 v_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 828 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 829 830 CASE ( 'v_m_l' ) 831 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1,0:1) ) 832 READ ( 13 ) tmp_3dw 833 IF ( outflow_l ) THEN 834 v_m_l(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 835 ENDIF 836 DEALLOCATE( tmp_3dw ) 837 838 CASE ( 'v_m_n' ) 839 ALLOCATE( tmp_3dw(nzb:nzt+1,ny-1:ny, & 840 nxl_on_file-1:nxr_on_file+1) ) 841 READ ( 13 ) tmp_3dw 842 IF ( outflow_n ) THEN 843 v_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 844 ENDIF 845 DEALLOCATE( tmp_3dw ) 846 847 CASE ( 'v_m_r' ) 848 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & 849 nx-1:nx) ) 850 READ ( 13 ) tmp_3dw 851 IF ( outflow_r ) THEN 852 v_m_r(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 853 ENDIF 854 DEALLOCATE( tmp_3dw ) 855 856 CASE ( 'v_m_s' ) 857 ALLOCATE( tmp_3dw(nzb:nzt+1,1:2, & 858 nxl_on_file-1:nxr_on_file+1) ) 859 READ ( 13 ) tmp_3dw 860 IF ( outflow_s ) THEN 861 v_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 862 ENDIF 863 DEALLOCATE( tmp_3dw ) 864 865 CASE ( 'vpt' ) 866 READ ( 13 ) tmp_3d 867 vpt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 868 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 869 870 CASE ( 'vpt_av' ) 871 IF ( .NOT. ALLOCATED( vpt_av ) ) THEN 872 ALLOCATE( vpt_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 873 ENDIF 874 READ ( 13 ) tmp_3d 875 vpt_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 876 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 877 878 CASE ( 'vpt_m' ) 879 READ ( 13 ) tmp_3d 880 vpt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 881 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 882 883 CASE ( 'vsws' ) 884 READ ( 13 ) tmp_2d 885 vsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 886 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 887 888 CASE ( 'vswst' ) 889 READ ( 13 ) tmp_2d 890 vswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 891 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 892 893 CASE ( 'vsws_m' ) 894 READ ( 13 ) tmp_2d 895 vsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 896 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 897 898 CASE ( 'vswst_m' ) 899 READ ( 13 ) tmp_2d 900 vswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 901 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 902 903 CASE ( 'w' ) 904 READ ( 13 ) tmp_3d 905 w(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 906 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 907 908 CASE ( 'w_av' ) 909 IF ( .NOT. ALLOCATED( w_av ) ) THEN 910 ALLOCATE( w_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 911 ENDIF 912 READ ( 13 ) tmp_3d 913 w_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 914 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 915 916 CASE ( 'w_m' ) 917 READ ( 13 ) tmp_3d 918 w_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 919 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 920 921 CASE ( 'w_m_l' ) 922 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1,0:1) ) 923 READ ( 13 ) tmp_3dw 924 IF ( outflow_l ) THEN 925 w_m_l(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 926 ENDIF 927 DEALLOCATE( tmp_3dw ) 928 929 CASE ( 'w_m_n' ) 930 ALLOCATE( tmp_3dw(nzb:nzt+1,ny-1:ny, & 931 nxl_on_file-1:nxr_on_file+1) ) 932 READ ( 13 ) tmp_3dw 933 IF ( outflow_n ) THEN 934 w_m_n(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 935 ENDIF 936 DEALLOCATE( tmp_3dw ) 937 938 CASE ( 'w_m_r' ) 939 ALLOCATE( tmp_3dw(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & 940 nx-1:nx) ) 941 READ ( 13 ) tmp_3dw 942 IF ( outflow_r ) THEN 943 w_m_r(:,nysc-1:nync+1,:) = tmp_3dw(:,nysf-1:nynf+1,:) 944 ENDIF 945 DEALLOCATE( tmp_3dw ) 946 947 CASE ( 'w_m_s' ) 948 ALLOCATE( tmp_3dw(nzb:nzt+1,0:1, & 949 nxl_on_file-1:nxr_on_file+1) ) 950 READ ( 13 ) tmp_3dw 951 IF ( outflow_s ) THEN 952 w_m_s(:,:,nxlc-1:nxrc+1) = tmp_3dw(:,:,nxlf-1:nxrf+1) 953 ENDIF 954 DEALLOCATE( tmp_3dw ) 955 956 CASE ( 'z0' ) 957 READ ( 13 ) tmp_2d 958 z0(nysc-1:nync+1,nxlc-1:nxrc+1) = & 959 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 960 961 CASE ( 'z0_av' ) 962 IF ( .NOT. ALLOCATED( z0_av ) ) THEN 963 ALLOCATE( z0_av(nys-1:nyn+1,nxl-1:nxr+1) ) 964 ENDIF 965 READ ( 13 ) tmp_2d 966 z0_av(nysc-1:nync+1,nxlc-1:nxrc+1) = & 967 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 968 969 CASE DEFAULT 970 PRINT*, '+++ read_3d_binary: unknown field named "', & 971 TRIM( field_chr ), '" found in' 972 PRINT*, ' data from prior run on PE ', myid 973 CALL local_stop 974 975 END SELECT 588 589 CASE ( 's_av' ) 590 IF ( .NOT. ALLOCATED( s_av ) ) THEN 591 ALLOCATE( s_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 592 ENDIF 593 IF ( k == 1 ) READ ( 13 ) tmp_3d 594 s_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 595 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 596 597 CASE ( 'sa' ) 598 IF ( k == 1 ) READ ( 13 ) tmp_3d 599 sa(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 600 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 601 602 CASE ( 'sa_av' ) 603 IF ( .NOT. ALLOCATED( sa_av ) ) THEN 604 ALLOCATE( sa_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 605 ENDIF 606 IF ( k == 1 ) READ ( 13 ) tmp_3d 607 sa_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 608 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 609 610 CASE ( 'saswsb' ) 611 IF ( k == 1 ) READ ( 13 ) tmp_2d 612 saswsb(nysc-1:nync+1,nxlc-1:nxrc+1) = & 613 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 614 615 CASE ( 'saswst' ) 616 IF ( k == 1 ) READ ( 13 ) tmp_2d 617 saswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 618 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 619 620 CASE ( 'shf' ) 621 IF ( k == 1 ) READ ( 13 ) tmp_2d 622 shf(nysc-1:nync+1,nxlc-1:nxrc+1) = & 623 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 624 625 CASE ( 'shf_m' ) 626 IF ( k == 1 ) READ ( 13 ) tmp_2d 627 shf_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 628 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 629 630 CASE ( 'spectrum_x' ) 631 IF ( k == 1 ) THEN 632 IF ( nx_on_file /= nx ) THEN 633 IF ( myid == 0 ) THEN 634 PRINT*, '+++ WARNING: read_3d_binary: spectrum_x', & 635 ' on restart file ignored because' 636 PRINT*, ' total numbers of grid points (nx) ', & 637 'do not match' 638 ENDIF 639 READ ( 13 ) rdummy 640 ELSE 641 READ ( 13 ) spectrum_x 642 ENDIF 643 ENDIF 644 645 CASE ( 'spectrum_y' ) 646 IF ( k == 1 ) THEN 647 IF ( ny_on_file /= ny ) THEN 648 IF ( myid == 0 ) THEN 649 PRINT*, '+++ WARNING: read_3d_binary: spectrum_y', & 650 ' on restart file ignored because' 651 PRINT*, ' total numbers of grid points (ny) ', & 652 'do not match' 653 ENDIF 654 READ ( 13 ) rdummy 655 ELSE 656 READ ( 13 ) spectrum_y 657 ENDIF 658 ENDIF 659 660 CASE ( 'ts' ) 661 IF ( k == 1 ) READ ( 13 ) tmp_2d 662 ts(nysc-1:nync+1,nxlc-1:nxrc+1) = & 663 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 664 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) = & 671 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 672 673 CASE ( 'tswst' ) 674 IF ( k == 1 ) READ ( 13 ) tmp_2d 675 tswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 676 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 677 678 CASE ( 'tswst_m' ) 679 IF ( k == 1 ) READ ( 13 ) tmp_2d 680 tswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 681 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 682 683 CASE ( 'u' ) 684 IF ( k == 1 ) READ ( 13 ) tmp_3d 685 u(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 686 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 687 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) = & 694 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 695 696 CASE ( 'u_m' ) 697 IF ( k == 1 ) READ ( 13 ) tmp_3d 698 u_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 699 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 700 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 710 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 720 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 730 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 740 741 CASE ( 'us' ) 742 IF ( k == 1 ) READ ( 13 ) tmp_2d 743 us(nysc-1:nync+1,nxlc-1:nxrc+1) = & 744 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 745 746 CASE ( 'usws' ) 747 IF ( k == 1 ) READ ( 13 ) tmp_2d 748 usws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 749 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 750 751 CASE ( 'uswst' ) 752 IF ( k == 1 ) READ ( 13 ) tmp_2d 753 uswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 754 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 755 756 CASE ( 'usws_m' ) 757 IF ( k == 1 ) READ ( 13 ) tmp_2d 758 usws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 759 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 760 761 CASE ( 'uswst_m' ) 762 IF ( k == 1 ) READ ( 13 ) tmp_2d 763 uswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 764 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 765 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) = & 772 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 773 774 CASE ( 'v' ) 775 IF ( k == 1 ) READ ( 13 ) tmp_3d 776 v(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 777 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 778 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) = & 785 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 786 787 CASE ( 'v_m' ) 788 IF ( k == 1 ) READ ( 13 ) tmp_3d 789 v_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 790 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 791 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 801 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 811 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 821 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 831 832 CASE ( 'vpt' ) 833 IF ( k == 1 ) READ ( 13 ) tmp_3d 834 vpt(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 835 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 836 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) = & 843 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 844 845 CASE ( 'vpt_m' ) 846 IF ( k == 1 ) READ ( 13 ) tmp_3d 847 vpt_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 848 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 849 850 CASE ( 'vsws' ) 851 IF ( k == 1 ) READ ( 13 ) tmp_2d 852 vsws(nysc-1:nync+1,nxlc-1:nxrc+1) = & 853 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 854 855 CASE ( 'vswst' ) 856 IF ( k == 1 ) READ ( 13 ) tmp_2d 857 vswst(nysc-1:nync+1,nxlc-1:nxrc+1) = & 858 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 859 860 CASE ( 'vsws_m' ) 861 IF ( k == 1 ) READ ( 13 ) tmp_2d 862 vsws_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 863 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 864 865 CASE ( 'vswst_m' ) 866 IF ( k == 1 ) READ ( 13 ) tmp_2d 867 vswst_m(nysc-1:nync+1,nxlc-1:nxrc+1) = & 868 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 869 870 CASE ( 'w' ) 871 IF ( k == 1 ) READ ( 13 ) tmp_3d 872 w(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 873 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 874 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) = & 881 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 882 883 CASE ( 'w_m' ) 884 IF ( k == 1 ) READ ( 13 ) tmp_3d 885 w_m(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 886 tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 887 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 897 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 907 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 917 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 ) 928 929 CASE ( 'z0' ) 930 IF ( k == 1 ) READ ( 13 ) tmp_2d 931 z0(nysc-1:nync+1,nxlc-1:nxrc+1) = & 932 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 933 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) = & 940 tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1) 941 942 CASE DEFAULT 943 PRINT*, '+++ read_3d_binary: unknown field named "', & 944 TRIM( field_chr ), '" found in' 945 PRINT*, ' data from prior run on PE ',myid 946 CALL local_stop 947 948 END SELECT 949 950 ENDDO ! overlap loop 951 952 ! 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 976 968 ! 977 969 !-- Read next character string … … 982 974 ! 983 975 !-- Read user-defined restart data 984 CALL user_read_restart_data( nxlc, nxlf, nxl_on_file, nxrc, nxrf, & 985 nxr_on_file, nync, nynf, nyn_on_file, & 986 nysc, nysf, nys_on_file, tmp_2d, tmp_3d ) 976 CALL user_read_restart_data( 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), & 979 tmp_2d, tmp_3d ) 987 980 988 981 ! -
palm/trunk/SOURCE/read_var_list.f90
r198 r216 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! 6 ! limitations for nx_on_file, ny_on_file removed (read_parts_of_var_list) 7 7 ! 8 8 ! Former revisions: … … 725 725 CASE ( 'nx' ) 726 726 READ ( 13 ) nx_on_file 727 IF ( nx_on_file < ( nxr - nxl ) ) THEN728 PRINT*, '+++ read_parts_of_var_list: total domain along x on', &729 ' restart file is smaller than current subdomain'730 PRINT*, ' nx on file = ', nx_on_file731 PRINT*, ' nxr - nxl = ', nxr - nxl732 CALL local_stop733 ENDIF734 727 735 728 CASE ( 'ny' ) 736 729 READ ( 13 ) ny_on_file 737 IF ( ny_on_file < ( nyn - nys ) ) THEN738 PRINT*, '+++ read_parts_of_var_list: total domain along y on', &739 ' restart file is smaller than current subdomain'740 PRINT*, ' ny on file = ', ny_on_file741 PRINT*, ' nyn - nys = ', nyn - nys742 CALL local_stop743 ENDIF744 730 745 731 -
palm/trunk/SOURCE/user_read_restart_data.f90
r211 r216 1 SUBROUTINE user_read_restart_data( nxlc, nxlf, nxl_on_file, nxrc, nxrf, & 2 nxr_on_file, nync, nynf, nyn_on_file, & 3 nysc, nysf, nys_on_file, tmp_2d, tmp_3d ) 1 SUBROUTINE user_read_restart_data( nxlfa, nxl_on_file, nxrfa, nxr_on_file, & 2 nynfa, nyn_on_file, nysfa, nys_on_file, & 3 offset_xa, offset_ya, overlap_count, & 4 tmp_2d, tmp_3d ) 4 5 5 6 !------------------------------------------------------------------------------! 6 7 ! Actual revisions: 7 8 ! ----------------- 8 ! Former file user_interface.f90 split into one file per subroutine 9 ! reading mechanism revised (subdomain/total domain size can vary arbitrarily 10 ! between current and previous run), 11 ! former file user_interface.f90 split into one file per subroutine 9 12 ! 10 13 ! Former revisions: … … 30 33 CHARACTER (LEN=20) :: field_char 31 34 32 INTEGER :: nxlc, nxlf, nxl_on_file, nxrc, nxrf, nxr_on_file, nync, nynf, & 33 nyn_on_file, nysc, nysf, nys_on_file 35 INTEGER :: k, nxlc, nxlf, nxl_on_file, nxrc, nxrf, nxr_on_file, nync, & 36 nynf, nyn_on_file, nysc, nysf, nys_on_file, overlap_count 37 38 INTEGER, DIMENSION(numprocs_previous_run,1000) :: nxlfa, nxrfa, nynfa, & 39 nysfa, offset_xa, & 40 offset_ya 34 41 35 42 REAL, DIMENSION(nys_on_file-1:nyn_on_file+1,nxl_on_file-1:nxr_on_file+1) ::& … … 48 55 ! DO WHILE ( TRIM( field_char ) /= '*** end user ***' ) 49 56 ! 50 ! SELECT CASE ( TRIM( field_char ) )57 ! DO k = 1, overlap_count 51 58 ! 52 ! CASE ( 'u2_av' ) 53 ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN 54 ! ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 55 ! ENDIF 56 ! READ ( 13 ) tmp_3d 57 ! u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 59 ! nxlf = nxlfa(i,k) 60 ! nxlc = nxlfa(i,k) + offset_xa(i,k) 61 ! nxrf = nxrfa(i,k) 62 ! nxrc = nxrfa(i,k) + offset_xa(i,k) 63 ! nysf = nysfa(i,k) 64 ! nysc = nysfa(i,k) + offset_ya(i,k) 65 ! nynf = nynfa(i,k) 66 ! nync = nynfa(i,k) + offset_ya(i,k) 67 ! 68 ! 69 ! SELECT CASE ( TRIM( field_char ) ) 70 ! 71 ! CASE ( 'u2_av' ) 72 ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN 73 ! ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 74 ! ENDIF 75 ! IF ( k == 1 ) READ ( 13 ) tmp_3d 76 ! u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & 58 77 ! tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) 59 78 ! 60 ! CASE DEFAULT61 ! PRINT*, '+++ user_init: unknown variable named "', &62 ! TRIM( field_char ), '" found in'63 ! PRINT*, ' data from prior run on PE ', myid64 ! CALL local_stop79 ! CASE DEFAULT 80 ! PRINT*, '+++ user_init: unknown variable named "', & 81 ! TRIM( field_char ), '" found in' 82 ! PRINT*, ' data from prior run on PE ', myid 83 ! CALL local_stop 65 84 ! 66 ! END SELECT 85 ! END SELECT 86 ! 87 ! ENDDO 67 88 ! 68 89 ! READ ( 13 ) field_char
Note: See TracChangeset
for help on using the changeset viewer.