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

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 21 2009 - 09:13:40 MST

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 09:13:59 2009

This archive was generated by hypermail 2.1.8 : Mon Dec 21 2009 - 09:22:56 MST