爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4785|回复: 2

[作图] NCL调用Fotran出错

[复制链接]

新浪微博达人勋

发表于 2019-12-23 10:07:49 | 显示全部楼层 |阅读模式

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

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

x
搜索了论坛上的帖子,试过dos2unix,也改过函数名字(不能带_),但是一直没用,一直显示,除此以外没有出错内容了,实在找不出来哪里不行 未命名图片.png
f90代码如下:
subroutine fortranrun(num, nlat, nlon, rundays, need_run, run, undef)
        implicit none
        integer, intent(in)::num, rundays, nlat, nlon  !num is the days which need doing running mean, rundays is the required running days.
        real, intent(in)::need_run(num,nlat,nlon), undef
        real, intent(out)::run(num,nlat,nlon)
        integer i,j,bb,m,n
        real sum,count1,a(3*num,nlat,nlon)

        if(mod(rundays,2)==1) then
                do m=1,nlat
                        do n=1,nlon
                                do i=1,3*num
                                        a(i,m,n)=need_run(mod(i,num),m,n) !allocate dynamic arrays
                                enddo
                        enddo
                enddo
                bb = int(rundays/2)

                run(:,:,:) = undef
                do m=1,nlat
                        do n=1,nlon
                                do i = 1,num
                                        sum = 0.0
                                        count1 = 0.
                                        do j = -bb,bb
                                                if(a(num+j,m,n)/=undef) then
                                                        sum=sum+a(num+j,m,n)
                                                        count1=count1+1
                                                endif                                                         
                                        enddo
                                               if(sum/=0.0) run(i,m,n)=sum/real(count1)
                                enddo
                        enddo
                enddo
        endif
return
end subroutine fortranrun


stub文件:
C NCLFORSTART
        subroutine fortranrun(num, nlat, nlon, rundays, need_run, run, undef)       
        implicit none
        real undef
        integer num,rundays,nlat,nlon
        real need_run(num,nlat,nlon),run(num,nlat,nlon)
C NCLEND




感谢大家
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2019-12-23 16:22:57 | 显示全部楼层
我用官网提供的脚本
ex.f
C NCLFORTSTART
      SUBROUTINE EX (II,XX)
      INTEGER II
      REAL XX
C NCLEND
      II = II + 5
      XX = XX - 12.345
      RETURN
      END
还是出现了相同的错误
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-12-23 16:25:27 | 显示全部楼层
复制黏贴的时候出了点问题,脚本是刚好七位缩进的
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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