如何在第二个do循环中的第一个do循环中使用`results(k(i))`? [英] How do I use `results(k(i))` from the first do loop in the second do loop?

查看:91
本文介绍了如何在第二个do循环中的第一个do循环中使用`results(k(i))`?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在第二个do循环的第一个do循环中使用results(k(i))?现在,我在第二个do循环中得到了错误的结果.

How do I use results(k(i)) from the first do loop in the second do loop? Now I'm getting erroneous results in the second do loop.

  WRITE(*,*) "Enter PRESSURE,TEMPERATURE"
  READ *,p,t
  WRITE(*,*) "Approximate K values for each component using Wilson's 
  correlation are;"
  do i=1,6
  K = (pc(I)/p)*EXP(5.37*(1+w(I))*(1-(tc(I)/t)))
  write(*,99001)K(i)
  end do

  !.......vapor fraction..............
  do i=1,6
  FV=(Z(I)*(K(i)-1))/((VOLD*(K(i)-1))+1)
  FPV=-(Z(I)*((K(i)-1)**2)/(1+(VOLD*(K(i)-1)))**2)
  write(*,99001)fv,fpv
  end do
  99001 FORMAT (9F15.6)
  END program

推荐答案

K = (pc(I)/p)*EXP(5.37*(1+w(I))*(1-(tc(I)/t)))

如果K是一个数组,我想你的意思是:

If K is an array, I suppose you meant:

K(I) = (pc(I)/p)*EXP(5.37*(1+w(I))*(1-(tc(I)/t)))

如果K不是数组,我想应该是.

If K is not an array, I suppose it should be.

这篇关于如何在第二个do循环中的第一个do循环中使用`results(k(i))`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆