Changes between Version 5 and Version 6 of fortran


Ignore:
Timestamp:
Oct 18, 2016, 9:01:47 AM (8 years ago)
Author:
ivasileska
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • fortran

    v5 v6  
    22= FORTRAN 95 examples =
    33
    4 == Console1.f90 ==
     4== Integral function calculation using trapeze, rectangle and Simson method ==
    55{{{
    66#!fortran
     
    1515S3=0
    1616do i=0,n
    17        S1=S1+(f(i*dx+a)+f((i+1)*dx+a))/2*dx
    18        S2=S2+ f(i*dx+a)*dx
     17       S1=S1+(f(i*dx+a)+f((i+1)*dx+a))/2*dx !integral which is calculate by trapeze method
     18       S2=S2+ f(i*dx+a)*dx !integral which is calculate with rectangle method
    1919if(mod(i,2)==0) then
    20        S3=S3+dx/3*2*f(i*dx+a)
     20       S3=S3+dx/3*2*f(i*dx+a) !integral which is calculate by Simson method
    2121   else
    2222       S3=S3+dx/3*4*f(i*dx+a)
     
    3030
    3131function f(x)
    32 f=1/sqrt(1-x**2)
     32f=1/sqrt(1-x**2) !integral function
    3333end function f
    3434end
    3535}}}
    3636
    37 == Console2.f90 ==
     37== ==
    3838{{{
    3939#!fortran
     
    9090do i=1,n
    9191    write(1,*) i*dx + a, sin(i*dx+a)*sin(2*i*dx+a)*sin(3*i*dx+a)
    92 end do
     92end domethod of
    9393end
    9494}}}
     
    129129
    130130 end function
    131 print *, s
     131print *, smethod of
    132132end program
    133133}}}
     
    29452945   17 AUX(4,I)=Y(I)                                                     
    29462946      ITEST=1                                                           
    2947       ISTEP=ISTEP+ISTEP-2                                               
     2947      ISTEP=ISTEP+ISTEP-2                          Console2.f90                     
    29482948   18 IHLF=IHLF+1
    29492949      X=X-H