[ncl-talk] WRAPIT NCL fortran
杨瑞
yangrui at mail.iap.ac.cn
Sun Jul 17 01:40:39 MDT 2016
Hi all,
I want to call Fortran in NCL to read in data, but it shows errors on my Mac while
run WRAPIT, would you please help me find out the reasons?
Thanks !
error 1,while WRAPTI sum_q_total.stub sum_q_total.f90,shows:
WRAPIT.c:133:2: warning: implicit declaration of function 'sum_q_total_' is
invalid in C99 [-Wimplicit-function-declaration]
NGCALLF(sum_q_total,SUM_Q_TOTAL)(nlev,sn,ew,t,q,sumforq);
^
/Users/yangrui/soft/ncl-6.2.1/include/ncarg/c.h:31:29: note: expanded from macro
'NGCALLF'
#define NGCALLF(reg,caps) reg##_
^
<scratch space>:292:1: note: expanded from here
sum_q_total_
^
1 warning generated.
COMPILING sum_q_total.f90
LINKING
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
END WRAPIT
erro2, while run ncl sum_q_total.ncl
warning:Could not find Init() in external file ./getlatlon.so, file
not loaded
***********fortran program**************
subroutine sum_q_total(nlev,sn,ew,q,sumforq)
implicit none
integer,intent(in) ::nlev,sn,ew
real, intent(in) ::q(ew,sn,nlev)
real, intent(out) ::sumforq(ew,sn)
integer ::i,j,k
sumforq=0.
do k=1,nlev
do j=1,sn
do i=1,ew
sumforq(i,j)=sumforq(i,j)+q(i,j,k)
enddo
enddo
enddo
return
end subroutine sum_q_total
*************************stub file************************
C NCLFORTSTART
subroutine sum_q_total(nlev,sn,ew,t,q,sumforq)
integer nlev,sn,ew
dimension t(ew,sn,nlev),q(ew,sn,nlev),sumforq(ew,sn)
C NCLEND
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160717/38fa2fe9/attachment.html
More information about the ncl-talk
mailing list