I'm getting a few errors after turning on interface checking and need some help as I'm not an experienced Fortran coder :-)
I have the code below that generates the errors #6633 & error #8284
INTEGER*4 nv,nc INTEGER*4 reason INTEGER*4 first_iter, max_iter INTEGER*4 iterations REAL*8 x(1) REAL*8 price REAL*8 lamda(*) nc = int(x(1)) CALL opt_plant_model ( nv, nc, price )
error #6633: The type of the actual argument differs from the type of the dummy argument. [NC]
error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.
The definition of opt_plant_model is below
REAL*8 FUNCTION opt_plant_model (nv, nc, nxt) IMPLICIT NONE INCLUDE 'RTO+.PRM' INCLUDE 'OPTIMUSER.CMN' INCLUDE 'NEW_INTERFACE.INC' INTEGER*4 nv, nc, nxt
I thought that as I am assigning x(1) to an integer this would be Ok. I'm using Intel Fortran 2016 update 3 on Windows 7.
1] Price is declared as real*8 but you are passing it to integer*4 Nxt. The types must match.
2] opt_plant_model is a real*8 "function" but CALL is valid only for a "subroutine" so changeing:
opt_plant_model(nv, nc, nxt)
SUBROUTINE opt_plant_model(nv, nc, nxt)
would be more valid