Re: WRAPIT script for Fortran 90 code

From: guangshan chen <gchen9_at_nyahnyahspammersnyahnyah>
Date: Sun, 26 Jul 2009 17:22:35 -0500

Hi Changlin,

Clearly, there was error in you ncl script. In your "cquad.f90",
there is no function or subroutine called as "arcln".
So you could not used it in your ncl script. Please delete the
following lines and test again.
> ;
> ; Calculate an arc length.
> ;
> xc = (/ 0., 1., 2. /)
> yc = (/ 0., 1., 0. /)
> arclen = EX01::arcln(nump,xc,yc) ; Call the NCL version of
> ; your Fortran function.
> print("Arc length = " + arclen) ; should be 2.82843

I just test it. There is no problem. If you continue to get the
error, please let me know.

Guangshan

On Jul 26, 2009, at 2:37 AM, Changlin Chen wrote:

> Hi:
> I using the WRAPIT script for Fortran 90 code.
> I follow the manuals in http://www.ncl.ucar.edu/Document/Manuals/
> Ref_Manual/NclExtend.shtml.
> Create file "cquad.f90":
> ************************************
> subroutine cquad(a,b,c,nq,x,quad)
> implicit none
> integer, intent(in) ::nq
> real, intent(in) ::a,b,c,x(nq)
> real, intent(out) ::quad(nq)
> integer ::i
> quad = a*x**2+b*x+c
> return
> end subroutine cquad:
> ***************************************
> Create a separate file, called "cquad90.stub" :
> **********************************
> C NCLFORTSTART
> subroutine cquad(a,b,c,nq,x,quad)
> real a,b,c
> integer nq
> dimension x(nq),quad(nq)
> C NCLEND
> ******************************************
> And then run the ncl file test.ncl:
> ******************************************
> external EX01 "./cquad90.so"
> begin
> ;
> ; Calculate three values of a quadratic equation
> ;
> nump = 3
> x = (/ -1., 0.0, 1.0 /)
> qval = new(nump,float)
> EX01::cquad(-1., 2., 3., nump, x, qval) ; Call the NCL version of
> ; your Fortran subroutine.
> print("Polynomial value = " + qval) ; Should be (/0,3,4/)
> ;
> ; Calculate an arc length.
> ;
> xc = (/ 0., 1., 2. /)
> yc = (/ 0., 1., 0. /)
> arclen = EX01::arcln(nump,xc,yc) ; Call the NCL version of
> ; your Fortran function.
> print("Arc length = " + arclen) ; should be 2.82843
> end
> ******************************************
>
> An error occur:
> warning:An error occurred loading the external file ./cquad90.so,
> file not loaded
> ./cquad90.so: undefined symbol: NclGetArgValue
> warning:error at line 4 in file test.ncl
> So what's the problem? Thanks!
>
>
> Clchen
> _______________________________________________
> 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 Sun Jul 26 2009 - 16:22:35 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 29 2009 - 09:07:41 MDT