- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all !!
I have a simple program which reads a file and displays it. The program is the following and is in a file "exp4.f90"
[fortran]program exp4 implicit none character(79)::line open(unit=1,file='top_all27_prot_na.rtf',action='read',ACCESS='STREAM',FORM='FORMATTED') do read(1,'(a)',END=10)line !! Read line as string write(*,*)line enddo 10 write(*,*)'Done !!' end program exp4[/fortran] When I compile and run it as:
ifort exp4.f90
./a.out > ifortOP.txt
The file ifortOP.txt has discrepencies in it with respect to the original file, like some lines are missing altogether, some lines are read half-way or mingled with other lines. For example, a group of 5 lines in the original input file is:
I have a simple program which reads a file and displays it. The program is the following and is in a file "exp4.f90"
[fortran]program exp4 implicit none character(79)::line open(unit=1,file='top_all27_prot_na.rtf',action='read',ACCESS='STREAM',FORM='FORMATTED') do read(1,'(a)',END=10)line !! Read line as string write(*,*)line enddo 10 write(*,*)'Done !!' end program exp4[/fortran] When I compile and run it as:
ifort exp4.f90
./a.out > ifortOP.txt
The file ifortOP.txt has discrepencies in it with respect to the original file, like some lines are missing altogether, some lines are read half-way or mingled with other lines. For example, a group of 5 lines in the original input file is:
ATOM CE1 CPH2 0.25
ATOM HE1 HR1 0.13
ATOM NE2 NR2 -0.70
ATOM CD2 CPH1 0.22
ATOM HD2 HR3 0.10
the lines in the ifortOP.txt in place of these is:
ATOM CE1 CPH2 0.25
ATOM HE1 HR1 0.13
ATOM NE2 0.22
ATOM HD2 HR3 0.10
Also, when I compile and run the same program with gfortran as:
gfortran exp4.f90
./a.out > gfortOP.txt
The resultant gfortOP.txt has no problems.
Please note that between the compilation and run sequence with ifort and gfortran, the source code file (exp4.f90) and the input file (top_all27_prot_na.rtf) remain the same.
For reference the output of ifort -v is: Version 11.0.
I am totally clueless as to why this is happening. Any ideas?
Thank you in advance !!
Also, when I compile and run the same program with gfortran as:
gfortran exp4.f90
./a.out > gfortOP.txt
The resultant gfortOP.txt has no problems.
Please note that between the compilation and run sequence with ifort and gfortran, the source code file (exp4.f90) and the input file (top_all27_prot_na.rtf) remain the same.
For reference the output of ifort -v is: Version 11.0.
I am totally clueless as to why this is happening. Any ideas?
Thank you in advance !!
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you please attach a sample input file? Put it in a .tar or .tgz archive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it feasible for you to update your Intel compiler? Version 11.0 is rather old.
With Gfortran 4.6 and IFort 12.1.4, I do not get any differences in outputs.
[bash]LANG> gfortran exp4.f90 LANG> tar xf top_all27_prot_na.rtf.tar LANG> ./a.out > gfort.out LANG> ifort exp4.f90 LANG> ./a.out > ifort.out LANG> diff -w ifort.out gfort.out LANG> [/bash]
With Gfortran 4.6 and IFort 12.1.4, I do not get any differences in outputs.
[bash]LANG> gfortran exp4.f90 LANG> tar xf top_all27_prot_na.rtf.tar LANG> ./a.out > gfort.out LANG> ifort exp4.f90 LANG> ./a.out > ifort.out LANG> diff -w ifort.out gfort.out LANG> [/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, there is an mpich2 installation that is dependent on this compiler, and two other libraries (PETSc and SLEPc) which are dependent on mpich2. So I think I cant simply update the compiler and get it over with. But still, I dont know what other choice I have.
Even if I abandon ifort for gfortran, I would have to install all the libraries again. So either way I will end up installing all the libraries.
Can you tell me how I can easily update the ifort to version 12.1.4? I am not able to find a download page where I can simply download ifort 12.1.4. What I am able to find is this:
http://software.intel.com/en-us/articles/non-commercial-software-download/
I understand that theIntelFortran Composer XE 2011 for Linuxwill have the latest fortran compiler, but the whole package is too big (412 MB) for my internet connection. Is there some way I can simply update ifort?
(Sorry, I am a novice linux user)
Thanks !!
Even if I abandon ifort for gfortran, I would have to install all the libraries again. So either way I will end up installing all the libraries.
Can you tell me how I can easily update the ifort to version 12.1.4? I am not able to find a download page where I can simply download ifort 12.1.4. What I am able to find is this:
http://software.intel.com/en-us/articles/non-commercial-software-download/
I understand that theIntelFortran Composer XE 2011 for Linuxwill have the latest fortran compiler, but the whole package is too big (412 MB) for my internet connection. Is there some way I can simply update ifort?
(Sorry, I am a novice linux user)
Thanks !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please ask licensing questions in the Licensing Forum. If your support is current you should be able to download an update, but you will need to log in with credentials.
Most of the current Intel Fortran downloads are over 300 Mbytes.
I remounted an old hard drive with IFort 11.0.061 (Windows). That version of the compiler showed the same problems as those that you described. Removing the ACCESS='STREAM' option to the OPEN statement allowed the program to work.
I realize that this may not work with the Linux version and may not be feasible in your real application.
Note that Intel Fortran uses 4-bytes as the default "file storage unit" rather than the byte as in other compilers. If your program has INQUIRE and other statements that refer to file position or record length, read your compiler documentation for switches that relate to this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At https://registrationcenter.intel.com you can log into the support account attached to your license and download any updates issued up to the end of the license period. If the support account hasn't been created by registering the license, you can do it first at that site. You can download the 32- and 64- bit compilers separately or in a combined tar file. Yes, it may be impractical if you have only dial-up or equivalent. There is a download manager which may be able to cope with incomplete download sessions.
If your mpich2 was correctly built for ifort 11, it ought to continue working with an updated ifort.
If your mpich2 was correctly built for ifort 11, it ought to continue working with an updated ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I build and run the program with the current 12.1 compiler, I get an output file that is the same as the input, other than line truncation due to the declaration of LINE as 79 characters. I note that this file has Windows-style line terminators which may or may not be an issue with ACCESS='STREAM'.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page