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

Urgent Help -Compiling Fortran 90 with Visual Fortran

ehsan_n_
Beginner
1,525 Views

Dear all ,

I have a code written in Fortran 90 and now I urgently need to compile it to check some result and find out the procedure but I have encountered the below error and can not proceed .Can you please help me to fix the issue ;

-----------------------------------------------------------------------------------

Nab.exe has triggered a breakpoint.

The program '[8180] Nab.exe' has exited with code 29 (0x1d)

----------------------------------------------------------------------------------------

I have also added all messeages in the debug window as follows ;

-----------------------------------------------------------------------------------------------------------------

'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\libifcoremdd.dll'. Module was built without symbols.
'Nab.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\libmmd.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imagehlp.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Symbols loaded.
'Nab.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\1033\ifcore_msg.dll'. Module was built without symbols.
'Nab.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\1033\irc_msg.dll'. Module was built without symbols.
'Nab.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dbghelp.dll'. Symbols loaded.

---------------------------------------------------------------------------------------------------------------

Can you also guide me what is the correct procedure to compile a Fortran 90 file by  visual fortran (I mean the right thing to do to have the job done without error ?

Many Thanks in advance

0 Kudos
8 Replies
Arjen_Markus
Honored Contributor II
1,525 Views

You can use two methods:

  • Build a project and a solution using MS Visual Studio, if you have that
  • Use the command-line tools

Which to use depends on taste and size of your program and if you need the interactive debugger from Visual Studio. 

Setting up the project and solution may or may not be a lot of work. It is not all that complicated, the work is mostly selecting all the files, creating the various projects - each project will create a library or a program as a whole, so this depends on the set-up of your source code.

Your question is too general for us to be of much help. I guess you do have Visual Studio, so use the first method. The messages you show are of no help at all - they are just informative, but the information tells you only what the debugger has done, not what your program has done or is doing.

0 Kudos
mecej4
Honored Contributor III
1,525 Views

I suspect that there is no real problem here. If you build an EXE without debugging enabled, and you try to then run the program inside the debugger, the messages that you saw are going to be output. 

Try to find out if the program ran and did what it was supposed to do (write an output file, display results, etc.). You many need to put a PAUSE statement at the end of the main program or insert a breakpoint at the last executable statement that you expect the program to run through before exiting. Better still, just run the EXE in a command window and observe what it does.

0 Kudos
Les_Neilson
Valued Contributor II
1,525 Views

From the list of run time error messages for ifort

error 29 is "File not found." If you didn't get the message "File not found" then something else is happening. If you did get the file not found message then that is the obvious cause.

OK a google search for "exit code 29" throws up some possibilities:

a) "Directory access error" (Perhaps Nab is trying to access a directory which does not exist or is not in the places where Nab.exe can see)

b) "Windows System Error 29 The system cannot write to the specified device. "

Without further information it is difficult to know how to help

Les

0 Kudos
andrew_4619
Honored Contributor III
1,525 Views

Compile with debug options. Set a break point on the first executable line and then runner your exe with debugger. Step through the program under debug.....

0 Kudos
ehsan_n_
Beginner
1,525 Views

Thanks all for the helps.

I have used break point and debugger and found that the problem comes from the below part of the code where the message appears that "Nab.exe has triggered a breakpoint".  . I have three text file in the project folder to read some data from them.

--------------------------------------------------------------------------

	allocate (t(n_total),ft(n_total))

	
	OPEN (unit=3, file="time_Mini.txt",action="read",status="old")
	do i= 1, n_total
   40 format (f18.14)
	read (3, 40, iostat=inputstatus) t(i)
	if (inputstatus > 0 ) stop "*** Cannot open file ***"
	if (inputstatus < 0 ) exit !end of file
	end do
	close (3)

	OPEN (unit=5, file="pressure_Mini.txt",action ="read",status="old")
	do i= 1, n_total
   70 format (f18.14)
	read (5, 70, iostat=inputstatus) ft(i)
	if (inputstatus > 0 ) stop "*** Cannot open file ***"
	if (inputstatus < 0 ) exit !end of file
	end do
	close (5)


	OPEN (unit=10, file="Rate_Mini.txt",action="read",status="old")
	Allocate(rate(n_rate),t_rate(n_rate))
	Do i=1, n_rate
		Read(10,*) t_rate(i), rate(i)
	End Do

 

-------------------------------------------------------------------------------------------

and the error is that (Please see the attached file )

servere (24) : end-of -file during read, unit 10

Nab.exe has triggered a breakpoint.

 

----------------------------------------------------------------------------------------

I would be very grateful if some one help me to fix the issue.Sorry if my question might be very simple as I am beginner in Fortran and try to compile a file to track some variable and then write my code in Matlab.

Thanks in advance

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,525 Views

What is the value of n_rate?
What is the content of Rate_Mini.txt?

The error message states you read beyond the end of file (attempted to read more records than were in the file).

Jim Dempsey

0 Kudos
ehsan_n_
Beginner
1,525 Views

jimdempseyatthecove wrote:

What is the value of n_rate?
What is the content of Rate_Mini.txt?

The error message states you read beyond the end of file (attempted to read more records than were in the file).

Jim Dempsey

Thanks Jim ,

The n_rate is 32 .

and the Rate_mini is a text file including two colum data ( as attached ).

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,525 Views

The file you sent does have 32 lines (records) and should have read without having End Of File.

One thing that comes to mind is that the OPEN statement is opening a file of the same name, but not the same as you attached.

The open statement uses "Rate_Mini.txt" which defaults to current directory at time of open and current drive at time of open. There is nothing inherently wrong with this as long as the current directory is as you expect. Did the file you attached reside in C:\Users\Desktop\Iseger-try\Nab\Nab\Rate_Mini.txt, or did you upload a copy of what you thought it to be (but in fact was not)?

I do notice that you file contains TAB characters. This is generally frowned upon. Try replacing TAB with SPACE (one or up to tab stop).

For diagnostic purposed, add some writes to see what happens.

Do i=1, n_rate 
  write(*,*) "i=",i
  Read(10,*) t_rate(i), rate(i) 
  write(*,*) t_rate(i), rate(i)
End Do 

Jim Dempsey

0 Kudos
Reply