Home > Archive > Fortran > May 2005 > what are these errors
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
what are these errors
|
|
| student 2005-05-21, 3:56 pm |
|
i wrote a code an f90 code a while back which was giving results on
some compiler. however, i just shifted to a Gnu Fortran 90/95 compiler.
while trying to compile my code using the following command:
g90 -o file randlib.f/src/* drive_mcmc.f90 ,
i get the following error messages. I have absolutely no clue to what
they mean. Can anyone help me fix these?
------------------------------
In file randlib.f/src/qrgnin.f:48
END
1
Internal Error at (1):
TODO: Functions with alternate entry points
In file matrixoperations.f90:14
Included at drive_mcmc.f90:5
REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
1
Error: Symbol 'mu' at (1) already has basic type of REAL
In file matrixoperations.f90:26
Included at drive_mcmc.f90:5
Mu(i,j)=0
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:33
Included at drive_mcmc.f90:5
Mu(i,j)=Mu(i,j)+A(i,k)*B(k,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:54
Included at drive_mcmc.f90:5
REAL,DIMENSION(size(A,1),size(A,2)) :: In
1
Error: Symbol 'in' at (1) already has basic type of REAL
In file matrixoperations.f90:107
Included at drive_mcmc.f90:5
In(i,j)=B(i,j+m)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:127
Included at drive_mcmc.f90:5
REAL,DIMENSION(size(A,2),size(A,1)) :: B
1
Error: Symbol 'b' at (1) already has basic type of REAL
In file matrixoperations.f90:131
Included at drive_mcmc.f90:5
B(i,j)=A(j,i)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:151
Included at drive_mcmc.f90:5
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:161
Included at drive_mcmc.f90:5
C(i,j) = A(i,j) + B(i,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:180
Included at drive_mcmc.f90:5
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:190
Included at drive_mcmc.f90:5
C(i,j) = A(i,j) - B(i,j)
1
Error: Unclassifiable statement at (1)
In file gibbsnorm.f90:9
Included at drive_mcmc.f90:8
use matrix
1
Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
such file or directory
--------------------------
| |
| Steven G. Kargl 2005-05-21, 3:56 pm |
| In article <1116694719.122289.104750@f14g2000cwb.googlegroups.com>,
"student" <adarsh@stat.tamu.edu> writes:
>
> i wrote a code an f90 code a while back which was giving results on
> some compiler. however, i just shifted to a Gnu Fortran 90/95 compiler.
> while trying to compile my code using the following command:
>
> g90 -o file randlib.f/src/* drive_mcmc.f90 ,
>
> i get the following error messages. I have absolutely no clue to what
> they mean. Can anyone help me fix these?
> ------------------------------
> In file randlib.f/src/qrgnin.f:48
>
> END
>
> 1
> Internal Error at (1):
> TODO: Functions with alternate entry points
> In file matrixoperations.f90:14
>
Are you using GCC 4.0?
Functions with alternate entry points were recently implemented,
and the fix will be included in GCC 4.0.1 and GCC 4.1. You can
get updated binraies through www.gfortran.org.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
| |
| Dick Hendrickson 2005-05-21, 3:56 pm |
| Without seeing the whole code, it's hard to know
for sure. I've got a couple of guesses below.
Dick Hendrickson
student wrote:
> i wrote a code an f90 code a while back which was giving results on
> some compiler. however, i just shifted to a Gnu Fortran 90/95 compiler.
> while trying to compile my code using the following command:
>
> g90 -o file randlib.f/src/* drive_mcmc.f90 ,
>
> i get the following error messages. I have absolutely no clue to what
> they mean. Can anyone help me fix these?
>
>
> ------------------------------
> In file randlib.f/src/qrgnin.f:48
>
> END
>
> 1
> Internal Error at (1):
> TODO: Functions with alternate entry points
If this is the error message, it indicates that there
is an internal error in the compiler itself. It's not
your fault and you should file a bug report with
the compiler people. It's possible that the compiler
bug caused all of the other problems.
> In file matrixoperations.f90:14
>
> Included at drive_mcmc.f90:5
>
> REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
> 1
> Error: Symbol 'mu' at (1) already has basic type of REAL
Most likely you've got another statement that declares
Mu to be a variable. This is easy to do when using include
files because you don't see everything. Are you sure
that Mu isn't declared somewhere else?
> In file matrixoperations.f90:26
>
> Included at drive_mcmc.f90:5
>
> Mu(i,j)=0
> 1
> Error: Unclassifiable statement at (1)
Once there is a problem with the declarations of Mu, then
there's likely to be problems when it's used (if the
compiler doesn't know for sure what it is, it can't know for
sure if you are using it correctly). Fix the declarations
and this one will go away!
> In file matrixoperations.f90:33
>
> Included at drive_mcmc.f90:5
>
> Mu(i,j)=Mu(i,j)+A(i,k)*B(k,j)
> 1
> Error: Unclassifiable statement at (1)
> In file matrixoperations.f90:54
>
> Included at drive_mcmc.f90:5
>
> REAL,DIMENSION(size(A,1),size(A,2)) :: In
> 1
> Error: Symbol 'in' at (1) already has basic type of REAL
> In file matrixoperations.f90:107
>
> Included at drive_mcmc.f90:5
>
> In(i,j)=B(i,j+m)
> 1
> Error: Unclassifiable statement at (1)
> In file matrixoperations.f90:127
>
> Included at drive_mcmc.f90:5
>
> REAL,DIMENSION(size(A,2),size(A,1)) :: B
> 1
> Error: Symbol 'b' at (1) already has basic type of REAL
> In file matrixoperations.f90:131
>
> Included at drive_mcmc.f90:5
>
> B(i,j)=A(j,i)
> 1
> Error: Unclassifiable statement at (1)
> In file matrixoperations.f90:151
>
> Included at drive_mcmc.f90:5
>
> REAL,DIMENSION(size(A,1),size(A,2)) :: C
> 1
> Error: Symbol 'c' at (1) already has basic type of REAL
> In file matrixoperations.f90:161
>
> Included at drive_mcmc.f90:5
>
> C(i,j) = A(i,j) + B(i,j)
> 1
> Error: Unclassifiable statement at (1)
> In file matrixoperations.f90:180
>
> Included at drive_mcmc.f90:5
>
> REAL,DIMENSION(size(A,1),size(A,2)) :: C
> 1
> Error: Symbol 'c' at (1) already has basic type of REAL
> In file matrixoperations.f90:190
>
> Included at drive_mcmc.f90:5
>
> C(i,j) = A(i,j) - B(i,j)
> 1
> Error: Unclassifiable statement at (1)
> In file gibbsnorm.f90:9
>
> Included at drive_mcmc.f90:8
>
> use matrix
> 1
> Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
You had errors in the routines in the matrix module,
so the compiler didn't generate enough information to
let the use matrix statement work. This one will go
away when you get the other errors corrected.
Dick Hendrickson
>
> such file or directory
> --------------------------
>
| |
| student 2005-05-21, 8:57 pm |
| Dick!
That's not the problem. I have no "include" statements in the source
code. And as I said this code was working fine on another compiler. I
guess I need to look into what Steve has suggested.
| |
| Tim Prince 2005-05-21, 8:57 pm |
| Dick Hendrickson wrote:
> Without seeing the whole code, it's hard to know
> for sure. I've got a couple of guesses below.
>
> Dick Hendrickson
>
> student wrote:
>
Is this gfortran with an alias?[color=darkred]
>
> If this is the error message, it indicates that there
> is an internal error in the compiler itself. It's not
> your fault and you should file a bug report with
> the compiler people. It's possible that the compiler
> bug caused all of the other problems.
It also shows specifically that ENTRY or something like it was found in the
source, and this is a known omission in the compiler.
--
Tim Prince
| |
| Steven G. Kargl 2005-05-21, 8:57 pm |
| In article <e%Mje.1907$kj7.1091@newssvr21.news.prodigy.com>,
Tim Prince <timothyprince@sbcglobal.net> writes:
>
> It also shows specifically that ENTRY or something like it was found in the
> source, and this is a known omission in the compiler.
Actually, it is fixed in the CVS repository. GCC 4.0.1 should
include it.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
| |
| Richard Maine 2005-05-22, 3:57 pm |
| "student" <adarsh@stat.tamu.edu> writes:
> That's not the problem. I have no "include" statements in the source
> code. And as I said this code was working fine on another compiler. I
> guess I need to look into what Steve has suggested.
I think you are going to need to show us the source if you need help
with it. I'm sure puzzzled by how you could get messages like the one
seen without having include, but in any case...
The messages explicitly refer to something being already done.
Regardless of whether the messages are correct or not, we'd
need to see what came before in order to have even a chance of
evaluating what is going on.
--
Richard Maine
email: my last name at domain
domain: summertriangle dot net
| |
| student 2005-05-23, 8:57 pm |
| Richard!
I am using the Fortran 90/95 compiler from Gnu compiler suite. The
command that I gave at the command prompt is as follows:
g90 -o file randlib.f/src/* matrixoperations.f90 gib.f90
drive_gibbs.f90
The directory randlib.f/src contains .f files to generate random number
deviates. The other code files are as follows. Please inform me as to
what you think about this. As I said earlier, this program was working
fine on another compiler.
------------------------
PROGRAM drive_gibbs
use matrix
use mcmc
IMPLICIT NONE
REAL, DIMENSION(2) :: mu
REAL, DIMENSION(2,2) :: sigma
REAL, DIMENSION(2) :: sample,temp
REAL, DIMENSION(6000,2) :: saved
INTEGER :: i,j
DO i = 1,size(mu,1)
mu(i) = i
end DO
DO i = 1,size(sigma,1)
DO j = 1,size(sigma,2)
IF (i/=j) THEN
! sigma(i,j)=i+j
! sigma(i,j)=0
sigma(i,j)=0.4*(i+j)
ELSE
sigma(i,j) = i**2
end IF
end DO
end DO
DO j = 1,size(sample,1)
temp(j)=mu(j)
end DO
CALL gibbsnorm(temp,mu,sigma,sample)
DO i = 1,50000
DO j = 1,size(sample,1)
temp(j)=sample(j)
end DO
CALL gibbsnorm(temp,mu,sigma,sample)
IF ((i > 20000).AND.(MOD(i,5)==0)) THEN
DO j = 1,size(sample,1)
saved(((i-20000)/5),j)=sample(j)
end DO
end IF
end DO
CALL printmatrix(saved)
end PROGRAM DRIVE_GIBBS
---------------------
MODULE matrix
CONTAINS
real function matrixmult(A,B) result(Mu)
IMPLICIT NONE
INTEGER :: i,j,k
INTEGER :: m,n1,n2,p
REAL,DIMENSION(:,:) :: A
REAL,DIMENSION(:,:) :: B
REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
m=size(A,1)
n1=size(A,2)
n2=size(B,1)
p=size(B,2)
IF (n1/=n2) THEN
WRITE(*,*) "Error in the multiplication procedure: Dimensions
not compatible"
ELSE
DO i=1,m
DO j=1,p
Mu(i,j)=0
end DO
end DO
DO i=1,m
DO j=1,p
DO k=1,n1
Mu(i,j)=Mu(i,j)+A(i,k)*B(k,j)
end DO
end DO
end DO
ENDIF
end function matrixmult
real function inv(A) result(In)
IMPLICIT NONE
REAL,DIMENSION(:,:) :: A
INTEGER :: m
REAL :: x,y
INTEGER::i,j,k,l
REAL,DIMENSION(size(A,1),2*size(A,2)) :: B
REAL,DIMENSION(size(A,1),size(A,2)) :: In
m=size(A,1)
IF (size(A,1)/=size(A,2)) THEN
WRITE(*,*) "Error in the inverse procedure: Matrix not square"
STOP
end IF
DO i=1,m
DO j=1,m
B(i,j)=A(i,j)
end DO
DO j=(m+1),2*m
IF((j-m)==i) then
B(i,j)=1
else
B(i,j)=0
end IF
end DO
end DO
DO i=1,m
x=B(i,i)
IF (x /= 0) THEN
DO j=i,2*m
B(i,j)=B(i,j)/x
end DO
IF (i>1) THEN
DO k=1,i-1
y=B(k,i)
DO l=i,(2*m)
B(k,l)=B(k,l)-y*B(i,l)
end DO
end DO
ENDIF
IF (i<m) THEN
DO k=i+1,m
y=B(k,i)
DO l=i,(2*m)
B(k,l)=B(k,l)-y*B(i,l)
end DO
end DO
ENDIF
ELSE
WRITE(*,*) "Error in the inverse procedure: Singular Matrix"
STOP
ENDIF
end DO
DO i=1,m
DO j=1,m
In(i,j)=B(i,j+m)
ENDDO
ENDDO
end function inv
real function trans(A) result(B)
IMPLICIT NONE
INTEGER::i,j
REAL,DIMENSION(:,:) :: A
REAL,DIMENSION(size(A,2),size(A,1)) :: B
DO i=1,size(A,1)
DO j=1,size(A,2)
B(i,j)=A(j,i)
end DO
end DO
end function trans
real function add(A,B) result(C)
IMPLICIT NONE
INTEGER::i,j
REAL,DIMENSION(:,:) :: A,B
REAL,DIMENSION(size(A,1),size(A,2)) :: C
IF ((size(A,1)/=size(B,1)).OR.((size(A,2)/=size(B,2)))) THEN
WRITE(*,*) "Error in the addition procedure: Matrix dimensions
not compatible!"
STOP
ELSE
DO i=1,size(A,1)
DO j=1,size(A,2)
C(i,j) = A(i,j) + B(i,j)
end DO
end DO
ENDIF
end function add
real function difference(A,B) result(C)
IMPLICIT NONE
INTEGER::i,j
REAL,DIMENSION(:,:) :: A,B
REAL,DIMENSION(size(A,1),size(A,2)) :: C
IF ((size(A,1)/=size(B,1)).OR.((size(A,2)/=size(B,2)))) THEN
WRITE(*,*) "Error in the addition procedure: Matrix dimensions
not compatible!"
STOP
ELSE
DO i=1,size(A,1)
DO j=1,size(A,2)
C(i,j) = A(i,j) - B(i,j)
end DO
end DO
ENDIF
end function difference
SUBROUTINE printmatrix(A)
IMPLICIT NONE
REAL,DIMENSION(:,:) :: A
INTEGER :: i,j
DO i = 1,size(A,1)
WRITE(*,*) (A(i,j),j=1,size(A,2))
end DO
WRITE(*,*) ""
end SUBROUTINE printmatrix
end MODULE matrix
------------------------------------------------
MODULE mcmc
CONTAINS
SUBROUTINE gibbsnorm(X,mean,varcov,sample) ! takes in mean and
variance-covariance matrix of jointly normal random variables and
returns a random
sample from that density using Gibbs'Sampler procedure; X is the
initial value
matrix
use matrix
IMPLICIT NONE
REAL, DIMENSION(:) :: mean,X
REAL, DIMENSION(:,:) :: varcov
REAL, DIMENSION(size(mean,1)), INTENT(OUT) :: sample
REAL, DIMENSION (size(mean,1),size(mean,1)) :: delta
REAL :: av,sd
INTEGER :: m,i,j,k
REAL, EXTERNAL :: gennor
IF (size(mean,1)/=size(X,1)) THEN
WRITE (*,*) "Error in gibbs sampler procedure: Dimension of the
initial value
matrix is not same as mean matrix!!"
STOP
end IF
IF (size(varcov,1)/=size(varcov,2)) THEN
WRITE(*,*) "Error in gibbs sampler procedure: The
variance-covariance matrix
is not square!!"
STOP
end IF
IF (size(mean,1)/=size(varcov,1)) THEN
WRITE (*,*) "Error in gibbs sampler procedure: Dimension of
variance-covariance matrix is not same as mean matrix!!"
STOP
end IF
m = size(mean,1)
delta = inv(varcov) !inverse of the variance-covariance matrix
DO k = 1,5 ! throw away the first 4 samples from the Gibbs' scheme
DO i = 1,m
av = mean(i)
IF (delta(i,i)<=0) THEN
WRITE (*,*) "Error in gibbs sampler procedure: not a valid
variance-covariance matrix!!"
STOP
end IF
sd = sqrt(1/delta(i,i)) ! variance of the conditional
distribution of the
i-th variable given the rest
!! Calculation of the mean of the conditional distribution
follows
DO j = 1,m
av = av -
(X(j)-mean(j))*(delta(j,i)+delta(i,j))/(2*delta(i,i))
end DO
av = av + (X(i)-mean(i))! mean of the conditional
distribution of the i-th
variable given the rest
X(i)=gennor(av,sd) ! sampling from the conditional density,
and updating
value
end DO
end DO
DO i = 1,m
sample(i) = X(i) !save the fifth sample
end DO
end SUBROUTINE gibbsnorm
end MODULE mcmc
| |
| student 2005-05-23, 8:57 pm |
| the error messages are as follows:
In file randlib.f/src/qrgnin.f:48
END
1
Internal Error at (1):
TODO: Functions with alternate entry points
In file matrixoperations.f90:14
REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
1
Error: Symbol 'mu' at (1) already has basic type of REAL
In file matrixoperations.f90:26
Mu(i,j)=0
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:33
Mu(i,j)=Mu(i,j)+A(i,k)*B(k,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:54
REAL,DIMENSION(size(A,1),size(A,2)) :: In
1
Error: Symbol 'in' at (1) already has basic type of REAL
In file matrixoperations.f90:107
In(i,j)=B(i,j+m)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:127
REAL,DIMENSION(size(A,2),size(A,1)) :: B
1
Error: Symbol 'b' at (1) already has basic type of REAL
In file matrixoperations.f90:131
B(i,j)=A(j,i)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:151
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:161
C(i,j) = A(i,j) + B(i,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:180
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:190
C(i,j) = A(i,j) - B(i,j)
1
Error: Unclassifiable statement at (1)
In file gibbsnorm.f90:9
use matrix
1
Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
such file or directory
In file drive_gibbs.f90:11
use matrix
1
Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
such file or directory
| |
| student 2005-05-23, 8:57 pm |
| For some reason all the error messages didnot appear in my previous
post. Here are they again:
In file randlib.f/src/qrgnin.f:48
END
1
Internal Error at (1):
TODO: Functions with alternate entry points
In file matrixoperations.f90:14
REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
1
Error: Symbol 'mu' at (1) already has basic type of REAL
In file matrixoperations.f90:26
Mu(i,j)=0
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:33
Mu(i,j)=Mu(i,j)+A(i,k)*B(k,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:54
REAL,DIMENSION(size(A,1),size(A,2)) :: In
1
Error: Symbol 'in' at (1) already has basic type of REAL
In file matrixoperations.f90:107
In(i,j)=B(i,j+m)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:127
REAL,DIMENSION(size(A,2),size(A,1)) :: B
1
Error: Symbol 'b' at (1) already has basic type of REAL
In file matrixoperations.f90:131
B(i,j)=A(j,i)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:151
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:161
C(i,j) = A(i,j) + B(i,j)
1
Error: Unclassifiable statement at (1)
In file matrixoperations.f90:180
REAL,DIMENSION(size(A,1),size(A,2)) :: C
1
Error: Symbol 'c' at (1) already has basic type of REAL
In file matrixoperations.f90:190
C(i,j) = A(i,j) - B(i,j)
1
Error: Unclassifiable statement at (1)
In file gibbsnorm.f90:9
use matrix
1
Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
such file or directory
In file drive_gibbs.f90:11
use matrix
1
Fatal Error: Can't open module file 'matrix.mod' for reading at (1): No
such file or directory
| |
| Steven G. Kargl 2005-05-23, 8:57 pm |
| In article <1116880608.034876.325640@g47g2000cwa.googlegroups.com>,
"student" <adarsh@stat.tamu.edu> writes:
> the error messages are as follows:
>
> In file randlib.f/src/qrgnin.f:48
>
> END
>
> 1
> Internal Error at (1):
> TODO: Functions with alternate entry points
Apparently, you haven't read my other posts. This has been fixed
and you need to get an updated distribution of GCC.
> In file matrixoperations.f90:14
>
> REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
> 1
> Error: Symbol 'mu' at (1) already has basic type of REAL
All of the remaining errors are probably bogus and cascade
from the above error.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
| |
| Richard E Maine 2005-05-23, 8:57 pm |
| In article <1116880608.034876.325640@g47g2000cwa.googlegroups.com>,
"student" <adarsh@stat.tamu.edu> wrote:
> Internal Error at (1):
> TODO: Functions with alternate entry points
This one is covered by other posters. (I will note that I generally
recommend against using alternate entries, but they are in the standard.
Also note that gfortran is explicitly labeled as still being in beta
state, so omissions like this aren't too shocking... and Karl says this
one is already fixed).
> In file matrixoperations.f90:14
>
> REAL,DIMENSION(size(A,1),size(B,2)) :: Mu
> 1
> Error: Symbol 'mu' at (1) already has basic type of REAL
Now that you show the source, I understand this one. (By the way, I
don't see the business about "include" in this copy of the error
messages; but in any case, I have the needed information now).
The compiler is correct. The type of MU was already declared. Look on
the function statement where it says "real function...". That "real" is
the culprit. You can declare the type either on the function statement
or in a subsequent type declaration statement, but not in both places.
My personal preference is to do it in a type declaration
statement...even more so because you need to declare dimensions for this
case, and that can't be done on the function statement. In other words,
just take the "real" off of "real function....".
All the other errors (except for the alternate entry one) are just
consequences of this one or extra cases of the same thing.
The compiler that accepted this was in error (or at least had poor
diagnostic capability). I suggest submitting a bug report to the
vendor... unless, of course, the compiler gave a warning message that
you ignored, or if you didn't ask for it to warn you about nonstandard
code. As is often noted on this newsgroup, the fact that a compiler
accepted something, and even did what was intended with it, is not very
conclusive evidence that the code is standard conforming or portable; it
does constitute some supporting evidence, but it isn't conclusive.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| student 2005-05-23, 8:57 pm |
| thanks richard! i figured that out a while back, and my code seems to
be running fine. steve, thanks for your post as well; i notified our
sys ad to install the newer version on our systems.
| |
| Ken Fairfield 2005-05-24, 3:56 am |
| student wrote:
> Richard!
>
> I am using the Fortran 90/95 compiler from Gnu compiler suite. The
> command that I gave at the command prompt is as follows:
>
> g90 -o file randlib.f/src/* matrixoperations.f90 gib.f90
> drive_gibbs.f90
>
> The directory randlib.f/src contains .f files to generate random number
> deviates. The other code files are as follows. Please inform me as to
> what you think about this. As I said earlier, this program was working
> fine on another compiler.
It's unclear from your text (elided) which file contains the source
you list. I do note one thing: Your main program, drive_gibs,
USEs matrix and mcmc. Those modules *must* have been compiled, and
the resulting .MOD (or whatever extension g90 gives them) files
must be available *before* and USErs of the modules are compiled.
If, as it appears, drive_gibs is first in the file, you'll get a
lot of errors.
Either put the modules in a separate file or files and compile them
first, or move them ahead of the main program in the file.
-Ken
--
I don't speak for Intel, Intel doesn't speak for me...
Ken Fairfield
D1C Automation VMS System Support
who: kenneth dot h dot fairfield
where: intel dot com
| |
| Janne Blomqvist 2005-05-24, 3:59 pm |
| student wrote:
> I am using the Fortran 90/95 compiler from Gnu compiler suite. The
> command that I gave at the command prompt is as follows:
In addition to what others have already said, I suggest you reduce
your own work burden by reading up on what the language provides and
thus avoid reinventing the wheel. For example, by using the features
the language provides, many of your functions can be removed:
> real function matrixmult(A,B) result(Mu)
This can be replaced with the MATMUL intrinsic.
> real function trans(A) result(B)
This can be replaced by the TRANSPOSE intrinsic.
> real function add(A,B) result(C)
By using an array expression, this function can be replaced by
C = A + B
> real function difference(A,B) result(C)
.... and this function can be replaced by
C = A - B
--
Janne Blomqvist
| |
| student 2005-05-25, 3:59 am |
| thanks.. will keep that in mind
|
|
|
|
|