Solve Coding Problem with Efficient Wide Boiling Program - Get Help Now!

  • Thread starter Thread starter chammakh24
  • Start date Start date
  • Tags Tags
    Coding
AI Thread Summary
The discussion centers around issues with a Fortran program designed for calculations related to boiling. The primary problem identified is that the variable 'j' does not increment beyond 1, preventing the program from calculating new temperatures as intended. A suggestion is made to move the initialization of 'j' to before the loop labeled '100 CONTINUE' to allow for proper incrementing. This adjustment aims to ensure that the program can progress through its iterations correctly and perform the necessary calculations. The conversation highlights the need for proper variable management within loops to achieve the desired functionality in the code.
chammakh24
Messages
2
Reaction score
0
please i need help in this code

program wide_boiling
implicit none
integer :: i, j, m
real :: Trosee, Tbulle, P, RR(100), vf(100),
real :: aT1(3), aT6(3), ap1(3), z(3), ap2(3)
real ::, x(3), T, k(3,10)
m=0
T=518.67
m=m+1
do i = 1,3
k(i,m) = (aT1(i)/(T(m)**2))+(aP1(i)*log(P))+aT6(i)+(aP2(i)/P**2)
k(i,m) = exp(k(i,m))
write(6,*) ¢k(i,m) = ¢,¢ ¢,k(i,m),¢ ¢,¢ i = ¢,¢ ¢,i,' ¢,¢m = ¢,¢ ¢,m
end do
100 continue
j=0
vf =0.25
j=j+1
RR(j) = 0
do i = 1,3
RR(j) = RR(j)+(k(i,j)-1)*z(i)/(1+(k(i,j)-1)*vf(j))
end do
write(6,*) ?RR(j)=?,RR(j),? ?,?j=?,j
if(abs(RR(j)).LE.5E-3) then
do i = 1,3
x(i) = z(i)/(1+(k(i,j)-1)*vf(j))
end do
write(6,*) ?x(i)= ?,x(i),? ?,?i = ?,i,? ?,? j = ?,j
else
dRR(j) = 0
do i = 1,3
dRR(j)=dRR(j)+(z(i)*((k(i,m)-1)**2))/((z(i)*((k(i,m)-1)**2))/(1+(k(i,m)*vf(j)))**2)
end do
write(6,*) ?dRR(j)=?,dRR(j),? ?,?j=?,j
vf(j)=vf(j)-(RR(j)/dRR(j))
write(6,*) ?vf(j)=?,vf(j),? ?,?j=?,j
go to 100
end if
end program wide_boiling
 
Technology news on Phys.org


chammakh24 said:
please i need help in this code

program wide_boiling
implicit none
integer :: i, j, m
real :: Trosee, Tbulle, P, RR(100), vf(100),
real :: aT1(3), aT6(3), ap1(3), z(3), ap2(3)
real ::, x(3), T, k(3,10)
m=0
T=518.67
m=m+1
do i = 1,3
k(i,m) = (aT1(i)/(T(m)**2))+(aP1(i)*log(P))+aT6(i)+(aP2(i)/P**2)
k(i,m) = exp(k(i,m))
write(6,*) ¢k(i,m) = ¢,¢ ¢,k(i,m),¢ ¢,¢ i = ¢,¢ ¢,i,' ¢,¢m = ¢,¢ ¢,m
end do
100 continue
j=0
vf =0.25
j=j+1
RR(j) = 0
do i = 1,3
RR(j) = RR(j)+(k(i,j)-1)*z(i)/(1+(k(i,j)-1)*vf(j))
end do
write(6,*) ?RR(j)=?,RR(j),? ?,?j=?,j
if(abs(RR(j)).LE.5E-3) then
do i = 1,3
x(i) = z(i)/(1+(k(i,j)-1)*vf(j))
end do
write(6,*) ?x(i)= ?,x(i),? ?,?i = ?,i,? ?,? j = ?,j
else
dRR(j) = 0
do i = 1,3
dRR(j)=dRR(j)+(z(i)*((k(i,m)-1)**2))/((z(i)*((k(i,m)-1)**2))/(1+(k(i,m)*vf(j)))**2)
end do
write(6,*) ?dRR(j)=?,dRR(j),? ?,?j=?,j
vf(j)=vf(j)-(RR(j)/dRR(j))
write(6,*) ?vf(j)=?,vf(j),? ?,?j=?,j
go to 100
end if
end program wide_boiling

That's a pretty vague question. What's wrong?
 


the prb is that when the programe do the go to 100 he dosen't incr again i don't know way
he should calcul the new tempretaure but he dosent
 


The way your program is structured, j never exceeds 1. I suggest placing the statement j = 0 before 100 CONTINUE.
 
Moderator's note: this discussion has been moved to its own thread.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top