Loading

s1.f90

  1. PROGRAM main
  2. implicit none
  3. INTEGER, parameter::N=3
  4. REAL P0,Y,K,Ft,Fd!,A(N),B(N),C(N),X(N)
  5. REAL::eps=1E-3
  6. REAL::P=0.8014*7501
  7. REAL::T=260
  8.  
  9. 100  CALL p1(Ft,Fd,T,P0,K,Y)
  10. CONTINUE
  11. IF(abs(Ft/Fd)<=eps) then
  12.   WRITE(*,*) K,Y,T
  13. ELSE
  14.   T=T-(Ft/Fd)
  15.  WRITE(*,*) T
  16.   GOTO 100
  17. END IF
  18. STOP
  19. END PROGRAM main
  20.  
  21. SUBROUTINE p1(Ft,Fd,T,P0,K,Y)
  22. implicit none
  23. REAL P0,Y,K,Ft,Fd,T
  24. INTEGER,parameter::N=3
  25. REAL::A(N)=(/15.5368,15.6637,15.7027/)
  26. REAL::B(N)=(/1347.01,1511.42,1807.53/)
  27. REAL::C(N)=(/-18.15,-17.16,-20.15/)
  28. REAL::X(N)=(/0.2,0.4,0.4/)
  29. INTEGER::I=0
  30. REAL::P=0.8014*7501
  31.     Ft=-1
  32.     Fd=0
  33. DO I=1,N
  34.   P0=EXP(A(I)-B(I)/(C(I)+T))
  35.   K=P0/P
  36.   Y=K*X(I)
  37.   Ft=Ft+Y
  38.   Fd=Fd+Y*B(I)/((C(I)+T)**2)
  39. END DO
  40. WRITE(*,*) Ft,Fd
  41. return
  42. END SUBROUTINE