Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error Message

JohnNichols
Valued Contributor III
256 Views

If I make a mistake in one subroutine, the compiler tells me that there is also a mistake in the next subroutine, see picture.  I was wondering why?

There is nothing wrong with creep, I left off a right ket, as my old math professor called them, in the routine above creep.  

Screenshot 2023-04-07 151025.png

0 Kudos
2 Replies
mecej4
Black Belt
211 Views

If there is more than one program unit in a file being compiled, and the compiler sees a function or subroutine reference that does not match the dummy argument list of that function or subroutine in the same file, it can issue a warning (or, depending on the options in effect, an error).

If you make a typographical error in a call or a declaration (or both), a mismatch occurs. As to which is wrong (or both), that is for the programmer to work out.

The variables/names in the error messages in the screenshot do not appear in the few lines of code shown, so it is impossible to comment or follow your claims about "creep", "k", etc.

0 Kudos
JohnNichols
Valued Contributor III
200 Views

The McMaster program is running and compiling without error.   The answers need to be checked a long slow process as the thesis is less than populated with examples. 

But if the following routine is running 



    !----------------------------------------------------------------------------------------------------------------
    !
    !
    !
    !----------------------------------------------------------------------------------------------------------------

    SUBROUTINE ELASTIC(EI, EA, FA, FV, BMC, LIST, XF)

    use Base
    use solver
    implicit none
      
    INTEGER I                                                           !   Dummy integer counter 
    INTEGER I1                                                          ! 
    INTEGER IA                                                          ! 
    INTEGER ibeg                                                        !
    INTEGER ID(mn_150)                                                  ! 
    INTEGER IERR                                                        ! 
    INTEGER iflag                                                       ! 
    INTEGER II                                                          !
    INTEGER ipivot(mn_100)                                              !
    INTEGER J                                                           !  
    INTEGER J1                                                          !
    INTEGER JA                                                          ! 
    INTEGER JJ                                                          !  
    INTEGER JN                                                          ! 
    INTEGER JNL(mn_150)                                                 ! 
    INTEGER JNG(mn_150)                                                 !  
    INTEGER JNN(mn_100)                                                 !
    INTEGER K                                                           !
    INTEGER K1                                                          ! 
    INTEGER KA                                                          ! 
    INTEGER KMAX                                                        ! 
    INTEGER KAMAX                                                       ! 
    Integer L                                                           !   Dummy counter for the list array
    INTEGER LIST(mn_100)                                                ! 
    INTEGER LL                                                          ! 
    INTEGER LM                                                          ! 
    INTEGER LM1                                                         ! 
    INTEGER LM2                                                         !  
    INTEGER M                                                           !
    
    INTEGER MAX                                                         ! 
    INTEGER MC(mn_150,mn_6)                                             ! 
    INTEGER MEMTYP(mn_150)                                              ! 
    INTEGER MIN                                                         !
    INTEGER MT           
      
    INTEGER N1                                                          ! 
    INTEGER N2                                                          !  
    INTEGER N3                                                          ! 
    INTEGER NB                                                          ! 
    Integer NB1                                                         ! 
    INTEGER ND(mn_100,mn_3)                                             ! 
    INTEGER NDIS                                                        ! 
    INTEGER NJ                                                          !
    INTEGER NJL                                                         !  
    INTEGER NM                                                          ! 
    INTEGER NV                                                          ! 
    
    
    REAL (KIND=dp) A(mn_10000)                                          ! 
    REAL (KIND=dp) AA                                                   !     
    REAL (KIND=dp) AF                                                   ! 
    
    REAL (KIND=dp) AL(mn_150)                                           !  
    REAL (KIND=dp) ALL                                                  ! 
    
    REAL (KIND=dp) B(mn_3000)                                           ! 
    REAL (KIND=dp) BA(mn_100)                                           !
    REAL (KIND=dp) BB                                                   ! 
    REAL (KIND=dp) BM1                                                  ! 
    REAL (KIND=dp) BM2                                                  !
    REAL (KIND=dp) BMC(mn_150)                                          ! 
    REAL (KIND=dp) BR(mn_3000)                                          !  
    REAL (KIND=dp) c(mn_100)                                            ! 
    REAL (KIND=dp) CC                                                   ! 
    REAL (KIND=dp) CF                                                   !
    REAL (KIND=dp) D(mn_6)                                              ! 
    REAL (KIND=dp) D1(mn_100)                                           ! 
    REAL (KIND=dp) D2(mn_100)                                           ! 
    REAL (KIND=dp) D3(mn_100)                                           !    
    REAL (KIND=dp) dA(mn_100)                                           !
    REAL (KIND=dp) DD                                                   ! 
    REAL (KIND=dp) DET                                                  ! 
    REAL (KIND=dp) DV1                                                  ! 
    REAL (KIND=dp) DV2                                                  !
    
    REAL (KIND=dp) EE                                                   ! 
    REAl (KIND=dp) EI(mn_150)                                           ! 
    REAL (KIND=dp) EA(mn_150)                                           ! 
    REAL (KIND=dp) F(mn_3)                                              ! 
    REAL (KIND=dp) FA(mn_150)                                           ! 
    REAL (KIND=dp) FV(mn_150)                                           ! 
    REAL (KIND=dp) FX                                                   ! 
    REAL (KIND=dp) FXX(mn_100)                                          !
    REAL (KIND=dp) FY                                                   !  
    REAL (KIND=dp) FYY(mn_100)                                          ! 
    REAL (KIND=dp) FM                                                   !  
    REAL (KIND=dp) FMM(mn_100)                                          ! 
    REAL (KIND=dp) GG                                                   ! 
    REAL (KIND=dp) HH                                                   ! 
    
    
    REAL (KIND=dp) SM(mn_150,mn_6,mn_6)                                 ! 
    REAL (KIND=dp) SK(mn_20,mn_20)                                      ! 
     
    REAL (KIND=dp) VF                                                   !
    
    REAL (KIND=dp) X(mn_100)                                            !  
    REAL (KIND=dp) XF(MN_150)                                           !
    REAL (KIND=dp) XM(mn_150)                                           ! 
    REAL (KIND=dp) XX                                                   ! 
    REAL (KIND=dp) Y(mn_100)                                            !  
    REAL (KIND=dp) YM(mn_150)                                           !
    REAL (KIND=dp) YY                                                   ! 
    
    
    integer, allocatable :: temp(:)                                     ! 
    
    real (KIND=dp), allocatable :: SKR(:,:)                             ! 
    real (KIND=dp), allocatable :: W(:,:)                               ! 
    real (KIND=dp), allocatable :: ainv(:,:)                             ! 
    real (KIND=dp), allocatable :: d11(:)                                ! 

    COMMON /BLCK1/ ND, X, Y, JNL, JNG, MEMTYP
    COMMON /BLCK2/ NJ, NM, CF, NJL
    COMMON /BLCK3/ JNN, FXX, FYY,FMM
    COMMON /BLCK5/ AL,XM ,YM

    !   PLANE FRAME PROGRAM USING A BAND SOLUTION METHOD,
    !   PROGRAM   DIMENSIONED   FOR   100 JOINTS   AND   150   MEMBERS.

    NB = 0
    NDIS=0
    K = 0
    KMAX = 0
    KAMAX = 0
    ID = 0
    BR = 0.0

    write(*,100)
    write(12,110)
100 Format(//20X,"    Running the Elastic Package",//)
110 Format(//20X,"    Running the Elastic Package")


    DO   12   I=1,NJ
        DO   12   II=1,3
            IF(ND(I,II) .EQ. 0)   GOTo   12
            NDIS=NDIS + 1
            ND(I,II)=NDIS
12  CONTINUE
    DO   15   I=1,NM
        N1=JNL(I)
        N2=JNG(I)
        DO   15   K=1,3
            MC(I,K)=ND(N1,K)
            M = K + 3
            MC(I,M) =ND(N2,K)
15  CONTINUE
    DO 21 I = 1, NM
        Do 21 J = 1,6
            DO 21 K = 1,6
                SM(I,J,K) = 0.
21  END DO

    DO 22 I=1,NM
        write(12,5)I
5       Format(/,20X,"    Stiffness elements for the Element No :: ",I10,&
            /,20X,"     Row          1              2              3              4              5              6")
        MT=MEMTYP(I)
        AA=EA(I)/AL(I)**3
        CC=XM(I)**2
        DD=YM(I)**2
        EE=XM(I)*YM(I)

        SM(I,1,1) = AA*CC
        SM(I,2,1) = AA*EE
        SM(I,2,2) = AA*DD
        SM(I,4,1)=-SM(I,1,1)
        SM(I,4,2)=-SM(I,2,1)
        SM(I,4,4)= SM(I,1,1)
        SM(I,5,1)= SM(I,4,2)
        SM(I,5,2)=-SM(I,2,2)
        SM(I,5,4)= SM(I,2,1)
        SM(I,5,5)= SM(I,2,2)

        GOTO (23,24,25,25)MT

24      BB = 12.0*EI(I)/AL(I)**5
        GOTO 26
25      BB = 3.0*EI(I)/AL(I)**5
26      EE = BB*DD
        GG = BB*EE
        HH = BB*CC
        YY = YM(I)*BB*AL(I)**2/2.0
        XX = XM(I)*BB*AL(I)**2/2.0
        ALL = BB*AL(I)**4/3.0

        SM(I,1,1)=SM(I,1,1) + EE
        SM(I,2,1)=SM(I,2,1) - GG
        SM(I,2,2)=SM(I,2,2) + HH
        SM(I,4,1)=SM(I,4,1) - EE
        SM(I,4,2)=SM(I,4,2) + GG
        SM(I,4,4)=SM(I,4,4) + EE
        SM(I,5,1)=SM(I,5,1) + GG
        SM(I,5,2)=SM(I,5,2) - HH
        SM(I,5,4)=SM(I,5,4) - GG
        SM(I,5,5)=SM(I,5,5) + HH
        GOTO(23,28,29,31)MT
28      SM(I,3,1)=SM(I,3,1) - YY
        SM(I,3,2)=SM(I,3,2) + XX
        SM(I,3,3)=SM(I,3,3) + ALL
        SM(I,4,3)=SM(I,4,3) + YY
        SM(I,5,3)=SM(I,5,3) - XX
        SM(I,6,1)=SM(I,6,1) - YY
        SM(I,6,2)=SM(I,6,2) + XX
        SM(I,6,3)=SM(I,6,3) + ALL/2.0
        SM(I,6,4)=SM(I,6,4) + YY
        SM(I,6,5)=SM(I,6,5) - XX
        SM(I,6,6)=SM(I,6,6) + ALL
        GOTO 23
29      SM(I,6,1)=SM(I,6,1) - 2.0*YY
        SM(I,6,2)=SM(I,6,2) + 2.0*XX
        SM(I,6,4)=SM(I,6,4) + 2.0*YY
        SM(I,6,5)=SM(I,6,5) - 2.0*XX
        SM(I,6,6)=SM(I,6,6) + 3.0*ALL
        GOTO 23
31      SM(I,3,1)=SM(I,3,1) - 2.0*YY
        SM(I,3,2)=SM(I,3,2) + 2.0*XX
        SM(I,3,3)=SM(I,3,3) + 3.0*ALL
        SM(I,4,3)=SM(I,4,3) + 2.0*YY
        SM(I,5,3)=SM(I,5,3) - 2.0*XX

23      DO 32 J = 1,6
            Do 33 K = 1,6
                SM(I,J,K)=SM(I,K,J)
33          END DO
            Write(12,10)J,(SM(I,J,M),M=1,6)
10          Format(20X,I6,6F15.3)
32      END DO

22  End do


    kA = 0
    Do 39 I = 1,NM

        Do 41 IA = 1,6
            DO 42 JA = 1,6
                !Write(12,*)KA,IA,JA
                SK(KA+IA,KA+JA) = SM(I,IA,JA) + SK(KA+IA,KA+JA)
                !write(*,*)KA+IA,KA+JA,SK(KA+IA,KA+JA)
                If(KA+IA .GT. KAMAX) then
                    KAMAX = KA+IA
                END IF
42          end do
41      end do
        KA = KA + 3
39  END DO

    Write(12,607)NM,KAMAX
607 Format(//,20X,"    Global Stiffness matrix   No Eliminations ",&
        /,20X,"    Number of members          :: ",I5,&
        /,20X,"    Array Size                 :: ",I5,/)


    do 605 I = 1,KAMAX
        write(12,609)I,(SK(I,J),J=1,KAMAX)
609     Format(20X,I10,18(2X,E10.3))
605 end do

    LM = 0
    do 610 I = 1,KAMAX
        LM = LIST(I) + LM
610 END DO
    LM1 = (KAMAX-LM)
    Write(12,6017)NM,LM,LM1
6017 Format(//,20X,"    Global Stiffness matrix   Eliminations ",&
        /,20X,"    Number of members          :: ",I5,&
        /,20X,"    Array Size                 :: ",I5,&
        /,20X,"    Number of elimations       :: ",I5,/)


    allocate(temp(LM1),STAT=ierr)
    TEMP = 0
    if(ierr .ne. 0) then
        Stop "Bad allocation at temp line 996"
    end if

    allocate(SKR(LM,LM),W(LM,LM),AINV(LM,LM),D11(LM),STAT=ierr)
    SKR = 0.0
    W = 0.0
    D11 = 1.0
    ainv = 0.0

    if(ierr .ne. 0) then
        Stop "Bad allocation at SKR line 1003"
    end if

    LM2 = 1
    DO 6018 I = 1, KAMAX
        If(LIST(I) .eq. 0) THEN
            TEMP(LM2) = I
            LM2 = LM2 + 1
        end if
6018 end do

    I1 = 1
    J1 = 1

    Do 3 I = 1,KAMAX
        do 4 J = 1,KAMAX
            do 7 K1= 1,LM1
                If(I .eq. TEMP(K1) .or. J .eq. TEMP(K1)) then
                    !Write(*,*)I,J,"SKIPPED"
                    GOTO 4
                endif
7           END DO
            ! Write(*,*)I,J,I1,J1
            SKR(I1,J1) = Sk(I,J)
            IF(J1 .eq. LM) then
                J1 = 1
                I1 = I1+1
            else
                J1 = J1 + 1
            end if
4       end do
3   end do

    I1 = 0
    K1 = 0
    write(*,19)KAMAX,KAMAX-LM1
19  Format(/,20X,"    Reduce Matrix for restraints and for inversion package.",&
        /,20X,"     It is easier to assemble the entire matrix and then",&
        /,20X,"     drop the restraint rows and columns",/&
        /,20X,"    Full matrix size                            :: ",I10,&
        /,20X,"    Reduced matrix size allowing for restraints :: ",i10,&
        //,20X,"          Reduced               Complete          Full",&
        /,20X, "        I       Load           I       Load      Count",/)

    do 16 I = 1,KAMAX
        do 17 K1= 1,LM1
            If(I .eq. TEMP(K1)) then
                !Write(*,*)I,I1,XF(i),"SKIPPED"
                GOTO 16
            endif
17      END DO
        I1 = I1 + 1
        D11(I1) = XF(I)
        ID(I1) = I
        Write(*,18)I1,D11(I1),I,XF(I),ID(I1)
18      Format(20X,I10,3X,F10.3,I10,F10.3,I10)
16  END DO


    do 1605 I = 1,LM
        write(12,1609)I,(SKR(I,J),J=1,LM),D11(I)
1609    Format(20X,I10,16(2X,E10.3))
1605 end do

    B = 0.0

    write(12,1103)
    write(*,1103)
1103 Format(//,20X,"    Results for the analysis",&
        /,20X,"    Joint      Displacement X     Displacement Y    Rotation XY",&
        /,20X,"                    in                in              radians",/)


    Call PardisoSolver(skr,LM,LM,LM,B,D11,2)

    do 1100 I = 1,LM
        BR(ID(I)) = B(I)
1100 end do

    do 1101 I =1,NJ
        I1 = (I-1)*3
        write(12,1102)I,Br(I1+1),Br(I1+2),Br(I1+3)
        write(*,1102)I,Br(I1+1),Br(I1+2),Br(I1+3)
1102    Format(20X,I10,1(7x, F10.6),2(7x, F10.6))
1101 END DO


    !-------------------------------------------------------------------------------------------------------------------------------------------
    WRiTE(*,75)
    WRiTE(12,75)
75  FORMAT(//,20X,"    Force vector in member coordinates.",&
        /,20X,    "    Member         Axial Force           Shear              Joint Left           Joint Right",&
        /,20X,    "    Number          (KIPS)               (KIPS)             Bending Moment       Bending Moment",&
        /,20X,    "                                                             (IN-KIP)             (IN-KIP)",/)
    DO 76  M=1,NM
        N1=JNL(M)
        N2 = JNG(M)
        I1 = (N1-1)*3
        D(1) = BR(I1+1)
        D(2) = BR(I1+2)
        D(3) = BR(I1+3)

        I1 = (N2-1)*3
        D(4) = BR(I1+1)
        D(5) = BR(I1+2)
        D(6) = BR(I1+3)
        DO 77 I=1,3
            F(I) = 0.0
            DO 77  J=1,6
                F(I) = F(I) + SM(M,I,J)*D(J)
77      END DO
        VF=(-F(1)*YM(M)+F(2)*XM(M))/AL(M)
        AF=(-F(1)*XM(M)-F(2)*YM(M))/AL(M)
        BM1 = -F(3)
        BM2 = BM1 + VF*AL(M)

        WRITE(*,79)M,AF,VF,BM1,BM2

        WRITE(12,79)M,AF,VF,BM1,BM2
78      FORMAT(20X,I7,5X,F12.4,8X,F12.4,2X,F12.4,6X,F12.4)
79      FORMAT(20X,I7,7X,F12.4,9X,F12.4,11X,F12.4,11X,F12.4)
        FA(M) = AF
        FV(M) = VF
        DV2 = (-D(4)*YM(M) + D(5)*XM(M))/AL(M)
        DV1 = (-D(1)*YM(M) + D(2)*XM(M))/AL(M)
        BMC(M)=BM1+VF*AL(M)*0.50-AF*(DV1+DV2)*0.5
76  END DO

    RETURN
    END SUBROUTINE

as part of the full code. It compiles as part of the full code with 

 

Screenshot 2023-04-08 162547.png

 

If I introduce a deliberate error 

   NB = 0
    NDIS=0
    K = 0
    KMAX = 0
    KAMAX = 0
    ID = 0
    BR = 0.0

    write(*,100
    write(12,110)
100 Format(//20X,"    Running the Elastic Package",//)
110 Format(//20X,"    Running the Elastic Package")


    DO   12   I=1,NJ

I leave the )  off from line 9 and recompile I get two errors, not one. 

 

Screenshot 2023-04-08 163728.png

There is nothing wrong with creep, it is at least 2 subroutines above this one, it is not called in this subroutine.  There is only one error.  

 

0 Kudos
Reply