Fortran Coder

查看: 109|回复: 3
打印 上一主题 下一主题

[求助] 曲面拟合调用库函数问题

[复制链接]

10

帖子

3

主题

0

精华

入门

F 币
46 元
贡献
26 点
跳转到指定楼层
楼主
发表于 2024-6-13 11:11:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在IVF2013中调用MSL6.0函数库中的B样条拟合曲面函数,Surface_Fitting函数,编译的时候出现如下报错:
1>------ 已启动生成:  项目: SurfaceFitting, 配置: Debug Win32 ------
1>Compiling with Intel(R) Visual Fortran Compiler XE 14.0.1.139 [IA-32]...
1>SurfaceFitting.f90
1>fortcom: Fatal: There has been an internal compiler error (C0000005).
1>compilation aborted for E:\IVF_File\SurfaceFitting\SurfaceFitting\SurfaceFitting.f90 (code 1)
1>
1>Build log written to  "file://E:\IVF_File\SurfaceFitting\SurfaceFitting\Debug\BuildLog.htm"
1>SurfaceFitting - 1 error(s), 0 warning(s)
========== 生成:  成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========


改装IMSL7.0后,该问题同样存在,请问如何解决呢?大家有没有方法,跪谢了!
分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

1980

帖子

12

主题

5

精华

论坛跑堂

臭石头雪球

F 币
1418 元
贡献
607 点

美女勋章热心勋章星光勋章新人勋章贡献勋章管理勋章帅哥勋章爱心勋章规矩勋章元老勋章水王勋章

沙发
发表于 2024-6-13 11:33:12 | 只看该作者
最基本的信息,代码。

10

帖子

3

主题

0

精华

入门

F 币
46 元
贡献
26 点
板凳
 楼主| 发表于 2024-6-13 16:53:05 | 只看该作者
谢谢楼上的高手:代码粘贴如下,案例就是IMSL安装目录下的自带的算例,请您查阅,不胜感激!
     
[Fortran] 纯文本查看 复制代码
program Test_SurfaceFitting
      INCLUDE 'link_fnl_shared.h'
      use numerical_libraries
  
      USE surface_fitting_int
      USE rand_int
      USE norm_int

      implicit none

! This is Example 1 for SURFACE_FITTING, tensor product
! B-splines approximation.  Use the function
! exp(-x**2-y**2) on the square (0, 2) x (0, 2) for samples.
! The spline order is "nord" and the number of cells is
! "(ngrid-1)**2".  There are "ndata" data values in the square.

      integer :: i
      integer, parameter :: ngrid=9, nord=4, ndegree=nord-1, &
      nbkpt=ngrid+2*ndegree, ndata = 2000, nvalues=100
      real(kind(1d0)), parameter :: zero=0d0, one=1d0, two=2d0
      real(kind(1d0)), parameter :: TOLERANCE=1d-3
      real(kind(1d0)), target :: spline_data (4, ndata), bkpt(nbkpt), &
             & coeff(ngrid+ndegree-1,ngrid+ndegree-1), delta, sizev, &
             & x(nvalues), y(nvalues), values(nvalues, nvalues)
      real(kind(1d0)), pointer :: pointer_bkpt(:)
      type (d_spline_knots) knotsx, knotsy

! Set Random Number generator seed
                                             
      real(kind(1d0)),parameter::zero_par=0.d0
      real(kind(1d0))::dummy_par(0)
      integer iseed_par,lev_par
      type(d_options)::iopti_par(2)

      iseed_par = 53976279
      iopti_par(1)=d_options(d_rand_gen_generator_seed,zero_par)
      iopti_par(2)=d_options(iseed_par,zero_par)

      call rand_gen(dummy_par,iopt=iopti_par)

! Generate random (x,y) pairs and evaluate the
! example exponential function at these values.   
      spline_data(1:2,:)=two*rand(spline_data(1:2,:))
      spline_data(3,:)=exp(-sum(spline_data(1:2,:)**2,dim=1))
      spline_data(4,:)=one

! Define the knots for the tensor product data fitting problem.
      delta = two/(ngrid-1)
      bkpt(1:ndegree) = zero
      bkpt(nbkpt-ndegree+1:nbkpt) =  two
      bkpt(nord:nbkpt-ndegree)=(/(i*delta,i=0,ngrid-1)/)

! Assign the degree of the polynomial and the knots.
      knotsx%spline_degree=ndegree
      knotsx%d_knots=>bkpt
      knotsy%spline_degree=knotsx%spline_degree
      knotsy%d_knots=>knotsx%d_knots

! Fit the data and obtain the coefficients.
      coeff = surface_fitting(spline_data, knotsx, knotsy)

! Evaluate the residual = spline - function
! at a grid of points inside the square.
      delta=two/(nvalues+1)
      x=(/(i*delta,i=1,nvalues)/); y=x

      values=exp(-spread(x**2,1,nvalues)-spread(y**2,2,nvalues))
      values=surface_values((/0,0/), x, y, knotsx, knotsy, coeff)-values
            
! Compute the R.M.S. error:
      sizev=norm(pack(values, (values == values)))/nvalues

      if (sizev <= TOLERANCE) then
         write (*,*) 'SURFACE_FITTING_EX1 Passed on pcdsms.'
      else
         write(*,*) 'SURFACE_FITTING_EX1 ********** Failed on pcdsms **********'
      end if
end program

10

帖子

3

主题

0

精华

入门

F 币
46 元
贡献
26 点
地板
 楼主| 发表于 2024-6-13 16:55:04 | 只看该作者
另外,怀疑是ISML版本的问题,我尝试了IMSL6.0,IMSL7.0两个版本,都是同样的问题,只要注释掉代码 :  coeff = surface_fitting(spline_data, knotsx, knotsy) ,编译就可以通过,不知道是啥原因?路径和环境变量设置都是正确的;
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-6-23 09:50

Powered by Tencent X3.4

© 2013-2024 Tencent

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