Again, another little problem and I hope I'm not embarassing myself here...

Here is the simple code:

real*8 :: a
do i = 1, 2000
if (i>1) then
a= 3 + ((i-1)*((4-3)/1999))
end if
write(*,*) a
end do

results show a long list of 3.00000000000 values which are not (as expected) getting any bigger. I'd expect them to grow by 1/1999 = 0.00050025 each iteration but my WRITE just shows a long list of 3s.

Note (or don't overlook) the fact that the integer expression ((4-3)/1999) evaluates to zero, so subsequent multiplication by (i-1) will also yield zero.

In Fortran, the type of the variable being assigned a value can be different from the type of the expression that yields the value. There are rules for how to evaluate mixed type expressions and how to assign a value of one type to a variable of another type. Informing yourself about these rules, or at least knowing where to look them up, will be useful.