# FUNCTION attribute conflicts with SUBROUTINE attribute

• Fortran
Hello, I'm trying to use Runge Kutta with adaptive stepsize from numerical recipes(page 742, https://websites.pmc.ucsc.edu/~fnimmo/eart290c_17/NumericalRecipesinF77.pdf ). I rewrote code but I have got failure messages both in an attachment. If I cut this subroutine everything is fine also this failure are independent on a definition of function 'derivs' which is causing the problem in calling.

#### Attachments

• 26.8 KB Views: 353
• 38.6 KB Views: 168

Related Programming and Computer Science News on Phys.org
DrClaude
Mentor
Your first image is too small to read. Looking at the second one, in rkck the declaration
Fortran:
double precision, external :: derivs
would be valid for a function, not a subroutine. it should be simply
Fortran:
external :: derivs

Your first image is too small to read. Looking at the second one, in rkck the declaration
Fortran:
double precision, external :: derivs
would be valid for a function, not a subroutine. it should be simply
Fortran:
external :: derivs
Good to know,
Thank you!! SOLVED