FTN95 7.1 on Windows 8.1 X64 runs into an internal error related to an FPU underflow exception when run on the code below, if before running the compiler the environment variable SALFENVAR is set equal to MASK_UNDERFLOW. The code is a severely stripped down version of DanRRight's code in a recent thread https://forums.silverfrost.com/Forum/Topic/2668 . The stripped down code will probably look silly, but the compiler is very sensitive to small changes to the code. In fact, rearranging the source code to interchange the order of the subroutines in the file (such that the subroutine with the comment 'UNDERFLOW' appears second) makes the internal error go away.
Subroutine sub1(en, zn, k_el)
Real *8 en
Call die(aip, zn, en, k_el)
aiz = ez0(i, k_el)
If (aiz<=0D0) aiz = 1.D-100 ! <<<<===== UNDERFLOW!
Return
End Subroutine sub1
Subroutine sub2(zs, zn, cnt, zsr)
Dimension p(99)
Real *8 cnt(99)
Real *8 zsr
iznp1 = zn + 1.1
Do i = 1, iznp1
cnt(i) = 0.
End Do
izs = zs
izmin = izs - 4
izmax = izs + 6
p(izmin) = 1.
Do i = izmin, izmax
izmax = i
Exit
End Do
cnt(izmin:izmax+1) = p(izmin:izmax+1)
zsr = 0.
Do i = izmin, izmax + 1
zsr = zsr + float(i-1)*cnt(i)
End Do
Return
End Subroutine sub2