Re: help: when wrapit comes across allocatable array

From: Sha Feng <sfeng_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 29 2011 - 15:32:33 MDT

Dennis,

My code is .f90. So I don't have to use the same declaration with the .f90 files in the .stub, do I?

A snippet of my code is also follows.
!==================================
subroutine C(...)
  implicit none
  integer,intent(in) :: nlev
  real,intent(in),dimension(nlev) :: temp
  real,intent(in),dimension(nlev) :: pres
  real,intent(in),dimension(nlev) :: alt
  real, intent(in) :: pliml, plimu,plimlex
  integer,intent(out) :: numtp
  real,intent(in) ::mis
  real,intent(out),dimension(nlev) :: tp,tt,ta

  integer :: i, j, validrow
  real,dimension(nlev) :: t,p,a
  real, dimension(:), allocatable :: t1,p1,a1
  real :: trp
....
  call A(...)
...
  call B(...)
...
end subroutine C

subroutine A(...)
...
end subroutine A

subroutine B(....)
...
end subroutine B
!==================================

BTW, this subroutine includes three subroutines (three subroutine in one .f90 file). Should I make declaration for all of them in the .stub file.

On Sep 29, 2011, at 5:10 PM, Dennis Shea wrote:

> It would be good to see a snippet of your f90 code.
>
> As along as the 'allocateable' is not between the
> C NCLFORTSTART
> C NCLEND
>
> Also, is the f90 code .f or .f90?
>
> C ----------Sample for .f file -----------------------------------
> C NCLFORTSTART
> subroutine wgt_runave (x,npts,wgt,nwgt,kopt,xmsg,ier)
> integer npts, nwgt,kopt,ier
> real x(npts), wgt(nwgt), xmsg
> C NCLEND
> integer lwork
> real, allocatable, dimension(:) :: work
>
> nhalf = nwgt/2
> lwork = npts+2*nhalf
> allocate (work(lwork), stat=ier)
>
> call wrunavx77 (x,npts,wgt,nwgt,kopt,xmsg,work,lwork,ier)
>
> deallocate (work)
>
> return ! NCL return (wrunwgt[x])
> end
>
>
>
>
> On 9/29/11 12:19 PM, Sha Feng wrote:
>> Hi ncl-talker,
>>
>> How can I deal with the codes which are related with allocatable arrays when I use WRAPIT to combine Fortran 90 subroutines with NCL scripts?
>>
>> Any suggestion is very much appreciated.
>>
>> Sha
>> _______________________________________________
>> 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 Thu Sep 29 15:33:07 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 09 2011 - 13:05:26 MDT