Advertisement
zrhans

plotter.f95

Oct 16th, 2014
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program plotter
  2. !use gnuplot_fortran
  3. implicit none
  4.  
  5. integer, parameter :: n = 100
  6. real, dimension(0:n) :: x, y
  7. real :: x_start = 0., x_end = 20, dx
  8. integer :: i
  9.  
  10. ! Construindo o vetor x
  11. dx = (x_end - x_start) / n
  12. x(0:n) = (/(i*dx, i = 0,n)/) ! one of f95 way of initializing array values
  13.  
  14. ! Construindo o vetor y
  15.  
  16. y = sin(x) / (x + 1)
  17.    
  18. ! Gera os dados para o grafico
  19.  
  20. !call plot2d(x,y)
  21.    
  22. end program plotter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement