24小时热门版块排行榜    

查看: 2436  |  回复: 9
【悬赏金币】回答本帖问题,作者sun805869434将赠送您 5 个金币
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

sun805869434

金虫 (小有名气)

[求助] FORTRAN中erf函数怎么编译?

我用的f90的格式编译程序,其中有计算erf函数的部分,输入后程序不识别这个函数,为什么?是编译有错误吗?图片是这一部分程序,其中的erf函数没有变色,就证明程序不识别这个函数,怎么改?
FORTRAN中erf函数怎么编译?
_~D5C@4O]9L[2HJR`NQV]4Q.jpg
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

优秀是一种习惯
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hjman

新虫 (初入文坛)

引用回帖:
3楼: Originally posted by 绿遍山原 at 2013-11-12 16:23:55
也可以用imsl

imsl 库中有erf函数吗?函数名叫什么,我怎么没找到啊
10楼2015-12-23 09:02:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

绿遍山原

铜虫 (小有名气)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
sun805869434: 金币+15, ★★★很有帮助 2013-11-12 19:25:19
cvf没有误差函数,自己找一个加到源代码里面。

» 本帖已获得的红花(最新10朵)

要夢遊,不要催眠。
2楼2013-11-12 16:21:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sun805869434

金虫 (小有名气)

送红花一朵
引用回帖:
2楼: Originally posted by 绿遍山原 at 2013-11-12 16:21:46
cvf没有误差函数,自己找一个加到源代码里面。

请问源代码哪里能找到呢?
优秀是一种习惯
4楼2013-11-12 16:36:39
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

绿遍山原

铜虫 (小有名气)

引用回帖:
4楼: Originally posted by sun805869434 at 2013-11-12 16:36:39
请问源代码哪里能找到呢?...

CODE:
function r8_erf ( x )

!*****************************************************************************80
!
!! R8_ERF evaluates the error function of an R8 argument.
!
!  Licensing:
!
!    This code is distributed under the GNU LGPL license.
!
!  Modified:
!
!    10 September 2011
!
!  Author:
!
!    Original FORTRAN77 version by Wayne Fullerton.
!    FORTRAN90 version by John Burkardt.
!
!  Reference:
!
!    Wayne Fullerton,
!    Portable Special Function Routines,
!    in Portability of Numerical Software,
!    edited by Wayne Cowell,
!    Lecture Notes in Computer Science, Volume 57,
!    Springer 1977,
!    ISBN: 978-3-540-08446-4,
!    LC: QA297.W65.
!
!  Parameters:
!
!    Input, real ( kind = 8 ) X, the argument.
!
!    Output, real ( kind = 8 ) R8_ERF, the error function of X.
!
  implicit none

  real ( kind = 8 ) erfcs(21)
  integer ( kind = 4 ) nterf
  real ( kind = 8 ) r8_csevl
  real ( kind = 8 ) r8_erf
  real ( kind = 8 ) r8_erfc
  integer ( kind = 4 ) r8_inits
  real ( kind = 8 ) r8_mach
  real ( kind = 8 ), save :: sqeps = 0.0D+00
  real ( kind = 8 ) sqrtpi
  real ( kind = 8 ) value
  real ( kind = 8 ) x
  real ( kind = 8 ) xbig
  real ( kind = 8 ) y

  save erfcs
  save nterf
  save sqrtpi
  save xbig

  data erfcs(  1) / -0.49046121234691808039984544033376D-01 /
  data erfcs(  2) / -0.14226120510371364237824741899631D+00 /
  data erfcs(  3) / +0.10035582187599795575754676712933D-01 /
  data erfcs(  4) / -0.57687646997674847650827025509167D-03 /
  data erfcs(  5) / +0.27419931252196061034422160791471D-04 /
  data erfcs(  6) / -0.11043175507344507604135381295905D-05 /
  data erfcs(  7) / +0.38488755420345036949961311498174D-07 /
  data erfcs(  8) / -0.11808582533875466969631751801581D-08 /
  data erfcs(  9) / +0.32334215826050909646402930953354D-10 /
  data erfcs( 10) / -0.79910159470045487581607374708595D-12 /
  data erfcs( 11) / +0.17990725113961455611967245486634D-13 /
  data erfcs( 12) / -0.37186354878186926382316828209493D-15 /
  data erfcs( 13) / +0.71035990037142529711689908394666D-17 /
  data erfcs( 14) / -0.12612455119155225832495424853333D-18 /
  data erfcs( 15) / +0.20916406941769294369170500266666D-20 /
  data erfcs( 16) / -0.32539731029314072982364160000000D-22 /
  data erfcs( 17) / +0.47668672097976748332373333333333D-24 /
  data erfcs( 18) / -0.65980120782851343155199999999999D-26 /
  data erfcs( 19) / +0.86550114699637626197333333333333D-28 /
  data erfcs( 20) / -0.10788925177498064213333333333333D-29 /
  data erfcs( 21) / +0.12811883993017002666666666666666D-31 /

  data nterf / 0 /
  data sqrtpi / 1.77245385090551602729816748334115D+00 /
  data xbig / 0.0D+00 /

  if ( nterf == 0 ) then
    nterf = r8_inits ( erfcs, 21, 0.1D+00 * r8_mach ( 3 ) )
    xbig = sqrt ( - log ( sqrtpi * r8_mach ( 3 ) ) )
    sqeps = sqrt ( 2.0D+00 * r8_mach ( 3 ) )
  end if

  y = abs ( x )

  if ( y <= sqeps ) then
    value = 2.0D+00 * x / sqrtpi
  else if ( y <= 1.0D+00 ) then
    value = x * ( 1.0D+00 &
      + r8_csevl ( 2.0D+00 * x * x - 1.0D+00, erfcs, nterf ) )
  else if ( y <= xbig ) then
    value = 1.0D+00 - r8_erfc ( y )
    if ( x < 0.0D+00 ) then
      value = - value
    end if
  else
    value = 1.0D+00
    if ( x < 0.0D+00 ) then
      value = - value
    end if
  end if

  r8_erf = value

  return
end

» 本帖已获得的红花(最新10朵)

要夢遊,不要催眠。
5楼2013-11-12 19:03:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
不应助 确定回帖应助 (注意:应助才可能被奖励,但不允许灌水,必须填写15个字符以上)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 博后网上办公系统维护 +14 取名字烦人 2024-06-25 22/1100 2024-06-26 22:15 by tuanbao2023
[硕博家园] 夏至,要不要硕博联谊 +6 我是王小帅 2024-06-21 8/400 2024-06-26 21:05 by zxw3578
[考博] 对象没有,还非常想读博,难以抉择 +28 pvrw0224 2024-06-23 52/2600 2024-06-26 20:22 by pvrw0224
[硕博家园] 回家两天,不想呆了 +7 368ghnf 2024-06-22 13/650 2024-06-26 19:07 by ZZZemmm
[基金申请] 国基在研影响申请结果吗 +10 WOWO159357 2024-06-26 10/500 2024-06-26 18:19 by 德尚中行
[有机交流] 大佬们,打的核磁氢谱与chemdraw预测的有偏差 +5 来了个 2024-06-26 5/250 2024-06-26 17:28 by Jasonlin7758
[基金申请] 国产期刊影响因子大于12的有20多个个了 +19 babu2015 2024-06-20 24/1200 2024-06-26 16:57 by deliciou
[找工作] 老博士选高校 5+5 woodhead8386 2024-06-24 8/400 2024-06-26 16:35 by 大大熊呀
[论文投稿] 我在写关于多维空间的论文,希望能与大家交流,准备在science上发表 +8 lgf519 2024-06-24 10/500 2024-06-26 16:25 by 梦渺岚烟
[基金申请] 博后面上今天下午会公布吗?有无消息? +26 hajkdfdf 2024-06-24 43/2150 2024-06-26 16:04 by kyukitu
[基金申请] 博后面上和特助今天出吗? +41 逗您玩 2024-06-21 78/3900 2024-06-26 16:00 by HAPPY_0225
[基金申请] 省基金对国自然申请是有利还是有弊 +6 zycumt04 2024-06-26 7/350 2024-06-26 15:02 by 潇湘之迷
[基金申请] 要持续整治滥发“帽子”、“牌子”之风 +6 babu2015 2024-06-25 6/300 2024-06-26 14:52 by felicity6056
[硕博家园] 【45岁以上博士】柔性人才引进项目,有补贴 +9 Dreamsummit 2024-06-24 18/900 2024-06-26 12:28 by hujm159
[基金申请] 今天能不能出来名单 +8 地理学1995 2024-06-25 10/500 2024-06-26 09:46 by msjy
[考博] 没读上博,好焦虑! +6 wangzhe_bs 2024-06-24 8/400 2024-06-25 21:15 by wangzhe_bs
[基金申请] 能看出是否上会了吗 +10 articlefan 2024-06-23 15/750 2024-06-25 16:05 by 请慎重修改昵称
[基金申请] 焦虑没有毛线用,默默前行是王道! +4 漠上藜梭 2024-06-24 8/400 2024-06-25 14:32 by 漠上藜梭
[基金申请] 说博后基金7月出的真打电话了吗? +12 antonysole 2024-06-24 14/700 2024-06-24 13:39 by sizhouyi
[有机交流] 生成亚胺的反应怎么能进行完全 +3 1369836 2024-06-23 3/150 2024-06-23 18:44 by hwqMSE
信息提示
请填处理意见