I'm very new to fortran, and frankly anything but the simplest building procedures. I'm trying to compile a large code package on a remote server, it worked on my laptop using gfortran
(gfortran-mp-4.8
), but it's complaining using ifort
(ifort (IFORT) 13.0.0
).
These are my errors:
/n/sw/centos6/openmpi-1.6.4_intel-13.0.079/bin/mpif90 -ggdb -c -O2 -fdefault-real-8 -fdefault-double-8 -Wuninitialized -DMAXBLOCKS=1000 -DNXB=8 -DNYB=8 -DNZB=8 -DN_DIM=3 nrutil.F90
ifort: command line warning #10006: ignoring unknown option '-fdefault-real-8'
ifort: command line warning #10006: ignoring unknown option '-fdefault-double-8'
ifort: command line warning #10157: ignoring option '-W'; argument is of wrong type
nrutil.F90(713): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [DCOS]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
--------------------------------------^
nrutil.F90(713): error #6404: This name does not have a type, and must have an explicit type. [DCOS]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
--------------------------------^
nrutil.F90(713): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [DSIN]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
----------------------------------------------------^
nrutil.F90(713): error #6404: This name does not have a type, and must have an explicit type. [DSIN]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
----------------------------------------------^
nrutil.F90(713): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [CMPLX]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
--------------------------------^
nrutil.F90(713): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [CMPLX]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
----------------------------------------------^
nrutil.F90(713): error #6404: This name does not have a type, and must have an explicit type. [CMPLX]
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
--------------------------^
compilation aborted for nrutil.F90 (code 1)
and (what I'm hoping is) the relevant code:
...
USE nrtype
implicit none
...
!BL
FUNCTION zroots_unity(n,nn)
INTEGER(I4B), INTENT(IN) :: n,nn
COMPLEX(SPC), DIMENSION(nn) :: zroots_unity
INTEGER(I4B) :: k
REAL(SP) :: theta
zroots_unity(1)=1.0
theta=TWOPI/n
k=1
do
if (k >= nn) exit
zroots_unity(k+1)=cmplx(dcos(k*theta),dsin(k*theta),SPC)
zroots_unity(k+2:min(2*k,nn))=zroots_unity(k+1)*&
zroots_unity(2:min(k,nn-k))
k=2*k
end do
END FUNCTION zroots_unity
!BL
and the file nrtype
includes the definition of TWOPI
MODULE nrtype
...
REAL(SP), PARAMETER :: TWOPI=6.283185307179586476925286766559005768394_sp
...
END MODULE nrtype
dcos
, dsin
and cmplx
are built-in functions, right? So it must be complaining about the arguments... but it looks like both k
and theta
are given explicit types: INTEGER
and REAL
respectively (I don't know what (I4B)
and (SP)
mean)...
Any help would be much appreciated