请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7898|回复: 4

[其他] NCL调用Fortran77子程序时出现问题

[复制链接]
回帖奖励 1 金钱 回复本帖可获得 1 金钱奖励! 每人限 1 次

新浪微博达人勋

发表于 2016-9-1 10:35:37 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
这是Fortran77子程序的代码,按照官网将其改写如下:

c-----*----------------------------------------------------6---------7--
c     M-term Guassian-Type Filter
c     Input variables: n, x(n), m
c        m: the term number used to running mean
c           it must be an odd number.
c     Output variables: y(n),z(n-m-1)
c        y: the filtered series of x.
c     Work parameters and array: c, cgm and ck(-(m-1)/2:(m-1)/2)
c        c: a tunable parameter, generally, c>2.0.
c      cgm: variance of Guassian distribution.
c     By Dr. LI Jianping, April 6, 2001.
C NCLFORTSTART
      subroutine guassfilter_2(n,m,x,y)
      dimension x(n),y(n)
      dimension xw((-(m-1)/2+1):(n+(m-1)/2)),ck(-(m-1)/2:(m-1)/2) !work array
C NCLEND
      undef=-9.99e33
      pi=3.1415926
      c=2.15
      nl=(m-1)/2
      cgm=float(nl)/c
      x1=x(1)
      xn=x(n)
      if(x(1).eq.undef)x1=x(2)
      if(x(n).eq.undef)xn=x(n-1)
      do i=-nl+1,1
        xw(i)=x1
      enddo
      do i=2,n-1
        xw(i)=x(i)
      enddo
      do i=n,n+nl
        xw(i)=xn
      enddo
      c1=1./(cgm*sqrt(2.*pi))
      ck(0)=c1
      do 10 i=1,nl
        ck(i)=c1*exp(-i*i/(2.*cgm*cgm))
        ck(-i)=ck(i)
  10  continue
      do 20 i=1,n
        y(i)=0.
        do j=-nl,nl
          y(i)=y(i)+ck(j)*xw(i+j)
        enddo
  20  continue
      if(x(1).eq.undef)y(1)=undef
      if(x(n).eq.undef)y(n)=undef
      return
      end
运行时出现的语法错误提示:WRAPIT Version: 120209
                                        A syntax error occurred while parsing: (
                                         COMPILING Gaussfilter.f
                                         LINKING
                                       END WRAPIT
气象家园的相关帖子看过了,不过还是不知道如何解决,有能力的大神帮助一下,万分感谢!
参考官网:http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml
参考帖子:http://bbs.06climate.com/forum.php?mod=viewthread&tid=25184


密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-10-19 12:19:05 | 显示全部楼层

回帖奖励 +1 金钱

你好,请问你是在cygwin环境下WRAPIT的吗
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-7-14 22:32:30 | 显示全部楼层

回帖奖励 +1 金钱

楼主,请问您的问题解决了吗?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 成长值: 0
发表于 2020-7-14 23:11:20 | 显示全部楼层

回帖奖励 +1 金钱

ncl这方面很鸡肋
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-12-15 11:17:15 | 显示全部楼层

回帖奖励 +1 金钱

{:5_275:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

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