回 帖 发 新 帖 刷新版面

主题:写的代码,错了挺多,大神看看错哪了。给改改,谢了

program zuhe
      parameter(aa1=0.005,aa2=100,bb1=0.02,bb2=400,cc1=0.08,cc2=700, &
      dd1=0.06,dd2=200,d1=100,d2=300,s=50.26,L0=461,fd=7000)
      real i
     
      st=0.00001
      et=30
      k1=aa2/aa1
      k2=(cc2-bb2)/(cc1-bb1)
      k3=(dd2-cc1)/(dd1-cc1)
      k4=(aa2-dd2)/(aa1-dd1)
      pp1=log((2*SQRT(d2*d2*(SIN(2*3.14/8))**2+(d2*COS(2*3.14/8)-d1)**2))/LO)
      pp2=bb2+k2*(pp1-bb1)
      do 100  i=0.0,30.0,0.025
      k=floor(MOD(i,1.0),0.25)+1
      fdd=(floor(i,1))*fd+fd
      if(k.eq.1)then
      f=MOD(i,1/4)*fdd*4/1
      elseif(k.eq.2)then
      f=fdd-MOD(i,1/4)*fdd*4/1
      elseif(k.eq.3)then
      f=-MOD(i,1/4)*fdd*4/1
      else
      f=-(fdd-MOD(i,1/4)*fdd*4/1)
      endif
      If ((step / et).lt.0 )Then
      et = -et
      End If
      if((floor(i,(1/4))+1).lt.9)then
       k5=floor(i,(1/4))+1
       else
       k5=floor(mod(i,1),(1/4))+5
      endif
      if(mod(i,(1/4)).eq.0)then
      k5=k5-1
      endif
      if(k5.eq.0)then
          k5=k5+1
      endif
      IF(MOD(i,(1/4)).eq.0)then
          k6=k-1
          else
          k6=k
      endif
      if(k6.eq.0)then
          k6=k6+1
      endif
     
     
      if((k5.eq.1).or.(k5.eq.4).or.(k5.eq.5).or.(k5.eq.8))then
          step=0.5
          else
          step=-0.5
      endif
   
      do 200 x=st,et,step
         
       CALL silk1(x,d1,d2,s1,a1,b1,c1,d1,e1,f1,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk2(x,d1,d2,s2,a2,b2,c2,d2,e2,f2,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk3(x,d1,d2,s3,a3,b3,c3,d3,e3,f3,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk4(x,d1,d2,s4,a4,b4,c4,d4,e4,f4,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk5(x,d1,d2,s5,a5,b5,c5,d5,e5,f5,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk6(x,d1,d2,s6,a6,b6,c6,d6,e6,f6,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk7(x,d1,d2,s7,a7,b7,c7,d7,e7,f7,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk8(x,d1,d2,s8,a8,b8,c8,d8,e8,f8,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk9(x,d1,d2,s9,a9,b9,c9,d9,e9,f9,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk10(x,d1,d2,s10,a10,b10,c10,d10,e10,f10,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk11(x,d1,d2,s11,a11,b11,c11,d11,e11,f11,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk12(x,d1,d2,s12,a12,b12,c12,d12,e12,f12,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk13(x,d1,d2,s13,a13,b13,c13,d13,e13,f13,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk14(x,d1,d2,s14,a14,b14,c14,d14,e14,f14,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk15(x,d1,d2,s15,a15,b15,c15,d15,e15,f15,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk16(x,d1,d2,s16,a16,b16,c16,d16,e16,f16,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       fx=fx1+fx2+fx3+fx4+fx5+fx6+fx7+fx8+fx9+fx10+fx11+fx12+fx13+fx14+fx15+fx16
        if((k6.eq.1).and.(k6.eq.4))then
       if(fx.gt.f)then
           zx=aa
           zd=x
           do 10 until (abs((fx-f).lt.0.1))
            If ((abs(zd - zx) .lt. 0.00001)) Exit
           if(fx.gt.f)then
               zd=x
               else
               zx=x
           endif
           x=(zd+zx)/2
           CALL silk1(x,d1,d2,s1,a1,b1,c1,d1,e1,f1,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk2(x,d1,d2,s2,a2,b2,c2,d2,e2,f2,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk3(x,d1,d2,s3,a3,b3,c3,d3,e3,f3,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk4(x,d1,d2,s4,a4,b4,c4,d4,e4,f4,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk5(x,d1,d2,s5,a5,b5,c5,d5,e5,f5,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk6(x,d1,d2,s6,a6,b6,c6,d6,e6,f6,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk7(x,d1,d2,s7,a7,b7,c7,d7,e7,f7,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk8(x,d1,d2,s8,a8,b8,c8,d8,e8,f8,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk9(x,d1,d2,s9,a9,b9,c9,d9,e9,f9,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk10(x,d1,d2,s10,a10,b10,c10,d10,e10,f10,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk11(x,d1,d2,s11,a11,b11,c11,d11,e11,f11,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk12(x,d1,d2,s12,a12,b12,c12,d12,e12,f12,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk13(x,d1,d2,s13,a13,b13,c13,d13,e13,f13,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk14(x,d1,d2,s14,a14,b14,c14,d14,e14,f14,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk15(x,d1,d2,s15,a15,b15,c15,d15,e15,f15,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk16(x,d1,d2,s16,a16,b16,c16,d16,e16,f16,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       fx=fx1+fx2+fx3+fx4+fx5+fx6+fx7+fx8+fx9+fx10+fx11+fx12+fx13+fx14+fx15+fx16
 10     continue
        st=x
        exit
        else
        aa=x
           endif
        else
        if(fx.lt.f)then
           zd=aa
           zx=x
           do until (abs((fx-f).lt.0.1))
            If ((abs(zd- zx) .lt. 0.00001)) Exit
           if(fx.lt.f)then
               zx=x
               else
               zd=x
           endif
           x=(zd+zx)/2
           CALL silk1(x,d1,d2,s1,a1,b1,c1,d1,e1,f1,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk2(x,d1,d2,s2,a2,b2,c2,d2,e2,f2,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk3(x,d1,d2,s3,a3,b3,c3,d3,e3,f3,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk4(x,d1,d2,s4,a4,b4,c4,d4,e4,f4,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk5(x,d1,d2,s5,a5,b5,c5,d5,e5,f5,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk6(x,d1,d2,s6,a6,b6,c6,d6,e6,f6,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk7(x,d1,d2,s7,a7,b7,c7,d7,e7,f7,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk8(x,d1,d2,s8,a8,b8,c8,d8,e8,f8,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk9(x,d1,d2,s9,a9,b9,c9,d9,e9,f9,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk10(x,d1,d2,s10,a10,b10,c10,d10,e10,f10,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk11(x,d1,d2,s11,a11,b11,c11,d11,e11,f11,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk12(x,d1,d2,s12,a12,b12,c12,d12,e12,f12,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk13(x,d1,d2,s13,a13,b13,c13,d13,e13,f13,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)  
       CALL silk14(x,d1,d2,s14,a14,b14,c14,d14,e14,f14,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk15(x,d1,d2,s15,a15,b15,c15,d15,e15,f15,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       CALL silk16(x,d1,d2,s16,a16,b16,c16,d16,e16,f16,pp1,pp2,aa1,aa2,bb1,bb2,cc1,cc2,dd1,dd2,k5,k1,k2,k3,k4,f1,fx1,L0)
       fx=fx1+fx2+fx3+fx4+fx5+fx6+fx7+fx8+fx9+fx10+fx11+fx12+fx13+fx14+fx15+fx16
 20     continue
        st=x
        exit
        else
        aa=x
        endif
       endif
200     continue
100     continue      
         end 
          

 

Compiling .\zuhe2.f90
.\zuhe2.f90:4.11:

      real
           1
Error: Invalid character in name at (1)
.\zuhe2.f90:79.11:

           do 10 until (abs((fx-f).lt.0.1))
           1
Error: Unclassifiable statement at (1)
.\zuhe2.f90:86.22:

           x=(zd+zx)/2
                      1
.\zuhe2.f90:56.25:

      do 200 x=st,et,step
                         2
Error: Variable 'x' at (1) cannot be redefined inside loop beginning at (2)
.\zuhe2.f90:114.11:

           do 20 until (abs((fx-f).lt.0.1))
           1
Error: Unclassifiable statement at (1)
.\zuhe2.f90:121.22:

           x=(zd+zx)/2
                      1
.\zuhe2.f90:56.25:

      do 200 x=st,et,step
                         2
Error: Variable 'x' at (1) cannot be redefined inside loop beginning at (2)
.\zuhe2.f90:15.20:

      k=floor(MOD(i,1.0),(1.0/4.0))+1
                    1
Error: 'a' and 'p' arguments of 'mod' intrinsic at (1) must have the same type
.\zuhe2.f90:16.17:

      fdd=(floor(i,1))*fd+fd
                 1
Error: 'a' argument of 'floor' intrinsic at (1) must be REAL
.\zuhe2.f90:29.16:

      if((floor(i,(1/4))+1).lt.9)then
                1
Error: 'a' argument of 'floor' intrinsic at (1) must be REAL
.\zuhe2.f90:30.16:

       k5=floor(i,(1/4))+1
                1
Error: 'a' argument of 'floor' intrinsic at (1) must be REAL
.\zuhe2.f90:32.16:

       k5=floor(mod(i,1),(1/4))+5
                1
Error: 'a' argument of 'floor' intrinsic at (1) must be REAL
.\zuhe2.f90:56.12:

      do 200 x=st,et,step
            1
Error: Deleted feature: Loop variable at (1) must be integer
.\zuhe2.f90:14.21:

      do 100  i=0,30,0.025
                     1
Error: Deleted feature: Step expression in DO loop at (1) must be integer
Error(E42): Last command making (build\zuhe2.o) returned a bad status
Error(E02): Make execution terminated

* Failed *

 

回复列表 (共1个回复)

沙发

老的 do 标号 i=1,100


必须是整数 

我来回复

您尚未登录,请登录后再回复。点此登录或注册