Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28638 Discussions

error #6410: This name has not been declared as an array or a function and similar issues

JoseLozano
New Contributor I
941 Views

Hello Dear Community,

 

Once again, I need your help in FORTRAN language. I'm running a modified version of the code called CosmoMC (https://github.com/ealmaraz/Bound_Dark_Energy_CosmoMC/tree/master/source).  When I run "make" in the source file I got some errors as follows: 

 

CosmologyParameterizations.f90(95): error #6410: This name has not been declared as an array or a function. [ABDE]
abde(1) = ac_param
---------^
CosmologyParameterizations.f90(97): error #6410: This name has not been declared as an array or a function. [XBDE]
xbde(1) = y(1)
---------^
CosmologyParameterizations.f90(98): error #6410: This name has not been declared as an array or a function. [YBDE]
ybde(1) = y(2)
---------^
CosmologyParameterizations.f90(99): error #6410: This name has not been declared as an array or a function. [LBDE]
lbde(1) = y(3)
---------^
CosmologyParameterizations.f90(114): error #6410: This name has not been declared as an array or a function. [NBDE]
Nbde(i+1) = tout
------------^
CosmologyParameterizations.f90(115): error #6423: This name has already been used as an external function name. [ABDE]
abde(i+1) = ac_param*exp(Nbde(i+1))
------------^
CosmologyParameterizations.f90(115): error #6515: This function, which is specified as the left side of an assignment statement, is invalid. [ABDE]
abde(i+1) = ac_param*exp(Nbde(i+1))
------------^
CosmologyParameterizations.f90(115): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [EXP]
abde(i+1) = ac_param*exp(Nbde(i+1))
-------------------------------------^
CosmologyParameterizations.f90(115): error #6404: This name does not have a type, and must have an explicit type. [EXP]
abde(i+1) = ac_param*exp(Nbde(i+1))
---------------------------------^
CosmologyParameterizations.f90(117): error #6423: This name has already been used as an external function name. [XBDE]
xbde(i+1) = y(1)
------------^
CosmologyParameterizations.f90(117): error #6515: This function, which is specified as the left side of an assignment statement, is invalid. [XBDE]
xbde(i+1) = y(1)
------------^
CosmologyParameterizations.f90(118): error #6423: This name has already been used as an external function name. [YBDE]
ybde(i+1) = y(2)
------------^
CosmologyParameterizations.f90(118): error #6515: This function, which is specified as the left side of an assignment statement, is invalid. [YBDE]
ybde(i+1) = y(2)
------------^
CosmologyParameterizations.f90(119): error #6423: This name has already been used as an external function name. [LBDE]
lbde(i+1) = y(3)
------------^
CosmologyParameterizations.f90(119): error #6515: This function, which is specified as the left side of an assignment statement, is invalid. [LBDE]
lbde(i+1) = y(3)
------------^
CosmologyParameterizations.f90(126): error #6404: This name does not have a type, and must have an explicit type. [DDXBDE]
call spline(Nbde,xbde,NumPoints,splZero,splZero,ddxbde)
---------------------------------------------------------^
CosmologyParameterizations.f90(127): error #6404: This name does not have a type, and must have an explicit type. [DDYBDE]
call spline(Nbde,ybde,NumPoints,splZero,splZero,ddybde)
---------------------------------------------------------^
CosmologyParameterizations.f90(128): error #6404: This name does not have a type, and must have an explicit type. [DDLBDE]
call spline(Nbde,lbde,NumPoints,splZero,splZero,ddlbde)
---------------------------------------------------------^
CosmologyParameterizations.f90(319): error #6404: This name does not have a type, and must have an explicit type. [XBDE]
x0 = xbde(NumPoints)
-----------------^
CosmologyParameterizations.f90(320): error #6404: This name does not have a type, and must have an explicit type. [YBDE]
y0 = ybde(NumPoints)
-----------------^
compilation aborted for CosmologyParameterizations.f90 (code 1)
make: *** [Makefile:288: ReleaseMPI/CosmologyParameterizations.o] Error 1

 

According to the file, the subroutine that contains these errors is written as follows:

 

subroutine cosmomc_bde_background
use Quint
use constants

!parameters for DLSODA
integer neq, itol, itask, istate, iopt, lrw, liw, jt
real(dl) y(3), atol(3), rwork(70), iwork(23)
real(dl) t, tout, rtol
real(dl) tc, t0

integer i
real(dl) splZero

!input parameters for using DLSODA (see odepack.f for full documentation)
neq = 3
itol = 2
rtol = 1.e-4
atol(1) = 1.e-8
atol(2) = 1.e-8
atol(3) = 1.e-8
itask = 1
istate = 1
iopt = 0
lrw = 70
liw = 23
jt = 1

!ac_param and others have been already initialized when calling SetForH
tc = log(ac_param/ac_param)
t0 = log(1._dl/ac_param)

!initialization of dN
dN = log(1._dl/ac_param)/(NumPoints-1)

y(1) = sqrt(OmegaDGc_param*(1._mcp+wDGc_param)/2._mcp)
y(2) = sqrt(OmegaDGc_param*(1._mcp-wDGc_param)/2._mcp)
y(3) = sqrt(Mpl2)*alphaBDE_param/Lambdac_param

!first point: initial conditions at ac
Nend(1) = tc
abde(1) = ac_param

xbde(1) = y(1)
ybde(1) = y(2)
lbde(1) = y(3)

phi_a(1) = alphaBDE_param/lbde(1)
phidot_a(1) = abde(1)*sqrt(2._mcp*cosmomc_bde_v(phi_a(1)))*xbde(1)/ybde(1)

!first call to DLSODA: this is just to break the initial stiffness of the problem
t = 0
tout = 1.e-12
CALL DLSODA(cosmomc_bde_equations,neq,y,t,tout,itol,rtol,atol,itask,istate,iopt,rwork,lrw,iwork,liw,cosmomc_jac,jt)
if (istate /= 2) write(*,*) 'DLSODA failed!'

!subsequent calls to DLSODA: we evolve the system from tout up to the present time
do i=1, NumPointsEx-1
tout = dN*i
CALL DLSODA(cosmomc_bde_equations,neq,y,t,tout,itol,rtol,atol,itask,istate,iopt,rwork,lrw,iwork,liw,cosmomc_jac,jt)
Nbde(i+1) = tout
abde(i+1) = ac_param*exp(Nbde(i+1))

xbde(i+1) = y(1)
ybde(i+1) = y(2)
lbde(i+1) = y(3)

phi_a(i+1) = alphaBDE_param/lbde(i+1)
phidot_a(i+1) = abde(i+1)*sqrt(2._mcp*cosmomc_bde_v(phi_a(i+1)))*xbde(i+1)/ybde(i+1)
end do

!Once the system is solved, we make some needed interpolations
call spline(Nbde,xbde,NumPoints,splZero,splZero,ddxbde)
call spline(Nbde,ybde,NumPoints,splZero,splZero,ddybde)
call spline(Nbde,lbde,NumPoints,splZero,splZero,ddlbde)
call spline(Nbde,phi_a,NumPointsEx,splZero,splZero,ddphi_a)
call spline(Nbde,phidot_a,NumPointsEx,splZero,splZero,ddphidot_a)
end subroutine cosmomc_bde_background

 

I'm using Intel Fortran Compiler 2021.10.0 even though ifort 2015.0.7 does not detect this error. Do you have a way to fix these errors?

0 Kudos
1 Solution
JoseLozano
New Contributor I
932 Views

Hello people, 

 

Sorry for this post. I think I detected the issue. I forgot to compile another file. 

 

Sorry again for this post. 

 

View solution in original post

0 Kudos
2 Replies
JoseLozano
New Contributor I
933 Views

Hello people, 

 

Sorry for this post. I think I detected the issue. I forgot to compile another file. 

 

Sorry again for this post. 

 

0 Kudos
mecej4
Honored Contributor III
896 Views

Here is a tip for you. When you attempt to compile a Fortran source file that contains USE <module_name> statements, and the corresponding module file (*.mod) does not exist, the compiler will issue an error message that the required module file was not found. Any subsequent error messages regarding undeclared variables, etc., which may be quite numerous, should be ignored until the missing module file is made available and the compilation attempted again.

0 Kudos
Reply