Conceptual incomprehension.


Kurda_Yon
07-23-2004, 09:04 AM
Hi,

I am quite new in NR. Can you halp me to start? As a first step I tried to use subroutine "mnbrak" (which minimizes functions). I wrote the following program:

program p1
implicit none
real :: ax=1.0, bx=2.0, cx, fa, fb, fc, x
write(6,*) ax, bx
call mnbrak(ax,bx,cx,fa,fb,fc,sin(x))
write(6,*) ax,bx,cx,fa,fb,fc
end program p1
SUBROUTINE mnbrak(ax,bx,cx,fa,fb,fc,func)
:
: <--- (copy of subroutin)
:
END SUBROUTINE mnbrak

And after compilation (pgf90 -Mfree mnbrak.f) I have obtained:

PGF90-F-0004-Unable to open MODULE file nrtype.mod
(mnbrak.f: 10)
PGF90/any Linux/x86 5.1-3: compilation aborted

Can anybody explane me what I do wrong?
Thank you.

dmolin
11-14-2005, 04:18 AM
Hi,
I should not copy nr codes, you should import file using the key word USE in fortran.
Then you compile both your code and nr code and link them.
It would work.
Your error come from your compiler does not see the nr, nrtype and nrutil modules which are use by the nr function you copy.