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

Assumed-size problem

cfduarte
Beginner
1,553 Views
Hi,

I need to use a f77 subroutine for calculations inside my main program.

That subroutine (DDASPK 2.0) uses assumed-size arrays and my main program does not (the size of the arrays are defined from start):

DDASPK header:

(...)
IMPLICIT DOUBLE PRECISION(A-H,O-Z)
LOGICAL DONE, LAVL, LCFN, LCFL, LWARN
DIMENSION Y(*),YPRIME(*)
DIMENSION INFO(20)
DIMENSION RWORK(LRW),IWORK(LIW)
DIMENSION RTOL(*),ATOL(*)
DIMENSION RPAR(*),IPAR(*)
CHARACTER MSG*80
EXTERNAL RES, JAC, PSOL, DDASID, DDASIK, DNEDD, DNEDK

(...)

Main program header:

(...)

implicit none
integer::NEQ,IDID,LRW,LIW,IPAR
integer,dimension(20)::INFO
double precision::T,TOUT,RTOL,ATOL
double precision,dimension(3)::RPAR
double precision,dimension(4)::Y,YPRIME
integer,dimension(:),allocatable::IWORK
double precision,dimension(:),allocatable::RWORK
external RES,JAC,PSOL

(...)

When I compiled this under CVF 6.1A, all the arrays (Y,YPRIME, etc) were passed on correctly to DDASPK but now that I'm using CVF 6.6B, ALL arrays are truncated to the first element (i.e. they become 1-element arrays).

I've tried builing interfaces but that does not work!

Any ideas?

Thanks!

Carlos
0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,553 Views
You'd have to show a complete program, including the call, to comment. Send this to [email protected]

Steve
0 Kudos
Steven_L_Intel1
Employee
1,553 Views
This ended up being a reference to an uninitialized array element.

Steve
0 Kudos
Reply