Re: ERROR on WRAPIT "Could not find Init() in external file "

From: <ph0007_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 21 2009 - 17:21:34 MST

Hi Mary

I test your advise pass the parameter like:

C NCLFORTSTART
         subroutine expansion(input, output,ntime,nlat,nlon)
         integer ntime,nlon,nlat
         real input(nlon,nlat,ntime,3), output(6,nlon,nlat,ntime,3)
C NCLEND

But it doesn't work as before with error:

warning:Could not find Init() in external file ./ex_for.so, file not loaded
warning:error at line 4 in file ex_wave.ncl.

Is the following error during compiling important?

> WRAPIT Version: 090115
> ...../pgi/linux86-64/7.1-6/bin/pgf90
> A syntax error occurred while parsing:
> COMPILING ex_for.f
> LINKING
> END WRAPIT


Enclosed are the codes.

Thanks.


2009-12-22






发件人: Mary Haley
发送时间: 2009-12-22 00:14:01
收件人: ph0007
抄送: ncl-talk
主题: Re: [ncl-talk] ERROR on WRAPIT "Could not find Init() in external file "
 
Hi Huang Ping,
I believe WRAPIT doesn't like the PARAMETER statement.
You can work around this by hard-coding the values for nlon, nlat:
C NCLFORTSTART
         subroutine expansion(input, output,ntime)
         integer ntime,nlon,nlat
C parameter ( nlon=144,nlat=60)
         real input(144,60,ntime,3), output(6,144,60,ntime,3)
C NCLEND
Or you can pass nlon and nlat in like ntime:
C NCLFORTSTART
         subroutine expansion(input, output,ntime,nlat,nlon)
         integer ntime,nlon,nlat
         real input(nlon,nlat,ntime,3), output(6,nlon,nlat,ntime,3)
C NCLEND
I'll add this caveat to the WRAPIT documentation.
--Mary
On Dec 21, 2009, at 8:10 AM, ph0007@ustc.edu wrote:
> Hi all
>
> I want use a external fortran code in NCL using the WRAPIT tools.
> This is the information during compiling:
>
> WRAPIT -pg -fPIC ex_for.f
>
> WRAPIT Version: 090115
> ...../pgi/linux86-64/7.1-6/bin/pgf90
> A syntax error occurred while parsing:
> COMPILING ex_for.f
> LINKING
> END WRAPIT
>
> I have got the ex_for.so.
>
> And when I run the .ncl file using the subroutine in ex_for.f,
> error appears as:
>
> warning:Could not find Init() in external file ./ex_for.so, file
> not loaded
> warning:error at line 4 in file ex_wave.ncl
>
> fatal:syntax error: line 23 in file ex_wave.ncl before or near :
> expa_hf :
> --------^
>
> Here is the head of subroutine in ex_for.f:
>
> C NCLFORTSTART
> subroutine expansion(input, output,ntime)
>
> integer ntime,nlon,nlat
> parameter ( nlon=144,nlat=60)
> real input(nlon,nlat,ntime,3), output(6,nlon,nlat,ntime,3)
> C NCLEND
>
>
> And I use the subroutine in .ncl script as:
>
> external expa_hf "./ex_for.so"
> ......
> expa_hf :: expansion(input,output,nt)
>
> Anyone have suggestion?
>
> Thanks
>
> Huang Ping
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Mon Dec 21 17:22:00 2009

This archive was generated by hypermail 2.1.8 : Tue Dec 29 2009 - 10:29:16 MST