The OVEFL subroutine masks and detects floating-point overflow exceptions.
lflag is an INTENT(IN) scalar of type LOGICAL. It is assigned the value true if an overflow exception has occurred, and false otherwise.
lflag must be set to true on the first invocation.
The initial invocation of the OVEFL subroutine masks the overflow interrupt on the floating-point unit.
Subsequent invocation returns an lflag value of true if the exception has occurred or false if the exception has not occurred.
Examplereal(kind(1.d0)) :: a=huge(a) logical :: lflag = .true. call ovefl(lflag) ! mask the overflow interrupt write(*,*) lflag ! writes F do a=a*2.d0 call ovefl(lflag)! test for overflow if(lflag) exit end do write(*,*) lflag ! writes T