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

  • Thread starter Thread starter chammakh24
  • Start date Start date
  • Tags Tags
    Coding
Click For Summary

Discussion Overview

The discussion revolves around a coding problem related to a Fortran program named "wide_boiling." Participants are seeking assistance with the program's logic and flow, particularly regarding the increment of the variable 'j' and the calculation of temperature during iterations. The scope includes debugging and technical explanation of the code.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses confusion about the program not incrementing the variable 'j' during the loop, which affects the calculation of temperature.
  • Another participant suggests that the placement of the statement 'j = 0' should be before the '100 CONTINUE' line to ensure 'j' increments properly.
  • There is a request for clarification on what specifically is wrong with the code, indicating a need for more detailed information about the issue.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the specific issue with the code, and there are differing opinions on how to resolve the problem.

Contextual Notes

The discussion highlights potential logical errors in the program's structure, particularly regarding variable initialization and flow control, but does not resolve these issues definitively.

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 doesn'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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
3K
Replies
31
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
6
Views
4K
Replies
47
Views
5K