| 
 | 
 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode subroutine read_obstacles(obst)
implicit none
include "head.inc"
      EXTERNAL SUM
      !EXTERNAL RANDOM_NUMBER
!integer k,l,m,n,P,Q,obst
      integer  k,l
      integer  m,n
      integer  P,Q
      integer obst
      complex h(k,l),z(obst),h1(k,l),z1(obst)
      
      
      real*8 sum_1,sum_2,sum_3,random_number,F(P,Q),F1(P,Q)
do 11 k= 1, 300
  do 10 l = 1, 300
              F(P,Q)=0.675*0.675*(exp(-2.3*((k/50)*(k/50)+(l/10)* 
     &         (l/10))**0.5))*((-1)**(2*k*P/300+2*l*Q/300))
              if (k==(1,300).and.l==(1,300))then
                  F1(P,Q)=sum_1(F(P,Q))
      end if
   10 continue
   11 continue
      
      do 20 P=1,300
          do 21 Q=1, 300
              h(k,l)=1/90000*F1(P,Q)*(-1)**((k*P+l*Q)/150)
               if (P==(1,300).and.Q==(1,300))then
               h1(k,l)=sum_2(h(k,l))
      end if
   21 continue
   20 continue
      
      do 22 k= 1, 300
  do 23 l = 1, 300
              !call RANDOM_NUMBER
              z(obst)=h1(k,l)*random_number
              if (m==(1,300).and.n==(1,300))then
              z1(obst)=sum_3(z(obst))
      end if 
   23 continue
   22 continue
      
end 
错误 1  error #6219: This variable, used in a specification expression, must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [K] C:\Users\Administrator\Desktop\coding\chap2\chap2\main.for 158  
错误 2  error #6219: This variable, used in a specification expression, must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [L] C:\Users\Administrator\Desktop\coding\chap2\chap2\main.for 158  
错误 3  error #6219: This variable, used in a specification expression, must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [P] C:\Users\Administrator\Desktop\coding\chap2\chap2\main.for 160  
错误 4  error #6219: This variable, used in a specification expression, must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [Q] C:\Users\Administrator\Desktop\coding\chap2\chap2\main.for 160  
 
这里好像是k,l,P,Q四个变量在声明时出错了,但是我没明白什么意思怎么改。 
求助! 
 
 |   
 
 
 
 |