fork download
  1. program TEST
  2. REAL a1,a2,a3,a4,a5,b1,b2,b3,b4,b5
  3. REAL le_ds, le_dia
  4. REAL PI
  5. REAL x,y,x1,y1,x2,y2,xx
  6. REAL mu, omega, s, radius,m,theta
  7. REAL p1x,p2x,p1y,p2y
  8. REAL k1,k2,k3,ym,yym,xn,xxn
  9.  
  10. c Basic parameters (see schemes)
  11.  
  12. a1= 25.
  13. a2= 25.
  14. a3= 35.
  15. a4= 15.
  16. a5= 14.
  17.  
  18. b1= 10.
  19. b2= 8.
  20. c b3 derived
  21. c b4 derived
  22. b5= 1.
  23.  
  24. le_dia= 50.
  25. le_ds= 15.
  26.  
  27. PI=4.*atan(1.)
  28. write (*,*) 'PI=',PI
  29.  
  30. c Read parameters from a profile.dat file. Comment if desired.
  31. open (unit=15,file='profile.dat')
  32. read (15,'(/)')
  33. read (15,*) a1
  34. read (15,*) a2
  35. read (15,*) a3
  36. read (15,*) a4
  37. read (15,*) a5
  38. read (15,*) b1
  39. read (15,*) b2
  40. read (15,*) b5
  41. read (15,*) le_dia
  42. read (15,*) le_ds
  43. close(15)
  44. write (*,*) a1,a2,a3,b5,le_ds
  45.  
  46. c Open result file wiht coordinates x,y
  47. open(unit=10,file='profile.txt')
  48. i=0
  49.  
  50.  
  51. c Ellipse
  52.  
  53. do theta=0.,90.,5.
  54. i=i+1
  55. x=a1-a1*cos(theta*PI/180.)
  56. y=b1*sin(theta*PI/180.)
  57. write(10,*) x,y
  58. end do
  59. write(*,*) i,x,'fi elipse'
  60.  
  61.  
  62. c Circle
  63.  
  64. mu=atan(a2/(b1-b2))
  65. omega=PI-2.*mu
  66. s=sqrt(a2*a2+(b1-b2)*(b1-b2))
  67. radius=0.5*s/sin(0.5*omega)
  68.  
  69. do theta=0.,omega,0.0088
  70. i=i+1
  71. x=a1+radius*sin(theta)
  72. y=b2-(radius-(b1-b2))+radius*cos(theta)
  73. write(10,*) x,y
  74. end do
  75. write (*,*) i,x,'fi circle'
  76.  
  77. c Line
  78.  
  79. b3=b2-a3*tan(omega)
  80. write(*,*) 'hola'
  81. write(*,*) 'b3,b2,omega=',b3,b2,omega
  82. m=(b3-b2)/a3
  83. do xx=0.,a3,a3/4.
  84. i=i+1
  85. x=a1+a2+xx
  86. y=m*xx+b2
  87. write(10,*) x,y
  88. end do
  89. write(*,*) i,x,m,'fi line'
  90.  
  91. c Reflex
  92.  
  93. k1=(b3-b5+m*a5)/(-a5*a5)
  94. k2=m+2.*k1*a5
  95. k3=b5
  96. do xx=-a5,a4-a5,a4/20.
  97. i=i+1
  98. x=a1+a2+a3+a5+xx
  99. y=k1*xx*xx+k2*xx+k3
  100. write(10,*) x,y
  101. end do
  102. write(*,*) i,x,'fi reflex'
  103.  
  104. c Close result file
  105. close (10)
  106.  
  107. c Open result file wiht coordinates x,y
  108. open(unit=10,file='profile.txt')
  109.  
  110. do j=1,i
  111. read (10,*) x,y
  112. write(*,*) j,x,y
  113. end do
  114. write (*,*) i
  115. write (*,*) 'fi arxiu'
  116. close(10)
  117.  
  118. c Generation of .dxf drawing profile
  119.  
  120. open(unit=10,file='profile.txt')
  121. open(unit=20,file='profile.dxf')
  122.  
  123. c Grid
  124.  
  125. do ym=0.,5.,1.
  126. yym=ym*4.
  127. call line(0.,-yym,100.,-yym,7)
  128. end do
  129.  
  130. do xn=0.,10.,1.
  131. xxn=xn*10.
  132. call line(xxn,-0.,xxn,-20.,7)
  133. end do
  134.  
  135. c Profile
  136.  
  137. do j=1,i-1
  138. read (10,*) x1,y1
  139. read (10,*) x2,y2
  140. call line(x1,-y1,x2,-y2,2)
  141. backspace (10)
  142. end do
  143.  
  144.  
  145. c Close the output .dxf file
  146. write(20,'(/,A,/,I1,/,A)') "ENDSEC",0,"EOF"
  147.  
  148. c Close units
  149.  
  150. close (10)
  151. close (20)
  152.  
  153. 100 FORMAT (F6.2,3x,F6.2,/)
  154. end
  155.  
  156.  
  157. SUBROUTINE line(p1x,p1y,p2x,p2y,linecolor)
  158.  
  159. c line P1-P2
  160. write(20,*)
  161. write(20,'(A,/,I1,/,A)') "LINE",8,"default"
  162. write(20,'(I1,/,A)') 6,"CONTINUOUS"
  163. write(20,'(I2,/,F6.1,/,I2,/,F6.1)') 10,p1x,20,-p1y
  164. write(20,'(I2,/,F6.1,/,I2,/,F6.1)') 11,p2x,21,-p2y
  165. write(20,'(I2,/,I2,/,I2,/,I2,/,I2)') 39,0,62,linecolor,0
  166. stop
  167. end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
'profile.dat'

25. a1 elipse
25. a2 circle
35. a3 line
15. a4 reflex
14. a5 vertex

10. b1 max thickness
8. b2 thickness at a1+a2

1. b5 thickness at vertex

50. le_dia leading edge diameter mm
15. le_ds double surface lenght
compilation info
prog.f95:2:1:

   REAL a1,a2,a3,a4,a5,b1,b2,b3,b4,b5
 1
Warning: Nonconforming tab character at (1) [-Wtabs]
prog.f95:10:0:

 c     Basic parameters (see schemes)
 1
Error: Unclassifiable statement at (1)
prog.f95:20:0:

 c     b3 derived
 1
Error: Unclassifiable statement at (1)
prog.f95:21:0:

 c     b4 derived
 1
Error: Unclassifiable statement at (1)
prog.f95:30:0:

 c     Read parameters from a profile.dat file. Comment if desired.
 1
Error: Unclassifiable statement at (1)
prog.f95:46:0:

 c     Open result file wiht coordinates x,y   
 1
Error: Unclassifiable statement at (1)
prog.f95:51:0:

 c     Ellipse    
 1
Error: Unclassifiable statement at (1)
prog.f95:62:0:

 c     Circle
 1
Error: Unclassifiable statement at (1)
prog.f95:77:0:

 c     Line
 1
Error: Unclassifiable statement at (1)
prog.f95:91:0:

 c     Reflex
 1
Error: Unclassifiable statement at (1)
prog.f95:104:0:

 c     Close result file
 1
Error: Unclassifiable statement at (1)
prog.f95:107:0:

 c     Open result file wiht coordinates x,y   
 1
Error: Unclassifiable statement at (1)
prog.f95:118:0:

 c     Generation of .dxf drawing profile
 1
Error: Unclassifiable statement at (1)
prog.f95:123:0:

 c     Grid
 1
Error: Unclassifiable statement at (1)
prog.f95:135:0:

 c       Profile
 1
Error: Unclassifiable statement at (1)
prog.f95:145:0:

 c     Close the output .dxf file
 1
Error: Unclassifiable statement at (1)
prog.f95:148:0:

 c     Close units
 1
Error: Unclassifiable statement at (1)
prog.f95:159:0:

 c     line P1-P2
 1
Error: Unclassifiable statement at (1)
prog.f95:166:1:

  stop
 1
Warning: Nonconforming tab character at (1) [-Wtabs]
prog.f95:153:3:

 100   FORMAT (F6.2,3x,F6.2,/)
   1
Warning: Label 100 at (1) defined but not used
prog.f95:53:9:

       do theta=0.,90.,5.
         1
Error: Deleted feature: Loop variable at (1) must be integer
prog.f95:69:9:

       do theta=0.,omega,0.0088
         1
Error: Deleted feature: Loop variable at (1) must be integer
prog.f95:83:9:

       do xx=0.,a3,a3/4.
         1
Error: Deleted feature: Loop variable at (1) must be integer
prog.f95:96:9:

       do xx=-a5,a4-a5,a4/20.
         1
Error: Deleted feature: Loop variable at (1) must be integer
prog.f95:125:9:

       do ym=0.,5.,1.
         1
Error: Deleted feature: Loop variable at (1) must be integer
prog.f95:130:9:

       do xn=0.,10.,1.
         1
Error: Deleted feature: Loop variable at (1) must be integer
stdout
Standard output is empty