Newbie making a dumb mistake but can you help?
- From: "JustMe2" <do_mail@xxxxxxx>
- Date: 26 Apr 2006 13:40:50 -0700
I am very new to fortran and I am (trying to) writing with fortran 90.
I have a very large project in front of me an want to use modules to
help organize the project.
I can write and compile the .mod files I can write, compile, link and
run "normal" .f90 files
Now I need to get the "use module" to work. I have a simple main that
reads the input and sets two vars. I then try to call a .mod function.
seemed simple but I cannot get the main to compile. I get an error
undefined reference to "___randoms_randie" randoms is the .mod file
randie is the function in the .mod file.
do I need to proto type? if so how do I do that, every place I put the
interface I get the error duplicate identifiers
Thank you in advance ...
==================================================
!**********************************************************************
MODULE RANDOMS
IMPLICIT NONE
CONTAINS
FUNCTION RANDIE(IX,RX)
REAL :: RANDIE
REAL, INTENT( IN ) :: IX, RX
REAL :: NIX, RI, II
RI = RX
II = IX
13 II=II*1029
NIX=IX/1048576
II=II-NIX*1048576
RI=II/1048575.7
IF(II.EQ.0)THEN
II=1
GO TO 13
END IF
RANDIE = RI
END FUNCTION RANDIE
END MODULE RANDOMS
==================================================
PROGRAM t_main
USE randoms
IMPLICIT NONE
REAL :: a, b, c
PRINT*, " enter a , b"
READ*, a,b
c = b
c = RANDIE(a,c)
PRINT*, " your input was ",a," and ",b," with a rondom number of ",c
PRINT*, " "
end PROGRAM t_main
===================================================
.
- Follow-Ups:
- Re: Newbie making a dumb mistake but can you help?
- From: Colin Watters
- Re: Newbie making a dumb mistake but can you help?
- From: David Frank
- Re: Newbie making a dumb mistake but can you help?
- Prev by Date: Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- Next by Date: Re: New style DO syntax?
- Previous by thread: passing only the real parts of a complex array to a function
- Next by thread: Re: Newbie making a dumb mistake but can you help?
- Index(es):