summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr43505.f90
blob: b912c9ff0dd8f3cfd3202fd754043b11a131046e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 MODULE MAIN1
      INTEGER , PARAMETER :: MXGLVL = 87
      CHARACTER(8) :: SRCTYP
      REAL :: GRIDWS(MXGLVL)
      REAL :: ZI, HS
    END MODULE MAIN1

    PROGRAM TEST
      USE MAIN1
      IF (HS >= ZI) THEN
      ELSEIF (      SRCTYP == 'AREA'     &
               .OR. SRCTYP == 'AREAPOLY' &
               .OR. SRCTYP == 'AREACIRC' &
               .OR. SRCTYP == 'OPENPIT'   ) THEN
         CALL ANYAVG (MXGLVL, GRIDWS)
         CALL ANYAVG (MXGLVL, GRIDWS)
      ELSE
         IF ( HS > 0.0 ) THEN
            CALL ANYAVG (MXGLVL, GRIDWS)
            CALL ANYAVG (MXGLVL, GRIDWS)
            CALL ANYAVG (MXGLVL, GRIDWS)
         ENDIF
      ENDIF
      IF (HS.LT.ZI) THEN
         ZI = HS
      ENDIF
    contains
      SUBROUTINE ANYAVG(NLVLS,HTS)
        INTEGER NLVLS
        REAL HTS(NLVLS)
        IF (5.LT.NLVLS) THEN
           CALL GINTRP (HTS(5),HTS(5+1))
        ENDIF
        CALL GINTRP (HTS(5-1), HTS(5))
      END SUBROUTINE ANYAVG

      subroutine gintrp (x1, x2)
        print *, x1, x2
      end subroutine

    END PROGRAM TEST
! { dg-final { cleanup-modules "main1" } }