First of all i'll try to explain what this loop is for:
(this is only an example, i want to make the loop able to read any configuration as long as it has no closed circuits)
C o D o
\ \
b\ c\
\ d \ e
B o-------------o------------o
/ E F
a /
/
A o
Imagine this is a road, with A,B,C,D,E,F being intersections and a,b,c,d,e segments of road.
my objective is that given any road i can calculate the distance from the end node of a segment to the end point.
In this example, for instance the distance from a to F would be the length of d+e.
BolID(1) is the ID of the node i consider last (this case F)
tc(w) is the length of the w segment
PipesIDmhoEnd(w) is the ID of the end of segment w
PipesIDmhoStart(w) is the ID of the Start of segment w
ta(w) is the total length from w to F
w=1
u=1
do while (w .le. m)
do while ((IDfim(w).ne. BolID(1)))
IDfim(w) = PipesIDmhoEnd(w)
u=1
do while(IDfim(w) .ne. (PipesIDmhoStart(u)))
if(IDfim(w) .ne. BolID(1))then
u=u+1
Idfim(w)=PipesIDmhoEnd(u)
tcaux(w)=tc(u)
else
Idfim(w)=BolID(1)
tcaux(w)=0
ta(w)=0
endif
enddo
ta(w)=ta(w)+tcaux(w)
enddo
w=w+1
enddo
The code compiles well but when i try to debug it it enters a loop and can't get out.
I know this is very confusing, but if anyone could help i would appreciate.
Sorry for my English.
Thanks in advance.
(this is only an example, i want to make the loop able to read any configuration as long as it has no closed circuits)
C o D o
\ \
b\ c\
\ d \ e
B o-------------o------------o
/ E F
a /
/
A o
Imagine this is a road, with A,B,C,D,E,F being intersections and a,b,c,d,e segments of road.
my objective is that given any road i can calculate the distance from the end node of a segment to the end point.
In this example, for instance the distance from a to F would be the length of d+e.
BolID(1) is the ID of the node i consider last (this case F)
tc(w) is the length of the w segment
PipesIDmhoEnd(w) is the ID of the end of segment w
PipesIDmhoStart(w) is the ID of the Start of segment w
ta(w) is the total length from w to F
w=1
u=1
do while (w .le. m)
do while ((IDfim(w).ne. BolID(1)))
IDfim(w) = PipesIDmhoEnd(w)
u=1
do while(IDfim(w) .ne. (PipesIDmhoStart(u)))
if(IDfim(w) .ne. BolID(1))then
u=u+1
Idfim(w)=PipesIDmhoEnd(u)
tcaux(w)=tc(u)
else
Idfim(w)=BolID(1)
tcaux(w)=0
ta(w)=0
endif
enddo
ta(w)=ta(w)+tcaux(w)
enddo
w=w+1
enddo
The code compiles well but when i try to debug it it enters a loop and can't get out.
I know this is very confusing, but if anyone could help i would appreciate.
Sorry for my English.
Thanks in advance.