- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I'm trying to compile this program:
SUBROUTINE DISPLT
C+--------------------------------------------------------------------+C
C PURPOSE : C
C THIS SUBROUTINE IS TO CALL ROUTINE THAT ARRANGES THE C
C DISPLACEMENT VECTOR INTO AN ARRAY INCLUDING THE THE C
C PRESCRIBED DISPLACEMENT C
C+--------------------------------------------------------------------+C
C $INCLUDE:'ALLOCT.INC'
C
C
CALL DISPL1(ID,NDOFS,F,BR,PD,NDOF,NNP)
C
RETURN
END
C
C
SUBROUTINE DISPL1(ID,NDOFS,F,BR,PD,NDOF,NNP)
C+--------------------------------------------------------------------+C
C PURPOSE : C
C THIS SUBROUTINE IS TO ARRANGES THE DISPLACEMENT VECTOR INTO C
C AN ARRAY INCLUDING THE THE PRESCRIBED DISPLACEMENT FOR C
C ELASTIC ANALYSIS C
C+--------------------------------------------------------------------+C
IMPLICIT REAL*8 (A-H,O-Z)
REAL*8 F(NDOF,1), BR(1), PD(NDOF,1)
INTEGER ID(NDOF,1), NDOFS(NNP)
C
C -----------------------------------------------
C FORM DISPLACEMENT VECTOR INDEXED BY NODE NUMBER
C -----------------------------------------------
CALL DZERO(F,NDOF*NNP)
30 NUM = 1
DO 50 J = 1, NNP
DO 40 I = 1, NDOFS(J)
IF (ID(I,J) .EQ. NUM) THEN
F(I,J) = BR(NUM)
NUM = NUM + 1
ELSE
F(I,J) = PD(I,J)
ENDIF
40 CONTINUE
50 CONTINUE
C
RETURN
END
After i compile, this error message appears: error #6633: The type of the actual argument differs from the type of the dummy argument. [BR]
can anyone help me please?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since there is no `IMPLICIT NONE` in `DISPLT` the compiler assumes `BR` is a scalar value of type `REAL*4`. But the procedure `DISPL1` expects `BR` to be a double precision `REAL*8` and to be an array of one (although F77 does not check array bounds and thus can access more than one element of an array).
You can add `IMPLICIT REAL*8 (A-H,O-Z)` under `SUBROUTINE DISPLT` in order to force the same types in both subroutines, although you will still have a mismatch of array sizes and/or a mixup between scalar and array variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, your program uses BR(NUM), where NUM could possibly be in the range of 1 to NNP * SUM(NDOFS); but where BR is declared as an array of size 1.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Subroutine DISPLT none of the variable types are defined hence there error. Worse still though is that there is no means by which any of the variables can have a defined value. DISPL1 is clearly expecting NNP and NDOFS (any mayve other stuff I did not look) do have some sane values.
I expect the answer to all these problems will be in the include file ALLOCT.INC that is not actually included as that line has been commented out ( C in col 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think in some older Fortran 77 codes, array sizes of 1 were used for variable size arrays.
In modern Fortran, this is no longer allowed. A possible change to the declarations in your subroutine could be
REAL*8 F(NDOF,*), BR(*), PD(NDOF,*)
INTEGER ID(NDOF,*), NDOFS(NNP)
Or for F, PD and ID, the second dimension could be NNP, if that agrees with the calling program declaration.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page