Software Archive
Read-only legacy content
17060 Discussions

function arguments

Intel_C_Intel
Employee
655 Views
Inside of the subroutine "SECTION" the variables have the proper values, when the program execution reaches the function "SolveTooth" the arguments take on the value of the argument immediately to it's right.

SolveTooth(rbs,m2s,gamma,thetaOS,Yg,Zg,thetaS,phiS,us)
eg: rbs=m2s,
m2s=gamma
etc.
us=useless data (value=1e-135)

What could possibly be causing this?

Subroutine SECTION(GeomVec,nt,nf,zeta,XLIST,evec)
!program SECTION
!DEC$ ATTRIBUTES DLLEXPORT :: SECTION ! This exports the name
!DEC$ ATTRIBUTES ALIAS : "SECTION" :: FortranCall !This sets it
use dfwin !use standard windows dll packs
IMPLICIT NONE

DOUBLE PRECISION:: zeta
DOUBLE PRECISION ::gamma

INTEGER :: i,j,k,maxits

DOUBLE PRECISION, PARAMETER :: pi = 3.14159265358979, delmax=0.00001
DOUBLE PRECISION :: Xg,Yg,Zg,dels,errorCurrent,flat2,Cx,Cy
DOUBLE PRECISION :: rbs,thetaOS,thetaStar,m2s
DOUBLE PRECISION :: A,Guess,err,FA,F1A,B,L1,L2,Zpoint,thetaS
DOUBLE PRECISION :: delta,temp,InnerR,Length,location,ToothBottom,intersection,interval
DOUBLE PRECISION :: us,phiS,toothstep,filletstep,phi2,rad,Nt,Nf,F2,ToothHeight
DOUBLE PRECISION :: SolveTooth,ToothWidth,SolveFillet,MeshFillet,FilletWidth
DOUBLE PRECISION :: FindphiS

DOUBLE PRECISION, DIMENSION(1:3,1:600)::XLIST, TEMPLIST
DOUBLE PRECISION, DIMENSION(1:2)::parameters

parameters=SolveTooth(rbs,m2s,gamma,thetaOS,Yg,Zg,thetaS,phiS,us)

__________________________________________________

FUNCTION SolveTooth(rbs,m2s,gamma,thetaOS,Yg,Zg,thetaS,phiS,us)

IMPLICIT NONE

DOUBLE PRECISION, INTENT(in) :: rbs !,m2s,gamma,thetaOS

DOUBLE PRECISION :: thetaS,phiS,us,Yg,Zg,dels,delmax,errorCurrent,F2,F3,solve,m2s,gamma,thetaOS

DOUBLE PRECISION, DIMENSION(2,3) :: jac
DOUBLE PRECISION, DIMENSION(2) :: adjust, SolveTooth
0 Kudos
1 Reply
Steven_L_Intel1
Employee
655 Views
An explicit interface is REQUIRED when calling a function that returns an array (as well as in a number of other circumstances - see the Language Reference Manual). What's happening is that the function expects a hidden argument with the address of the function value return, but the caller doesn't pass it.

Steve
0 Kudos
Reply