24小时热门版块排行榜    

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

sun805869434

金虫 (小有名气)

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

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

» 猜你喜欢

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

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

sun805869434

金虫 (小有名气)

送红花一朵
引用回帖:
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 ...

谢谢。
优秀是一种习惯
7楼2013-11-12 19:24:51
已阅   回复此楼   关注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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 306求0703调剂一志愿华中师范 +10 纸鱼ly 2026-03-21 11/550 2026-03-24 17:22 by qingfeng258
[考研] 321求调剂 +4 Ymlll 2026-03-24 4/200 2026-03-24 14:44 by sprinining
[考研] 一志愿华东理工大学081700,初试分数271 +5 kotoko_ik 2026-03-23 6/300 2026-03-24 10:29 by 学术搬砖er
[考研] 一志愿吉大化学322求调剂 +4 17501029541 2026-03-23 6/300 2026-03-24 10:21 by 戴围脖的小蚊子
[考博] 26申博自荐 +3 whh869393 2026-03-24 3/150 2026-03-24 09:55 by 21018060
[考研] 284求调剂 +10 Zhao anqi 2026-03-22 10/500 2026-03-24 00:08 by Equinoxhua
[考研] 07化学280分求调剂 +4 722865 2026-03-23 4/200 2026-03-24 00:01 by chixmc
[考研] 材料/农业专业,07/08开头均可,过线就行 +3 呵唔哦豁 2026-03-23 4/200 2026-03-23 22:30 by 汪!?!
[考研] 材料专硕英一数二306 +8 z1z2z3879 2026-03-18 8/400 2026-03-23 20:49 by baobaoye
[考研] 一志愿070300浙大化学358分,求调剂! +4 酥酥鱼.. 2026-03-21 4/200 2026-03-23 08:12 by Iveryant
[考研] 一志愿西安交通大学材料工程专业 282分求调剂 +11 枫桥ZL 2026-03-18 13/650 2026-03-22 20:26 by edmund7
[考研] 求调剂 +3 13341 2026-03-20 3/150 2026-03-21 18:28 by 学员8dgXkO
[考研] 一志愿重庆大学085700资源与环境总分308求调剂 +7 墨墨漠 2026-03-20 7/350 2026-03-21 16:36 by barlinike
[考研] 求调剂 +6 Mqqqqqq 2026-03-19 6/300 2026-03-21 08:04 by JourneyLucky
[考研] 一志愿重庆大学085700资源与环境专硕,总分308求调剂 +3 墨墨漠 2026-03-18 3/150 2026-03-21 00:39 by JourneyLucky
[考研] 考研调剂求学校推荐 +3 伯乐29 2026-03-18 5/250 2026-03-20 22:59 by JourneyLucky
[考研] 求调剂一志愿南京航空航天大学289分 +3 @taotao 2026-03-19 3/150 2026-03-20 21:34 by JourneyLucky
[考研] 295复试调剂 +8 简木ChuFront 2026-03-19 8/400 2026-03-20 20:44 by zhukairuo
[考研] 材料考研调剂 +3 xwt。 2026-03-19 3/150 2026-03-19 11:22 by w沐阳w
[考研] 本科郑州大学物理学院,一志愿华科070200学硕,346求调剂 +4 我不是一根葱 2026-03-18 4/200 2026-03-19 09:11 by 浮云166
信息提示
请填处理意见