CompaqVisualFortranfortranfortranFORmularTRANslationCfortranC1FortranComplexsin2Fortran13Fortranfortrancfortran904fortranfortran77f77fortran90f77CompaqVisualFortran6.5f77f90cvf6.5fortranf77(fixedform).ff90(freeform).f901.programmaincabcreal*a,b,c,aver,averagread(*,*)a,b,caver1=averag(a,b,c)write(*,*)averendfunctionaverag(x,y,z)average=(x+y+z)/3.0end2.programmainimplictnone!real::a=1,b=2,c=3!write(*,*)a,b,&!&cendf90f77integer1::xinteger*1x-27x27-1integer2::yinteger*2y-215y215-1integer::zintegerz-232z232-1real::xrealx1.18e-383.40e+38067real(8)::xdoubleprecisionx2.22e-3081.79e+308015complex::xcomplexxcharacter(5)::z’abcde’chracter*5zlogical::xlogicalx.true..false..1Integer(1)integer2Integer1::xx=128write*,*x-128integerrealdoubleprecision2Ininfortran90implicitnoneprogrammainimplicitnonereal(8)::vv=1.1d0write(*,*)vend3integer::Ireal::xI=1.9X=1.1111111111I=1X=1.111111x=1.1!x=1.10000002384186x=1.1d0!1.100000000000001integer11000real1.0(1.)1.e3real(8):1.d01.d3complex:(1.,1.)2f77f90realrealpireal,parameter::pi=3.14parameter(pi=3.14)doubleprecisiondoubleprecisionpireal(8),parameter::pi=3.1415926535d0paramener(pi=3.1415926535d0)1.*/***1/2=01./2.=0.5*2.1+(17/5)=2.1+3=2.1+3.0=5.12.Fortran77Fortran90.gt..ge.=.lt..le.=.eq.==.ne./=.and..or..not..eqv..neqv.1.f77f90integerx(3)integer,dimension(3)::xrealy(3,4)real,dimension(3,4)::yreal(8)z(-2:2)real(8),dimension(-2:2)::zx(1)=1x=(/1,3,5/)x(2)=3x(3)=5yreshape((/1,2,3,4/),(/2,2/))y=??????4231y(112)y1,:/1,3/2.integer,dimension(3)::m,n,lm=2!m=(/2,2,2/)n=5!n=(/5,5,5/)l=m+n!l=(/7,7,7/)l=m*n!l=(/10,10,10/)l=sin(m)l=sqrt(n)3.f90f7750005000allocatablearraysreal,dimension(:),allocatable::vinteger::sizeread(*,*)sizeallocate(v(size))……deallocate(v)automaticarrayssubroutinesub(size)implicitnoneinteger::sizereal,dimension(size)::v……endmatmulmatrix_a,matrix_bdot_product(vector_a,vector_b)transposematrix1.ifif(a0)then…elseif(a0)then…else…endif2Dof77f90do100I=1,10doI110……100contiuneenddodo200while(I.lt.100)dowhile(I100)……200continueenddo3Casef90integerdayread(*,*)dayselectcase(day)case(1)write(*,*)'mon’case(2)write(*,*)'tues'case(3)write(*,*)'wend'……casedefaultwrite(*,*)'wrong!'endselectfortranI/O1.I/Oread(*,*)awrite(*,*)a56read(5,*)awrite(6,*)a2.I/Oopen5file’in’,status=’old’open(6,file’out’,stausunknown)56inoutstatusoldnewunknowoldnewread(5*)awrite(6*aclose(5)close(6)3.integer::a=1,b=2,c=3real::x=1.1,y=2.2,z=3.3write(*,100)a,b,c,x,y,z100format(/i2,i2,i2,f4.1,f4.1,f4.1)100format(/3i2,3f4.1)/write(*,’(/3(i2,f4.1))’)a,b,c,x,y,zx5xeprogramtest1implictnoneinteger::x,test3x=test3(5)calltest2(x)write(*,*)xendsubroutintest2(y)implictnoneinteger::ywrite(*,*)‘y=’,yy=y+1endrealfunctiontest3nimplictnoneinteger::ntest3=1doI=1,ntest3=test3*Ienddoend2programmainimplicitnoneinteger,dimension(50)IAinteger::lbound=10callinput(IA(lbound))endsubroutine(X)implictnoneinteger,dimension(20)::XX=1Write(*,*)xEnd1