名称中的字符无效(1)

时间:2017-05-26 23:40:30

标签: fortran

我知道类似的问题已被多次询问过,从给定的答案来看,我还无法解决我的问题。

module const
   real(kind(0d0)), parameter      :: A=64000000d0
   real(kind(0d0)), parameter      :: m=172d0
   real(kind(0d0)), parameter      :: Q=2d0 
   real           , parameter      :: wgt=0d0
   real(kind(0d0)), parameter      :: pi=3.14159d0
   real           , parameter      :: a_s = 0.12d0
   real(kind(0d0)), dimension(0:3) :: p1, p2
   real(kind(0d0)), dimension(1:3) :: x
   real(kind(0d0)) :: CT14pdf
   real(kind(0d0)) :: s, sqrts,m_res
end module const

module my_fxn
   use const
   private
   public fxn_1
   contains

   subroutine commonpart(t, u, f, tau_0)
      implicit none
      real(kind(0d0)):: t, u, f, tau_0

      p1(0) = sqrt(s)/2
      p1(1) = 0d0
      p1(2) = sqrt(s/4-m**2)
      P1(3) = sqrt(s/4-m**2)
      P2(0) = sqrt(s)/2
      P2(1) = 0d0
      P2(2) = sqrt(s)/2
      P2(3) = sqrt(s)/2

      t = (m**2-2*p2(0)*p2(2)+2*p1(0)*p1(2)*(2*x(1)-1d0))
      u = (m**2-2*p2(0)*p2(3)-2*p1(0)*p1(3)*(2*x(1)-1d0))
      f = (m**2-t)*(m**2-u) 
      tau_0 = m**2/A
   end subroutine commonpart

   function fxn_1(x, wgt) result(fxn_qq)

      real(kind(0d0)):: fxn_qq
      real(kind(0d0)):: t, u, f, tau_0
      integer        :: i

      s=x(2)*x(3)*A
      sqrts=sqrt(s)
      m_res=2*m
      if (sqrts.lt.m_res)then
         fxn_qq=0d0
         return
         else 
      endif
      call commonpart(t, u, f, tau_0)

      fxn_qq=0d0
      do i = 1, 5
         fxn_qq = fxn_qq + (1d0-tau_0)*(1d0-tau_0/((1d0-tau_0)*x(2)+tau_0))*CT14Pdf(i, x(2), Q) *CT14Pdf(-i, x(3), Q)
      end do
   end function fxn_1

end module my_fxn

当我编译它时,我得到Error: Invalid character in name at (1) x是一个三维数组,如果它在subroutine commonpart中效果很好,为什么function fxn_1出错?

0 个答案:

没有答案