Changeset 4104 for palm


Ignore:
Timestamp:
Jul 17, 2019 5:08:20 PM (22 months ago)
Author:
suehring
Message:

initialization of index space for boundary data structure accidantly run over ghost points, causing a segmentation fault

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/surface_mod.f90

    r4102 r4104  
    2626! -----------------
    2727! $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
    2832! - Revise initialization of the boundary data structure
    2933! - Add new data structure to set boundary conditions at vertical walls
     
    747751!--    Initialize data structure for horizontal surfaces, i.e. count the number
    748752!--    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.
    750757       DO  l = 0, 1
    751758!
     
    819826!--       Count the number of upward- and downward-facing surfaces on subdomain
    820827          num_v(l) = 0
    821           DO  i = nxlg, nxrg
    822              DO  j = nysg, nyng
     828          DO  i = nxl, nxr
     829             DO  j = nys, nyn
    823830                DO  k = nzb+1, nzt
    824831!         
     
    837844          bc_v(l)%ns = num_v(l)
    838845!
    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.
    840849          ALLOCATE( bc_v(l)%i(1:bc_v(l)%ns) )
    841850          ALLOCATE( bc_v(l)%j(1:bc_v(l)%ns) )
    842851          ALLOCATE( bc_v(l)%k(1:bc_v(l)%ns) )
    843           ALLOCATE( bc_v(l)%start_index(nysg:nyng,nxlg:nxrg) )
    844           ALLOCATE( bc_v(l)%end_index(nysg: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)   )
    845854          bc_v(l)%start_index = 1
    846855          bc_v(l)%end_index   = 0
     
    848857          num_v(l)         = 1
    849858          start_index_v(l) = 1
    850           DO  i = nxlg, nxrg
    851              DO  j = nysg, nyng
     859          DO  i = nxl, nxr
     860             DO  j = nys, nyn
    852861         
    853862                num_v_kji(l) = 0
Note: See TracChangeset for help on using the changeset viewer.