24小时热门版块排行榜    

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

sun805869434

金虫 (小有名气)

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

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

» 猜你喜欢

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

优秀是一种习惯
已阅   回复此楼   关注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的回帖
查看全部 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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料与化工考研调剂 +7 孅華 2026-03-22 7/350 2026-03-24 21:04 by greychen00
[考研] 289求调剂 +8 硕星赴 2026-03-23 8/400 2026-03-24 20:17 by peike
[考研] 0854电子信息求调剂 +6 α____ 2026-03-22 7/350 2026-03-24 19:46 by sunjie8888
[考研] 材料专硕找调剂 +5 哈哈哈吼吼吼哈 2026-03-23 5/250 2026-03-24 19:07 by 了了了了。。
[考研] 招08考数学 +7 laoshidan 2026-03-20 16/800 2026-03-24 17:52 by 乌拉儿山脉
[考研] 080500求调剂 +3 zzzzfan 2026-03-24 3/150 2026-03-24 16:38 by barlinike
[考研] 307求调剂 +3 余意卿 2026-03-21 6/300 2026-03-24 15:03 by 余意卿
[考研] 一志愿北京化工大学材料与化工 264分各科过A区国家线 +3 哈哈157349 2026-03-21 3/150 2026-03-24 14:11 by zhyzzh
[考研] 化学308分求调剂 +3 你好明天你好 2026-03-23 3/150 2026-03-23 20:11 by macy2011
[考研] 0703化学求调剂 +4 奶油草莓. 2026-03-22 5/250 2026-03-23 19:37 by pswait
[考研] 336求调剂 +4 收到VS 2026-03-20 4/200 2026-03-23 19:02 by macy2011
[考研] 北科281学硕材料求调剂 +8 tcxiaoxx 2026-03-20 9/450 2026-03-23 12:16 by tcxiaoxx
[考研] 280分求调剂 一志愿085802 +4 PUMPT 2026-03-22 7/350 2026-03-22 22:13 by 星空星月
[考研] 306求调剂 +5 来好运来来来 2026-03-22 5/250 2026-03-22 16:17 by BruceLiu320
[考研] 生物学调剂 +5 Surekei 2026-03-21 5/250 2026-03-22 14:39 by tcx007
[考研] 求调剂 +7 Auroracx 2026-03-22 7/350 2026-03-22 12:38 by 素颜倾城1988
[考研] 材料学硕301分求调剂 +7 Liyouyumairs 2026-03-21 7/350 2026-03-21 22:31 by peike
[基金申请] 学校已经提交到NSFC,还能修改吗? 40+4 babangida 2026-03-19 9/450 2026-03-21 16:12 by babangida
[考研] 294求调剂材料与化工专硕 +15 陌の森林 2026-03-18 15/750 2026-03-20 23:28 by JourneyLucky
[考研] 295复试调剂 +8 简木ChuFront 2026-03-19 8/400 2026-03-20 20:44 by zhukairuo
信息提示
请填处理意见