Changeset 4168 for palm/trunk/SOURCE/init_grid.f90
- Timestamp:
- Aug 16, 2019 1:50:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_grid.f90
r4159 r4168 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Pre-calculate topography top index and store it on an array (replaces former 28 ! functions get_topography_top_index) 29 ! 30 ! 4159 2019-08-15 13:31:35Z suehring 27 31 ! Revision of topography processing. This was not consistent between 2D and 3D 28 32 ! buildings. … … 420 424 nzb_max, nzb_s_inner, nzb_s_outer, nzb_u_inner, & 421 425 nzb_u_outer, nzb_v_inner, nzb_v_outer, nzb_w_inner, & 422 nzb_w_outer, nzt, topo_ min_level426 nzb_w_outer, nzt, topo_top_ind, topo_min_level 423 427 424 428 USE kinds … … 429 433 430 434 USE surface_mod, & 431 ONLY: get_topography_top_index, get_topography_top_index_ji,init_bc435 ONLY: init_bc 432 436 433 437 USE vertical_nesting_mod, & … … 919 923 topo_min_level = 0 920 924 #if defined( __parallel ) 921 CALL MPI_ALLREDUCE( MINVAL( get_topography_top_index( 's') ), &925 CALL MPI_ALLREDUCE( MINVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ), & 922 926 topo_min_level, 1, MPI_INTEGER, MPI_MIN, comm2d, ierr ) 923 927 #else 924 topo_min_level = MINVAL( get_topography_top_index( 's') )928 topo_min_level = MINVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ) 925 929 #endif 926 930 ! … … 960 964 !-- Topography height on scalar grid. Therefore, determine index of 961 965 !-- upward-facing surface element on scalar grid. 962 zu_s_inner(i,j) = zu( get_topography_top_index_ji( j, i, 's' ))966 zu_s_inner(i,j) = zu(topo_top_ind(j,i,0)) 963 967 ! 964 968 !-- Topography height on w grid. Therefore, determine index of 965 969 !-- upward-facing surface element on w grid. 966 zw_w_inner(i,j) = zw( get_topography_top_index_ji( j, i, 's' ))970 zw_w_inner(i,j) = zw(topo_top_ind(j,i,3)) 967 971 ENDDO 968 972 ENDDO … … 988 992 ! 989 993 !-- Initialize 2D-index arrays. Note, these will be removed soon! 990 nzb_local(nys:nyn,nxl:nxr) = get_topography_top_index( 's')994 nzb_local(nys:nyn,nxl:nxr) = topo_top_ind(nys:nyn,nxl:nxr,0) 991 995 CALL exchange_horiz_2d_int( nzb_local, nys, nyn, nxl, nxr, nbgp ) 992 996 ! … … 996 1000 IF ( TRIM( topography ) /= 'flat' ) THEN 997 1001 #if defined( __parallel ) 998 CALL MPI_ALLREDUCE( MAXVAL( get_topography_top_index( 's') ), &1002 CALL MPI_ALLREDUCE( MAXVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ), & 999 1003 nzb_local_max, 1, MPI_INTEGER, MPI_MAX, comm2d, ierr ) 1000 1004 #else 1001 nzb_local_max = MAXVAL( get_topography_top_index( 's') )1005 nzb_local_max = MAXVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ) 1002 1006 #endif 1003 1007 nzb_local_min = topo_min_level … … 2017 2021 USE pegrid 2018 2022 2019 USE surface_mod, &2020 ONLY: get_topography_top_index, get_topography_top_index_ji2021 2022 2023 IMPLICIT NONE 2023 2024 … … 2572 2573 USE indices, & 2573 2574 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb, & 2574 nzt, wall_flags_02575 nzt, topo_top_ind, wall_flags_0 2575 2576 2576 2577 USE kinds … … 2579 2580 2580 2581 INTEGER(iwp) :: i !< index variable along x 2582 INTEGER(iwp) :: ibit !< integer bit position of topgraphy masking array 2581 2583 INTEGER(iwp) :: j !< index variable along y 2582 2584 INTEGER(iwp) :: k !< index variable along z … … 2885 2887 ENDIF 2886 2888 ENDIF 2887 2889 ! 2890 !-- Pre-calculate topography top indices (former get_topography_top_index 2891 !-- function) 2892 ALLOCATE( topo_top_ind(nysg:nyng,nxlg:nxrg,0:4) ) 2893 ! 2894 !-- Uppermost topography index on scalar grid 2895 ibit = 12 2896 topo_top_ind(:,:,0) = MAXLOC( & 2897 MERGE( 1, 0, & 2898 BTEST( wall_flags_0(:,:,:), ibit ) & 2899 ), DIM = 1 & 2900 ) - 1 2901 ! 2902 !-- Uppermost topography index on u grid 2903 ibit = 14 2904 topo_top_ind(:,:,1) = MAXLOC( & 2905 MERGE( 1, 0, & 2906 BTEST( wall_flags_0(:,:,:), ibit ) & 2907 ), DIM = 1 & 2908 ) - 1 2909 ! 2910 !-- Uppermost topography index on v grid 2911 ibit = 16 2912 topo_top_ind(:,:,2) = MAXLOC( & 2913 MERGE( 1, 0, & 2914 BTEST( wall_flags_0(:,:,:), ibit ) & 2915 ), DIM = 1 & 2916 ) - 1 2917 ! 2918 !-- Uppermost topography index on w grid 2919 ibit = 18 2920 topo_top_ind(:,:,3) = MAXLOC( & 2921 MERGE( 1, 0, & 2922 BTEST( wall_flags_0(:,:,:), ibit ) & 2923 ), DIM = 1 & 2924 ) - 1 2925 ! 2926 !-- Uppermost topography index on scalar outer grid 2927 ibit = 24 2928 topo_top_ind(:,:,4) = MAXLOC( & 2929 MERGE( 1, 0, & 2930 BTEST( wall_flags_0(:,:,:), ibit ) & 2931 ), DIM = 1 & 2932 ) - 1 2888 2933 2889 2934 END SUBROUTINE set_topo_flags
Note: See TracChangeset
for help on using the changeset viewer.