Changeset 4104 for palm/trunk/SOURCE
- Timestamp:
- Jul 17, 2019 5:08:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/surface_mod.f90
r4102 r4104 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Bugfix, initialization of index space for boundary data structure accidantly 29 ! run over ghost points, causing a segmentation fault. 30 ! 31 ! 3943 2019-05-02 09:50:41Z maronga 28 32 ! - Revise initialization of the boundary data structure 29 33 ! - Add new data structure to set boundary conditions at vertical walls … … 747 751 !-- Initialize data structure for horizontal surfaces, i.e. count the number 748 752 !-- of surface elements, allocate and initialize the respective index arrays, 749 !-- and set the respective start and end indices at each (j,i)-location. 753 !-- and set the respective start and end indices at each (j,i)-location. 754 !-- The index space is defined also over the ghost points, so that e.g. 755 !-- boundary conditions for diagnostic quanitities can be set on ghost 756 !-- points so that no exchange is required any more. 750 757 DO l = 0, 1 751 758 ! … … 819 826 !-- Count the number of upward- and downward-facing surfaces on subdomain 820 827 num_v(l) = 0 821 DO i = nxl g, nxrg822 DO j = nys g, nyng828 DO i = nxl, nxr 829 DO j = nys, nyn 823 830 DO k = nzb+1, nzt 824 831 ! … … 837 844 bc_v(l)%ns = num_v(l) 838 845 ! 839 !-- ALLOCATE arrays for horizontal surfaces 846 !-- ALLOCATE arrays for horizontal surfaces. In contrast to the 847 !-- horizontal surfaces, the index space is not defined over the 848 !-- ghost points. 840 849 ALLOCATE( bc_v(l)%i(1:bc_v(l)%ns) ) 841 850 ALLOCATE( bc_v(l)%j(1:bc_v(l)%ns) ) 842 851 ALLOCATE( bc_v(l)%k(1:bc_v(l)%ns) ) 843 ALLOCATE( bc_v(l)%start_index(nys g:nyng,nxlg:nxrg) )844 ALLOCATE( bc_v(l)%end_index(nys g:nyng,nxlg:nxrg) )852 ALLOCATE( bc_v(l)%start_index(nys:nyn,nxl:nxr) ) 853 ALLOCATE( bc_v(l)%end_index(nys:nyn,nxl:nxr) ) 845 854 bc_v(l)%start_index = 1 846 855 bc_v(l)%end_index = 0 … … 848 857 num_v(l) = 1 849 858 start_index_v(l) = 1 850 DO i = nxl g, nxrg851 DO j = nys g, nyng859 DO i = nxl, nxr 860 DO j = nys, nyn 852 861 853 862 num_v_kji(l) = 0
Note: See TracChangeset
for help on using the changeset viewer.