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

Passed Procedures

mattsdad
Beginner
464 Views
I just upgraded to IVF 11.1 from 10.1 and I am getting a flood of compilation errors related to passing functions in argument lists. For instance

SUBROUTINE runge_kutta (body, state, state_dot, deriv, time, dt, state_out)
USE Body_m, ONLY: Body_t
IMPLICIT NONE
TYPE(Body_t), INTENT(INOUT) :: body ! body being propagated
REAL(KIND=8), DIMENSION(n), INTENT(IN) :: &
state , & ! state of body at start of step
state_dot ! the derivative at start of step
INTERFACE
! The function to calculate the derivitive of a state for a body
SUBROUTINE deriv(bd, st, t, dt, retval)
USE Body_m, ONLY: Body_t
IMPLICIT NONE
TYPE(Body_t), INTENT(IN) :: bd ! body
REAL(KIND=8), INTENT(IN), DIMENSION(n) :: st ! state at time t
REAL(KIND=8), INTENT(IN) :: t ! the time
REAL(KIND=8), INTENT(IN) :: dt ! the time step
REAL(KIND=8), DIMENSION(n), INTENT(OUT) :: retval ! the derivative
END SUBROUTINE deriv
END INTERFACE
REAL(KIND=8), DIMENSION(n), INTENT(IN) :: time, dt
REAL(KIND=8), DIMENSION(n), INTENT(OUT) :: &
state_out ! propagated value of state

This worked just fine in v10.1 but it is now not working. What do I need to do to fix it?

P.S. I tried to make the subroutine being passed EXTERNAL but that just created its own error.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
464 Views
When I cobble together a sample I can compile, I see lots of errors from this:

REAL(KIND=8), INTENT(IN), DIMENSION(n) :: st ! state at time t

because N is not a dummy argument, module variable or a PARAMETER constant.

What do you see?
0 Kudos
mattsdad
Beginner
464 Views
When I cobble together a sample I can compile, I see lots of errors from this:

REAL(KIND=8), INTENT(IN), DIMENSION(n) :: st ! state at time t

because N is not a dummy argument, module variable or a PARAMETER constant.

What do you see?

Sorry, I tried to trim the call back to a simple example and left that out. You can make the 'n' a ':' for this example.

The calling routine has the following error:

error #7061: The characteristics of dummy argument 1 of the associated actual procedure differ from the characteristics of dummy argument 1 of the dummy procedure. (12.2) [STATE_DERIVATIVE]

on this line:

CALL runge_kutta (body, body%prior_state, &
body%prior_stdot, state_derivative, &
body%next_time, body%time_step, body%state)
0 Kudos
Steven_L_Intel1
Employee
464 Views
I guess I'd need to see the definition of routine "body" then. If you can construct a small, compilable example that demonstrates the problem, that would be best.

I'll comment that the compiler improves its error detection with each release, and it looks as if you've run into that. Whether or not the error is valid, I won't be able to tell without seeing more.
0 Kudos
Reply