Error in Execution of Program: Find_Neighbor

  • Thread starter Physicslad78
  • Start date
  • Tags
    Error
In summary, The conversation is about a program that is having trouble with execution, specifically an error related to a file called ngh.in. The program is then posted for others to give tips on. It is mentioned that there may be an issue with the program trying to read more items than are in the input file.
  • #1
Physicslad78
47
0
Hello All

I am trying to compile a program and I guess it compiles fine but there is a problem in execution. I get the following error:

End of file
apparent state: unit 5 (ngh.in)
last format: list io
lately reading direct formatted external IO
Aborted


I am not sure what the error is actually (I am sure it is in open related to file ngh.in). I will post the program here and I appreciate it if someone can give me tips. Thanks

program find_neighbor
c
implicit double precision (a-h,o-z)
parameter(natm=12,nlmx=1000)
dimension aa(3,3),xa(3,natm)
c
open(5,file='ngh.in')
open(6,file='ngh.list')
c
read (5,*) ishell
write (6,'(/a,i1)') ' ishell = ',ishell
read (5,*) rc,alat
write (6,'(/a,2(3f8.3,2x))') ' rc and alat = ',rc,alat
rc=rc/alat
c
write (6,'(/a)') ' real space lattice vectors:'
do i=1,3
read (5,*) (aa(j,i),j=1,3)
write (6,'(3f8.3)') (aa(j,i),j=1,3)
end do
c
read (5,*) nat
write (6,'(/a,i2)') ' nat =',nat
c
write (6,'(/a)') ' atom coordinates:'
do iat=1,nat
read (5,*) (xa(j,iat),j=1,3)
write (6,'(i2,3f10.5)') iat,(xa(j,iat),j=1,3)
end do
c
call neigh(ishell,nat,aa,xa,alat,rc)
call sort(n,ra,rb,iatm,lv,wksp,iwksp)
call indexx(n,arrin,indx)
call shell(nn,ns,arn,axn,it)
c
end
 
Technology news on Phys.org
  • #2
It looks like your program tried to read more things than were in the input file. To confirm this, count the number of items in the file, and count the number of items your program is trying to read.
 

Related to Error in Execution of Program: Find_Neighbor

1. What is "Error in Execution of Program: Find_Neighbor"?

"Error in Execution of Program: Find_Neighbor" is an error message that indicates there was a problem running a program that is designed to find a neighboring value or element in a data set. This error can occur due to various reasons, such as incorrect code, missing dependencies, or data input issues.

2. What causes "Error in Execution of Program: Find_Neighbor"?

The most common cause of this error is a mistake in the code or algorithm used in the program. It can also occur due to missing or corrupt files, incorrect data input, or compatibility issues with other software or systems.

3. How can I fix "Error in Execution of Program: Find_Neighbor"?

The first step to fixing this error is to carefully review the code or algorithm used in the program. Look for any syntax errors or logical mistakes that may be causing the error. If the code seems correct, check for any missing dependencies or data input issues. If the error persists, try running the program on a different system or software environment.

4. Can "Error in Execution of Program: Find_Neighbor" be prevented?

While it is not possible to prevent this error completely, you can minimize the chances of it occurring by thoroughly testing your code before running it and ensuring that all dependencies and data inputs are accurate. Additionally, regularly updating your software and checking for any compatibility issues can also help prevent this error.

5. How can I avoid "Error in Execution of Program: Find_Neighbor" in the future?

To avoid this error in the future, it is essential to follow good coding practices and thoroughly test your code before running it. Additionally, regularly updating your software and checking for any compatibility issues can also help prevent this error. It is also helpful to have a backup of your code and data in case of any unexpected errors or issues.

Similar threads

  • Programming and Computer Science
Replies
4
Views
750
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
5
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
3
Replies
70
Views
3K
  • Programming and Computer Science
Replies
2
Views
469
Replies
6
Views
1K
  • Programming and Computer Science
3
Replies
75
Views
4K
Back
Top