Re: WRAPIT woes linking to NAG library

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 28 Feb 2006 14:52:20 -0700 (MST)

>I am having WRAPIT issues when trying to link NCL to the NAG fortran
>library (the linux/g77 version). It's weird because I have linked some
>NAG subroutines easily and correctly today, but not one in particular.
>
>The WRAPIT command, the errors generated and the fortran statements are
>pasted below. The variable allegedly associated with the problem (N2)
>is an integer that contains the size of the Y array.
>
>I am running red hat enterprise linux WS 3, using the g77 compiler and
>the latest NCL release.
>
>Many thanks for any suggestions or hints!
>
>
>WRAPIT -n mannWhitney -L /usr/local/NAG/fllux20dgl/libnag.a -l pthread
>mannWhitney.f
>
>WRAPIT Version: 041106
>/usr/bin/g77
>A syntax error occurred while parsing: N2
>COMPILING mannWhitney.f
>LINKING
>END WRAPIT
>
>
>fortran code here......
>
>C NCLFORTSTART
>
> subroutine mannWhitney(N1,X,N2,Y,TAIL,U,UNOR,P,TIES,RANKS,
> * WRK,IFAIL)
>
> integer N1,N2,IFAIL
> double precision U,UNOR,PEXACT,RANKS(N1+N2),WRK(8000),
> * X(N1),Y(N2)
> logical TIES
> character TAIL
>
>C NCLEND
>
> external G08AHF
>
> call G08AHF(N1,X,N2,Y,TAIL,U,UNOR,P,TIES,RANKS,WRK,IFAIL)
>
> return
> end
>
>--

Hi Maurice,

The problem is with the simple fortran parser
invoked by the WRAPIT utility. The two instances
where known failures occur are: (a) having a variable
named "data"; and (b) using dimension subscripts
like (N1+N2).

The work around is fairly straight forward. I assume
you are returning RANKS to the NCL script. Also, I would
not pass WRK from NCL to the fortran. Rather, I would
allocate in the fortran code. While not standard f77,
automatic arrays are an extension allowed by the g77
compiler. Of course, they are standard f90.

What is PEXACT ... do u mean P ?

In ncl
   n1n2 = n1 + n2
   ranks = new ( n1n2, "double")
   
   NAG::mannWhitney(n1,x,n2,y,tail,u,unor,p,ties,ranks,ifail,n1n2)

C NCLFORTSTART
        subroutine mannWhitney(N1,X,N2,Y,TAIL,U,UNOR,P,TIES,RANKS,
      * IFAIL,N1N2)

        integer N1,N2,IFAIL,N1N2
        double precision U,UNOR,PEXACT,RANKS(N1N2),
      * X(N1),Y(N2)
        logical TIES
        character TAIL
C NCLEND
        double precision WRK(8000) ! local

        external G08AHF

        call G08AHF(N1,X,N2,Y,TAIL,U,UNOR,P,TIES,RANKS,WRK,IFAIL)

       return
       end

HTH
D

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 28 2006 - 14:52:20 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 28 2006 - 15:13:29 MST