Hi Dan,
Thanks for the hint! It seems it doesn't...
PGF90-S-0155-Illegal POINTER assignment - rank of pointer target must be 1 or equal to rank of pointer object (/lus/scratch/olifu/tracer/cosmo4.23_tracer_pgi_wc/src/lmorg.f90: 2524)
...where the line 2524 contains...
vars(izvar)%p(1:ie,1:je,1:1) => qvsflx
...and qvsflx is (:,:).
Are there any workarounds for this?
Cheers,
Oli
> -----Original Message-----
> From: Fortran 90 List [mailto:[log in to unmask]] On
> Behalf Of Dan Nagle
> Sent: Mittwoch, 11. April 2012 18:01
> To: [log in to unmask]
> Subject: Re: 3d pointer to 2d target
>
> Hi,
>
> If your compiler supports pointer rank remapping, try
>
> p( 1: 30, 1: 40, 1: 1) => a
>
> On Apr 11, 2012, at 09:51 , Oliver Fuhrer wrote:
>
> > Hi all,
> >
> > I have the following...
> >
> > real, target :: a(30,40)
> > real, target :: b(30,40,50)
> > real, pointer :: p(:,:,:)
> >
> > subroutine work(c,nx,ny,nz)
> > implicit none
> > real, pointer :: c(:,:,:)
> > ...do some work...
> > end subroutine work
> >
> > ...and I would like to be able to pass a and b to work with a being passed as
> the degenerate case where the three dimensions are nx=30, ny=40, nz=1, in
> a way similar to...
> >
> > p => b
> > call work(p,30,40,50)
> > p => a
> > call work(p,30,40,1)
> >
> > The line "p => a" is not legal. But is there any way of pointing a 3d pointer to
> a 2d array with the last dimension being simply 1:1? That would make the
> design of my code significantly simpler.
> >
> > Cheers,
> > Oli
>
> --
> Cheers!
>
> Dan Nagle
|