- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The program writes out a prompt using a formatted write statement and then attempts to read a user input from keyboard using a formatted read. The problem is that the program does not seem to take the carriage return as the end of the input. I seem to have to hit ctrl c. A subsequent write statement verifies that the input was otherwise read correctly.
The program was originally asking for character input, but I tried a variation trying to enter an integer and both versions have this problem.
FMT2 = '(A)'
1000 WRITE(*, FMT1 ) PROMPT
READ( *, FMT2, ERR=1000 ) STRING
Any help would be greatly appreciated.
Link Copied
- 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
Unless there is a compiler flag issue, I can't see why version 9.1 should behave differently than 8.1.
- 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
But when I compile my real program without that flag, I get a host of errors related to MSVCRT.LIB and various functions already defined.
If I try to fix that with nodefaultlib:MSVCRT, I get other errors regarding one of our own libraries with unresolved external symbols. I have to use that internal library but have no control over how it is compiled and I am not familiar enough with all this library/dll stuff to know how to resolve all these things except with my original libs:dll.
Any thoughts on how to resolve these issues?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please show me your six-line program and describe the input you provide.
You may have an old copy of the Fortran DLLs on the system - search the system for libifcoremd.dll and see how many copies you have and where they are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Program Main
INTEGER :: I
WRITE(*, 1) 'This is the first prompt '
READ (*, 2) I
WRITE(*, 3) 'The first value entered was ', I
WRITE(*, 1) 'This is the second prompt '
READ (*, 2) I
WRITE(*, 3) 'The second value entered was ', I
1 Format (1X, A)
2 FORMAT (I3)
3 FORMAT (1X, A, I6)
END
I can't seem to paste with the same formatting. My file is based on /nofree so most of the code starts in col 7.
compiled with
ifort /iface:nomixed_str_len_arg /nologo /Qip /4L132 /nofree /4Na /libs:dll /threads /fpscomp:all /convert:big_endian /traceback /fpe:0 /Od /debug:full /Z7 /check:all console.f90
Here's the result where the program's output after the first prompt occured after I hit ctrl C:
console.exe
This is the first prompt
12345
78
34
22
The first value entered was 123
This is the second prompt
The second value entered was 78
forrtl: severe (28): CLOSE error, unit -4, file "Unknown"
The dll file is found in several places on my system but the which command tells this is the one being used:
which libifcoremd.dll /
c/Program Files (x86)/Intel/Compiler/Fortran/9.1/EM64T/Bin/libifcoremd.dll
This is dated in 2007. There some from 2009 in system folders.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am confused by your description of running the program. You show four lines of input data, but talk about pressing ^C "after the first prompt". Please explain what you did in more detail. I don't see how this program could accept four lines of input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So no, the program should not have taken 4 numbers and in fact it only read the first 2. But I could have entered as many numbers as I had patience for and the program would not respond until I finally entered ctrl C.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That said, I still have not been able to reproduce the problem using 9.1, but there might be something tied into your using a bash window.
Do you really need -fpscomp:all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will try compiling the small program without the fpscomp to see if that fixes the problem. I noticed that your 9.1 version was slightly later than mine. We have a site license controlled by the IT department. Should it be difficult for them to update to the latest 9.1 and would it be free?
If I try the 11.1 libraries, what would I have to do to backup my existing libraries in case I need to revert?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use the redistributable package, it puts the new libraries in a separate location and leaves the 9.1 libraries alone. Note that you need to be linked to the DLL libraries for this to work for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was reminded that policy forbids anyone from installing anything except through internal approved sources so I can not install the libraries from your link. With so many computers to support, the IT folks like to keep a tight rein on installed software and "images".
I did recompile without the fpscomp flag and my problem did go away. I also recompiled my real application and it seems to work fine. I don't know how or why that flag got into our flag set but I am not the only one using it. I had thought it might be required in order for the executable to be compatible with some users' hardware but now, as I look at the description, it seems to be needed only if we are using some non-standard fortran features that were available in power station fortran. Although our code is a mixture of old and somewhat current fortran, we do not use nonstandard features so I believe we do not need the fpscomp flag. And if that is the case, I would prefer to get rid of it and keep my software image standard with the rest of the company.
Unless you can advise further regarding the criteria for using or not using the fpscomp flag, I think I have my answer and I thank youfor finding it.
It's too bad that my trial and error method of looking for a problem flag led to the libs:dll before I tried the fpscomp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page