I am currently working on an IBM PowerPC64 Blade, using a RHELinux3.0AS operating system, with Absoft 95 as the fortran compiler. I have a mixture of Fortran 77 & 90 code.
I am trying to insert a couple lines of code into either the 77 or 90 code, that will: pause and prompt the user for some number, print out that number, then continue on it’s way.
I understand it is fairly easy to do this and have seen this done in various ways:
write(*,*) ‘Enter number ‘
read(*,*) numb
write(*,*) ‘Number was ‘, numb
or
write(*,’(I,$)’) ‘Enter number ‘
read(*,’(I)’) numb
write(*,*) ‘Number was ‘, numb
or
write(6,*) ‘Enter number ‘
read(5,*) numb
write(*,*) ‘Number was ‘, numb
or
write(6, ‘(I,$)’) ‘Enter number ‘
read(5,’(I)’) numb
write(*,*) ‘Number was ‘, numb
or
using FORMAT statements like
write(*, 2)
2 FORMAT (‘Enter number: ‘, $)
etc.
I have tried all these ideas and nothing seems to stop the program in order to get the value. What happens is the program simply continues on and the output looks like this:
1130271200 Number entered was= 0
I assume the numbers in front are my first write & read statements. Does anyone have an idea of what is going on? Why it is not stopping for input? Any help or guidance would be much appreciated. Thank you,
Sylvia
"Try everything at least once."
I am trying to insert a couple lines of code into either the 77 or 90 code, that will: pause and prompt the user for some number, print out that number, then continue on it’s way.
I understand it is fairly easy to do this and have seen this done in various ways:
write(*,*) ‘Enter number ‘
read(*,*) numb
write(*,*) ‘Number was ‘, numb
or
write(*,’(I,$)’) ‘Enter number ‘
read(*,’(I)’) numb
write(*,*) ‘Number was ‘, numb
or
write(6,*) ‘Enter number ‘
read(5,*) numb
write(*,*) ‘Number was ‘, numb
or
write(6, ‘(I,$)’) ‘Enter number ‘
read(5,’(I)’) numb
write(*,*) ‘Number was ‘, numb
or
using FORMAT statements like
write(*, 2)
2 FORMAT (‘Enter number: ‘, $)
etc.
I have tried all these ideas and nothing seems to stop the program in order to get the value. What happens is the program simply continues on and the output looks like this:
1130271200 Number entered was= 0
I assume the numbers in front are my first write & read statements. Does anyone have an idea of what is going on? Why it is not stopping for input? Any help or guidance would be much appreciated. Thank you,
Sylvia
"Try everything at least once."