Re: help for a WRIPT question

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 5 Jun 2007 17:20:50 -0600 (MDT)

WRAPIT has several f77 problems:

   [a] You can not use "data" as an argument.
       I think the parser gets confused with the
       data declaration statement.

   [b] arguments like x(0:n) while standard f77 syntax
       are not adequately handled by the parser.

The approch below is the only way I know how to get around the problem.

On Tue, 5 Jun 2007, Mary Haley wrote:

> Hi Li,
>
> I didn't realize either that WRAPIT wouldn't work on "x(0:n)"
> type of syntax. I need to add this to the WRAPIT documentation.
>
> Meanwhile, I think if you create a simple driver program to call this
> subroutine, then you can get around this. You'll want to rename your
> original routine to something else, so that you can give the driver
> program the original name. You will also need to be careful in your
> NCL script to call this function with "n+1" (n1), and not just "n":
>
> C NCLFORTSTART
> subroutine pp(x,y,n1)
> integer n1,i
> real x(n1),y(n1)
> C NCLEND
> call mainpp(x,y,n1-1)
> end
>
> subroutine mainpp(x,y,n)
> integer n,i
> real x(0:n),y(0:n)
>
> do 10 i=0,n
> y(i)=3*x(i)
> write(*,*) y(i)
> 10 continue
>
> end
>
> I don't know if this is the ideal solution, so I welcome suggestions
> from others.
>
> --Mary
>
>
> On Tue, 5 Jun 2007, lxf wrote:
>
> > Hi,
> >
> > I have had a WRAPIT question before I try to call fortran subroutine in
> > NCL script.
> > Here is the error information:
> > -------------------------------------------
> > % WRAPIT yjj.f
> >
> > WRAPIT Version: 041207
> > A syntax error occurred while parsing: :
> > COMPILING yjj.f
> > LINKING
> > END WRAPIT
> > -------------------------------------------------
> > ==================================================
> > and the folowing is the "yjj.f" :
> >
> > C NCLFORTSTART
> > subroutine pp(x,y,n)
> > integer n,i
> > real x(0:n),y(0:n)
> > C NCLEND
> > do 10 i=0,n
> > y(i)=3*x(i)
> > write(*,*) y(i)
> > 10 continue
> >
> > end
> > -----------------------------------------------------
> > =====================================================
> >
> > So, I am puzzled about it . It seems tahat the WRAPIT can't recgnize the
> > arrray such as "x(0:n) ". Do someone know how to fix it?
> > And any help is appreaciated.
> >
> >
> > ------------
> > Li
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 05 2007 - 17:20:50 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 20 2007 - 17:02:19 MDT