Re: WRAPIT

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 14 Jan 2008 11:14:34 -0700

Larry McDaniel wrote:
> Hello
>
> Is there a version of WRAPIT that can handle f95 code?
>
> Larry
>
NCL's built-in fortran parser only understands f77 syntax.

However, you can use f90+ code by creating "stub" files that
contain the calling sequence using f77 syntax.

The following is taken from
http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml
see section: *Fortran 90 - Write special wrapper text as separate file
**===================================*

If you have a Fortran 90 file, then you need to create a separate "stub" f
ile that contains the "C NCLFORTSTART" and "C NCLEND" delimiters.
For example, assume the above "cquad" routine was in a Fortran 90 file
called "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 something like "cquad90.stub" that
contains nothing more than the following lines:

C NCLFORTSTART
      subroutine cquad(a,b,c,nq,x,quad)
      real a,b,c
      integer nq
      dimension x(nq),quad(nq)
C NCLEND

    WRAPIT cquad90.stub cquad.f90

Stub files are only required for subroutines actually called from NCL.

Good Luck
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 14 2008 - 11:14:34 MST

This archive was generated by hypermail 2.2.0 : Mon Jan 14 2008 - 14:16:57 MST