Changeset 1738 for palm/trunk/SOURCE/init_3d_model.f90
- Timestamp:
- Dec 18, 2015 1:56:05 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_3d_model.f90
r1735 r1738 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! calculate mean surface level height for each statistic region 22 22 ! 23 23 ! Former revisions: … … 273 273 274 274 USE statistics, & 275 ONLY: hom, hom_sum, pr_palm, rmask, spectrum_x, spectrum_y,&276 s tatistic_regions, sums, sums_divnew_l, sums_divold_l, sums_l,&277 sums_ l_l, sums_up_fraction_l, sums_wsts_bc_l, ts_value,&278 var_d, weight_pres, weight_substep275 ONLY: hom, hom_sum, mean_surface_level_height, pr_palm, rmask, & 276 spectrum_x, spectrum_y, statistic_regions, sums, sums_divnew_l, & 277 sums_divold_l, sums_l, sums_l_l, sums_up_fraction_l, & 278 sums_wsts_bc_l, ts_value, var_d, weight_pres, weight_substep 279 279 280 280 USE surface_layer_fluxes_mod, & … … 299 299 REAL(wp), DIMENSION(1:2) :: volume_flow_initial_l !< 300 300 301 REAL(wp), DIMENSION(:), ALLOCATABLE :: mean_surface_level_height_l !< 301 302 REAL(wp), DIMENSION(:), ALLOCATABLE :: ngp_3d_inner_l !< 302 303 REAL(wp), DIMENSION(:), ALLOCATABLE :: ngp_3d_inner_tmp !< … … 306 307 ! 307 308 !-- Allocate arrays 308 ALLOCATE( ngp_2dh(0:statistic_regions), ngp_2dh_l(0:statistic_regions), & 309 ALLOCATE( mean_surface_level_height(0:statistic_regions), & 310 mean_surface_level_height_l(0:statistic_regions), & 311 ngp_2dh(0:statistic_regions), ngp_2dh_l(0:statistic_regions), & 309 312 ngp_3d(0:statistic_regions), & 310 313 ngp_3d_inner(0:statistic_regions), & … … 1820 1823 ! 1821 1824 !-- Compute total sum of active mask grid points 1825 !-- and the mean surface level height for each statistic region 1822 1826 !-- ngp_2dh: number of grid points of a horizontal cross section through the 1823 1827 !-- total domain … … 1834 1838 ngp_sums = ( nz + 2 ) * ( pr_palm + max_pr_user ) 1835 1839 1840 mean_surface_level_height = 0.0_wp 1841 mean_surface_level_height_l = 0.0_wp 1842 1836 1843 DO sr = 0, statistic_regions 1837 1844 DO i = nxl, nxr … … 1841 1848 !-- All xy-grid points 1842 1849 ngp_2dh_l(sr) = ngp_2dh_l(sr) + 1 1850 mean_surface_level_height_l(sr) = mean_surface_level_height_l(sr) + & 1851 zw(nzb_s_inner(j,i)) 1843 1852 ! 1844 1853 !-- xy-grid points above topography … … 1873 1882 MPI_SUM, comm2d, ierr ) 1874 1883 ngp_3d_inner = INT( ngp_3d_inner_tmp, KIND = SELECTED_INT_KIND( 18 ) ) 1884 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 1885 CALL MPI_ALLREDUCE( mean_surface_level_height_l(0), & 1886 mean_surface_level_height(0), sr, MPI_REAL, & 1887 MPI_SUM, comm2d, ierr ) 1888 mean_surface_level_height = mean_surface_level_height / REAL( ngp_2dh ) 1875 1889 #else 1876 1890 ngp_2dh = ngp_2dh_l … … 1878 1892 ngp_2dh_s_inner = ngp_2dh_s_inner_l 1879 1893 ngp_3d_inner = INT( ngp_3d_inner_l, KIND = SELECTED_INT_KIND( 18 ) ) 1894 mean_surface_level_height = mean_surface_level_height_l / REAL( ngp_2dh_l ) 1880 1895 #endif 1881 1896 … … 1892 1907 ngp_2dh_s_inner = MAX( 1, ngp_2dh_s_inner(:,:) ) 1893 1908 1894 DEALLOCATE( ngp_2dh_l, ngp_2dh_outer_l, ngp_3d_inner_l, ngp_3d_inner_tmp ) 1909 DEALLOCATE( mean_surface_level_height_l, ngp_2dh_l, ngp_2dh_outer_l, & 1910 ngp_3d_inner_l, ngp_3d_inner_tmp ) 1895 1911 1896 1912 CALL location_message( 'leaving init_3d_model', .TRUE. )
Note: See TracChangeset
for help on using the changeset viewer.