- #1
Antonija
- 18
- 0
Homework Statement
I'm trying to find out is it possible to make a real do loop in fortran. As I read online, it's possible, and there is written how to do it but when I copy/paste it into my fortran editor, it' doesn't work.
At the moment I'm writing the code for minimize a function of a single variable, and one of the things I need is the real step do loop.
Homework Equations
The Attempt at a Solution
This is how my part of code looks like:
real:: a,b
real::delta=0.0001
do i=a,b, delta
variablesvalues(1)=x+(i-1)*delta
call {some function}
answer=evaluate(...)
end do
and this is the code for which is written that it's example for real loop:
program xytab
implicit none
!constructs a table of z=x/y for values of x from 1 to 2 and
!y from 1 to 4 in steps of .5
real :: x, y, z
do x = 1,2
do y = 1,4,0.5
z = x/y
print *, x,y,z
end do
end do
end program xytabin both examples I get the same error: Deleted feature: Step expression in DO loop at (1) must be integer.
I'm using Fortran 90.
Also, is it possible to have only step-size real, and other integer type?