user2717742
user2717742

Reputation: 17

how to define function in fortran 90

I'm trying to define a function in my module code and call it in the main fortran code but when I want to compile my code I'm receiving this error :

This actual argument must be the name of an external user function or the name of an intrinsic function.

and my function is :

Function func (x)  
   implicit none  
   double precision func,x  
   func=x  
   RETURN  
end function func

and in the main code

call Romberg (dra,func,ra(mm),ra(kk))

I want to measure the destance between ra(mm) & ra(kk)

Upvotes: 0

Views: 901

Answers (1)

Steve Lionel
Steve Lionel

Reputation: 7267

Add:

external func

in the caller. This tells the caller that "func" is an external procedure. You evidently have Romberg declared with an explicit interface specifying the argument is a procedure.

Upvotes: 1

Related Questions