Changeset 4212


Ignore:
Timestamp:
Sep 2, 2019 2:23:05 PM (23 months ago)
Author:
suehring
Message:

Allocate array for index lists in nesting also for zero-size arrays, in order to avoid error when array bound checks are enabled

File:
1 edited

Legend:

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

    r4182 r4212  
    2121! Current revisions:
    2222! ------------------
    23 !
     23! Allocate array for index_list_2d also for zero-size arrays, in order to 
     24! avoid errors when array bound checks are enabled
    2425!
    2526! Former revisions:
     
    221222           IF ( ip == 0 )  THEN
    222223              indchildren(childid)%nrpoints = ian
     224!
     225!--           Allocate array for index_list_2d. Note, the array will also be
     226!--           allocated in case ian=0, in order to avoid errors when
     227!--           array bounds are checked.
     228              ALLOCATE( indchildren(childid)%index_list_2d(6,1:ian) )
    223229              IF ( ian > 0)  THEN
    224                   ALLOCATE( indchildren(childid)%index_list_2d(6,ian) )
    225230                  indchildren(childid)%index_list_2d(:,1:ian) =                &
    226231                                                             index_list(:,is:ie)
     
    240245                       m_model_comm, MPI_STATUS_IGNORE, istat )
    241246        ian = indchildren(childid)%nrpoints
     247!
     248!--     Allocate array for index_list_2d. Note, the array will also be
     249!--     allocated in case ian=0, in order to avoid errors when
     250!--     array bounds are checked.
     251        ALLOCATE( indchildren(childid)%index_list_2d(6,1:ian) )
    242252        IF ( ian > 0 )  THEN
    243            ALLOCATE( indchildren(childid)%index_list_2d(6,ian) )
    244253           CALL MPI_RECV( indchildren(childid)%index_list_2d, 6*ian,           &
    245254                          MPI_INTEGER, 0, 1001, m_model_comm,                  &
Note: See TracChangeset for help on using the changeset viewer.