爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3459|回复: 0

[求助] fortran 重载 出错。。编译出错。。。。

[复制链接]

新浪微博达人勋

发表于 2013-6-19 12:36:59 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
三个文件,
add.f90
module MA
  implicit none
   contains
    subroutine show_int(n)
      implicit none
      integer , intent(in) ::n
      write(*,"('n=',I3)") n
      return
    end subroutine show_int
     subroutine show_character(str)
      implicit none
       character(len=*) ,intent(in) :: str
       write(*,"('str=',A)") str
       return
    end subroutine show_character
end module

second: add.h
interface show
  module procedure show_int, show_character
end interface

third:main.f90
program main
   use MA
   implicit none
   include 'add.h'
   call show_int(1)
   call show(1)
   call show_character("Fortran 95")
   call show("Fortran 95")
   print * ,"hello "
end program
编译gfortran add.f90 main.f90 -o main
得到错误。。。
add.h:2.2: 包含于 main.f90:4:
module procedure show_int, show_character
1
错误: (1) 语句无法归类
main.f90:6.13:
call show(1)
1
错误: 泛型‘show’在(1)处没有特定的子进程
main.f90:8.24:
call show("Fortran 95") 1
错误: 泛型‘show’在(1)处没有特定的子进程
I don't know why ? can you help me ? Thanks

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表