Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Degree_row_module
- contains
- !
- subroutine output(string,x,n,y,d)
- integer :: string,i
- integer :: n(string)
- real(8) :: x(string),y(string),d(string)
- character(len = 72) :: cap = '+----+----------+------+----------+---------------+'
- write (*,'(a)') cap
- write (*,'(a)') '| i | x{i} | n{i} | y{i} | d{i} |'
- do i = 1,string
- write (*,'(a)') cap
- write (*,'(a, i3, a, f10.6, a, i6, a, f10.6, a, es15.6, a)') '|', i, ' |', x(i), '|', n(i), '|', y(i),'|',d(i),'|'
- end do
- write (*,'(a)') cap
- end subroutine
- !
- subroutine ryad(str, x, n, y, d, E)
- integer :: str
- real(8) :: x(str), y(str), d(str)
- integer :: n(str)
- integer :: i
- real(8) :: E, ui
- do i =1, str
- n(i) = 0
- y(i) = log(2.0d0)
- ui = -1.0d0
- do while ( (abs(ui) >= (E * abs( y(i) ) ) ) .and. (n(i)<2500) )
- n(i) = n(i) + 1
- ui = -ui*x(i)*(0.5d0)
- y(i) = y(i) + ui/n(i)
- end do
- d(i) = abs( y(i)-log(x(i) + 2.0) )
- end do
- end subroutine
- end module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement