- 积分
- 249
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想在NCL中调用FORTRAN的,但是提示提出 错,貌似错误应该在Fortran代码中,但是我在VCF中是可以编译fortran代码的,,,不知道问题出在哪了,求大侠指点~~~
error1 ,while WRAPTI getlatlon.stub getlatlon.f90,shows:
A syntax error occurred while parsing:
LINKING
END WRAPIT
erro2, while run ncl getlatlon.ncl
warning:Could not find Init() in external file ./getlatlon.so, file not loaded
warning:error at line 2 in file getlatlon.ncl
fatal:syntax error: line 10 in file getlatlon.ncl before or near :
GETLATLON_SO:
----------------^
fatal:error in statement
fatal:Syntax Error in block, block not executed
fatal:error at line 16 in file getlatlon.ncl
***********fortran program**************
subroutine getlatlon (infile,nx,ny,ii,iilat,iilon)
implicit none
character*80 infile
integer:: nx,ny,ii,i,j
real:: iilat, iilon
real,allocatable::latlon(:,:)
open(10,file=infile,status='old')
allocate(latlon(nx,ny))
do j=1,ny
read(10,*)(latlon(i,j),i=1,nx)
end do
iilat=latlon(1,ii)
iilon=latlon(2,ii)
close(10)
return
end subroutine
*************************stub file************************
C NCLFORTSTART
SUBROUTINE getlatlon (infile,nx,ny,ii,iilat,iilon)
CHARACTER*80 infile
INTEGER nx,ny,ii
REAL iilat,iilon
C NCLEND
********************NCL file********************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
external GETLATLON_SO "./getlatlon.so"
begin
infile ="./station.txt"
nx=2
ny=60
do ii=1,ny
GETLATLON_SO::getlatlon(infile,nx,ny,ii,iilat,iilon)
print(iilat)
print(iilon)
end do
end
|
|