24小时热门版块排行榜    

Znn3bq.jpeg
查看: 2994  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

sun805869434

金虫 (小有名气)

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

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

» 猜你喜欢

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

优秀是一种习惯
已阅   回复此楼   关注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的回帖
查看全部 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的回帖

绿遍山原

铜虫 (小有名气)

引用回帖:
5楼: Originally posted by 绿遍山原 at 2013-11-12 19:03:08
function r8_erf ( x )

!*****************************************************************************80
!
!! R8_ERF evaluates the error function of an R8 argument.
!
!  Licensing:
!
!    T ...

http://people.sc.fsu.edu/~jburkardt/f_src/fn/fn.f90
要夢遊,不要催眠。
6楼2013-11-12 19:06:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 322求调剂 +7 123安康 2026-04-12 14/700 2026-04-15 21:48 by noqvsozv
[考研] 药学求调剂 +11 RussHu 2026-04-12 13/650 2026-04-15 19:07 by zhuwenxu
[考研] 22专硕求调剂 +9 haoyun上岸 2026-04-11 11/550 2026-04-15 14:47 by elainzaizai
[考研] 调剂 +12 月@163.com 2026-04-11 12/600 2026-04-14 15:37 by zs92450
[考研] 人工智能320调剂08工类还有机会吗 +18 振—TZ 2026-04-10 19/950 2026-04-14 10:34 by screening
[考研] 一志愿华工085600 331分 +7 天下ww 2026-04-09 7/350 2026-04-13 09:01 by lhj2009
[考研] 一志愿浙大生物325分求调剂 +9 zysheng 2026-04-12 9/450 2026-04-12 22:31 by yuyin1233
[考研] 291求调剂 +8 关忆北. 2026-04-11 8/400 2026-04-12 09:32 by 逆水乘风
[考研] 材料与化工300求调剂 +39 肖开文 2026-04-09 43/2150 2026-04-12 01:30 by 秋豆菜芽
[考研] 085600材料与化工329分求调剂 +16 叶zilin 2026-04-10 16/800 2026-04-11 11:04 by may_新宇
[考研] 22408 352分求调剂0854类 +4 努力的夏末 2026-04-09 4/200 2026-04-11 09:57 by zhq0425
[考研] 342电子信息专硕求调剂 +9 你让我怎么荔枝 2026-04-10 10/500 2026-04-11 08:33 by zhq0425
[考研] 263能源动力专硕求调剂 +3 加大号饭盒袋 2026-04-10 3/150 2026-04-10 22:23 by 286640313
[考研] 调剂 +19 小张ZA 2026-04-10 20/1000 2026-04-10 22:08 by 猪会飞
[考研] 中科院总分315求调剂 +8 lallalh 2026-04-09 8/400 2026-04-10 19:30 by dick_runner
[考研] 本9 一志愿西工大085601 324求调剂 +5 wysyjs25 2026-04-10 5/250 2026-04-10 16:57 by luoyongfeng
[考研] 初试261 +3 Asht少 2026-04-10 6/300 2026-04-10 16:38 by Asht少
[考研] 机械专368 有去处吗 +4 种大树 2026-04-10 4/200 2026-04-10 15:31 by jiajinhpu
[考研] 一志愿中科大070300化学,314分求调剂 +12 wakeluofu 2026-04-09 12/600 2026-04-10 09:57 by liuhuiying09
[考研] 材料专硕初试分332一志愿西北工业大学, +12 故人?? 2026-04-09 12/600 2026-04-09 18:34 by Ccclqqq
信息提示
请填处理意见