What is the cause of these error- symbol 'x1' has no implicit type?

Click For Summary

Discussion Overview

The discussion revolves around a Fortran programming error related to variable declarations, specifically the error message indicating that certain symbols have no implicit type. Participants explore potential causes of this error in the context of a subroutine for a 1D scalar wave simulation.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their Fortran code and the error message they receive regarding undeclared variables.
  • Another participant suggests that the error may originate from parts of the program not shown, indicating that the variables might not be declared elsewhere in the program.
  • A different participant notes that the variables were redeclared in the subroutine after being passed from the main program, which could lead to confusion.
  • One participant mentions a historical programming issue related to variable type changes in a different context, drawing a parallel to the current problem.
  • One participant reports that they resolved the issue and successfully compiled the code without errors.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the source of the error, as the discussion includes multiple perspectives on potential causes and solutions. Some participants suggest that the issue lies in the main program or other subroutines, while others focus on the redeclaration of variables.

Contextual Notes

There is an indication that the error may depend on how variables are declared and used across different parts of the program, but specific details about the main program and other subroutines are not provided.

s_hy
Messages
57
Reaction score
0
Hi all,

i am beginner in fortran and linux. I have wrote codes for 1d scalar wave as below:

SUBROUTINE fd1d (x_num,x1,x2,t_num,t1,t2,c,u_x1,u_x2,u_t1,ut_t1,u)
implicit none
integer (kind=2) t_num,x_num,t,x
real (kind=4) alpha,c,t_delta,t1,t2,u(t_num+1,x_num+1),ut(x_num+1),x_delta,x1,x2
t_delta = (t2-t1)/real(t_num,kind=4)
x_delta = (x2-x1)/real(x_num,kind=4)
alpha = c*t_delta/x_delta
write ( *,'(a)')''
write ( *,'a,g14.6)') 'Stability condition ALPHA = C * DT/DX = ',alpha
Open (103, FILE='parameters.DAT',status='old')
Open(90, File = "abc.dat", ACCESS = 'APPEND')

!the boundary conditions
call u_x1 ( t_num,x_num,u )
call u_x2 ( t_num,x_num,u )

!the initial data
call u_t1 ( t_num,x_num,u )
call ut_t1( x_num,ut )

t=1
do x=2, x_num
u(t+1,x) = alpha**2 * u(t,x+1) / 2.0D+00 + ( 1.0D+00-alpha**2 ) * u(t,x) &
+ alpha**2 * u(t,x-1) / 2.0D+00 + t_delta * ut(x)
end do

!All subsequent steps in time rely on two previous rows of solution data

do t=2, t_num
do x=2, x_num
u(t+1,x) = alpha**2 * u(t, x+1) + 2.0D+00 * (1.0D+00-alpha**2) * u(t, x) &
+ alpha**2 * u(t, x-1) - u(t-1,x)
end do
end do
return
end SUBROUTINE fd1d


when i am trying to compile, there are errors referring to all parameters which is "symbol 'x1' (and t1, c, x2...) has no implicit type. What is that mean?
 
Technology news on Phys.org
The variables that you list (x1, t1, c, and x2) are declared in the subroutine you showed, so my guess is that the error arises in some other part of your program, a part you didn't show us. Are these variables being used elsewhere in your program? If so, they probably aren't being declared in those places.

What we aren't seeing is the main program and the four subroutines that are called in the code above, plus whatever else makes up the entire program.

The compiler or linker probably gave more information than you showed, such as the line number at which the error occurred. That information can help you narrow down the source of the problem.
 
thank you for ur time mark44. the list of subroutines that i didn't list here are quite long, might be bothering. I have found out the problem and finally have succeed to compile it without any error.

thanks again
 
Hi guys,

Mark44 said:
The variables that you list (x1, t1, c, and x2) are declared in the subroutine you showed, so my guess is that the error arises in some other part of your program, a part you didn't show us.

The variables were re declared in the subroutine after being passed from the main program.

s_hy, see what happens when you change types between the main and the subroutine for future reference.

The windows wobble bug was similar and caused approx 60,000 programs to have errors when run in win 2000 (NT). The win com/com+ model created an extra thread on early dual processor systems that ran out after 8 ocurrences of a subroutine type change error.
 
Last edited:

Similar threads

  • · Replies 9 ·
Replies
9
Views
10K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
7K