Opened 15 years ago

Closed 15 years ago

#350 closed bug (Fixed)

set_data: subscript out of range

Reported by: kate Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.3
Component: Nonlinear Version: 3.3
Keywords: Cc:

Description

This code:

 726       IF (SOUTH_WEST_TEST) THEN
 727 #   ifdef WEST_FSOBC
 728         DO j=JLB,JUB
 729           cff=Dcrit(ng)-GRID(ng)%h(0,j)
 730           IF (BOUNDARY(ng)%zeta_west(j).le.cff) THEN
 731             BOUNDARY(ng)%zeta_west(j)=cff
 732           END IF
 733         END DO
 734 #   endif

becomes:

   292       IF (.true.) THEN
    293         DO j=JLB,JUB
    294           cff=Dcrit(ng)-GRID(ng)%h(0,j)
    295           IF (BOUNDARY(ng)%zeta_west(j).le.cff) THEN
    296             BOUNDARY(ng)%zeta_west(j)=cff
    297           END IF
    298         END DO

running in parallel, I get:

0: Subscript out of range for array grid%h (set_data.f90: 294)
    subscript=0, lower bound=159, upper bound=242, dimension=2
0: Subscript out of range for array grid%h (set_data.f90: 294)
    subscript=83, lower bound=0, upper bound=82, dimension=2
0: Subscript out of range for array grid%h (set_data.f90: 294)
    subscript=0, lower bound=559, upper bound=642, dimension=2

and so on.

Change History (1)

comment:1 by arango, 15 years ago

Resolution: Fixed
Status: newclosed

Yes, great catch! This is a nasty parallel bug. We nee to have instead:

#   ifdef WEST_FSOBC
      bry_update=.FALSE.
      IF (WESTERN_EDGE) THEN
        DO j=JstrR,JendR
          cff=Dcrit(ng)-GRID(ng)%h(0,j)
          IF (BOUNDARY(ng)%zeta_west(j).le.cff) THEN
            BOUNDARY(ng)%zeta_west(j)=cff
          END IF
        END DO
        bry_update=.TRUE.
      END IF
#    ifdef DISTRIBUTE
      CALL mp_boundary (ng, iNLM, JstrR, JendR, JLB, JUB, 1, 1,         &
     &                  bry_update,                                     &
     &                  BOUNDARY(ng)%zeta_west)
#    endif
#   endif

#   ifdef EAST_FSOBC
      bry_update=.FALSE.
      IF (EASTERN_EDGE) THEN
        DO j=JstrR,JendR
          cff=Dcrit(ng)-GRID(ng)%h(Lm(ng)+1,j)
          IF (BOUNDARY(ng)%zeta_east(j).le.cff) THEN
            BOUNDARY(ng)%zeta_east(j)=cff
          END IF
        END DO
        bry_update=.TRUE.
      END IF
#    ifdef DISTRIBUTE
      CALL mp_boundary (ng, iNLM, JstrR, JendR, JLB, JUB, 1, 1,         &
     &                  bry_update,                                     &
     &                  BOUNDARY(ng)%zeta_east)
#    endif
#   endif

#   ifdef SOUTH_FSOBC
      bry_update=.FALSE.
      IF (SOUTHERN_EDGE) THEN
        DO i=IstrR,IendR
          cff=Dcrit(ng)-GRID(ng)%h(i,0)
          IF (BOUNDARY(ng)%zeta_south(i).le.cff) THEN
            BOUNDARY(ng)%zeta_south(i)=cff
          END IF
        END DO
        bry_update=.TRUE.
      END IF
#    ifdef DISTRIBUTE
      CALL mp_boundary (ng, iNLM, IstrR, IendR, ILB, IUB, 1, 1,         &
     &                  bry_update,                                     &
     &                  BOUNDARY(ng)%zeta_south)
#    endif
#   endif

#   ifdef NORTH_FSOBC
      bry_update=.FALSE.
      IF (NORTHERN_EDGE) THEN
        DO i=IstrR,IendR
          cff=Dcrit(ng)-GRID(ng)%h(i,Mm(ng)+1)
          IF (BOUNDARY(ng)%zeta_north(i).le.cff) THEN
            BOUNDARY(ng)%zeta_north(i)=cff
          END IF
        END DO
        bry_update=.TRUE.
      END IF
#    ifdef DISTRIBUTE
      CALL mp_boundary (ng, iNLM, IstrR, IendR, ILB, IUB, 1, 1,         &
     &                  bry_update,                                     &
     &                  BOUNDARY(ng)%zeta_north)
#    endif
#   endif
#  endif
Note: See TracTickets for help on using tickets.