GerritGroot
Technical User
Hi,
I used the following procedure to get some screen feedback.
In gfortran 4.6 this gave me the error: "bad file descriptor", but only after having it called several times.
When updated to 4.7, just in case, it just broke down without any message, also after a a few calls to this routine.
Next, I changed it to:
And the code runs fine.
Is this an error in gfortran? Or am I doing something wrong?
Thanks,
Gerrit
P.S. How do you post source in colors?
I used the following procedure to get some screen feedback.
Code:
SUBROUTINE StartEndInfo(Line,Sort)
IMPLICIT NONE
CHARACTER(LEN=*), INTENT(IN) :: Line
CHARACTER(LEN=*), INTENT(IN) :: Sort
CHARACTER(LEN=60) :: StartLine
CHARACTER(LEN=20) :: EndLine
IF(TRIM(Sort)=='Start')THEN
StartLine=ADJUSTL(TRIM(Line))
WRITE(*,ADVANCE='NO',FMT='(A60)')StartLine
ELSE IF(TRIM(Sort)=='End')THEN
EndLine=ADJUSTR(TRIM(Line))
WRITE(*,ADVANCE='NO',FMT='(A20)')EndLine
ELSE
WRITE(*,'(A)')TRIM(Line)
END IF
END SUBROUTINE StartEndInfo
When updated to 4.7, just in case, it just broke down without any message, also after a a few calls to this routine.
Next, I changed it to:
Code:
SUBROUTINE StartEndInfo(Line,Sort)
IMPLICIT NONE
CHARACTER(LEN=*), INTENT(IN) :: Line
CHARACTER(LEN=*), INTENT(IN) :: Sort
CHARACTER(LEN=60) :: StartLine
CHARACTER(LEN=20) :: EndLine
IF(TRIM(Sort)=='Start')THEN
StartLine=ADJUSTL(TRIM(Line))
! WRITE(*,ADVANCE='NO',FMT='(A60)')StartLine
WRITE(*,'(A)')StartLine
ELSE IF(TRIM(Sort)=='End')THEN
! EndLine=ADJUSTR(TRIM(Line))
! WRITE(*,ADVANCE='NO',FMT='(A20)')EndLine
CONTINUE
ELSE
WRITE(*,'(A)')TRIM(Line)
END IF
END SUBROUTINE StartEndInfo
Is this an error in gfortran? Or am I doing something wrong?
Thanks,
Gerrit
P.S. How do you post source in colors?