local pointer to a multi size array in coarray

24 views
Skip to first unread message

Ehsan Madadi

unread,
Aug 1, 2019, 10:10:59 AM8/1/19
to OpenCoarrays
Hello,

Hope you guys having a good time. I have a question regarding the local pointer to a coarray data. Basically I have an array that I defined as below:

type coarrayElem2R
        real, dimension(:,:), allocatable :: elemC2R
end type

type(coarrayElem2R) :: elem2RV[*]

allocate( elem2RV%elemC2R(local_start_point:local_start_point+local_N_elem2, e2r_idx_max), source = 0.0)

once I did some math on this allocated coarray paramter, I am trying to use pointer inside a subroutine to point to the coarray parameter (elem2RV%elemC2R). for that purpose I use the copointer but it returns an invalid character name for me. here is what I do:

real,  copointer ::  kc2caf(:)[*]

kc2 => elem2R(:,e2r_Temp(next_e2r_temparray))

and this is what compiler returns
Error: Invalid character in name at (1) runge_kutta.f08:222:7: kc2caf => elem2RV%elemC2R(:,e2r_Temp(next_e2r_temparray))

I would appreciate any recommendation or help that I fix my issue. The only thing for me is to point to the coarray parameter.

Best regards,
Ehsan

Dan Nagle

unread,
Aug 1, 2019, 1:17:08 PM8/1/19
to Ehsan Madadi, OpenCoarrays
Hi,


> On Aug 1, 2019, at 08:10 , Ehsan Madadi <ehs.m...@gmail.com> wrote:

> real, copointer :: kc2caf(:)[*]
>
> kc2 => elem2R(:,e2r_Temp(next_e2r_temparray)

> Error: Invalid character in name at (1) runge_kutta.f08:222:7: kc2caf => elem2RV%elemC2R(:,e2r_Temp(next_e2r_temparray))

There is no copointer.

A regular pointer is used to point to a target on an image.
There are no inter-image pointers.

--

Cheers!
Dan Nagle


Ehsan Madadi

unread,
Aug 1, 2019, 1:49:07 PM8/1/19
to openco...@googlegroups.com
Hi Dan,

Thank you very much. So I did it this way, and added a target flag to the coarray parameter and it worked!

real, pointer :: kc2(:)

kc2 => elem2RV%elemC2R(:,e2r_Temp(next_e2r_temparray)

thanks again for your time and help.

Best regards,
Ehsan



On Thursday, August 1, 2019 at 12:17:08 PM UTC-5, Dan Nagle wrote:
Hi,

Dan Nagle

unread,
Aug 1, 2019, 4:31:39 PM8/1/19
to Ehsan Madadi, OpenCoarrays
Hi,


> On Aug 1, 2019, at 11:49 , Ehsan Madadi <ehs.m...@gmail.com> wrote:

> real, pointer, target :: kc2(:)

real, pointer :: kc2(:)

>
> kc2 => elem2RV%elemC2R(:,e2r_Temp(next_e2r_temparray)

target :: elem2RV

>
> where am I doing the mistake? I also tried real, pointer, target :: kc2(:)[*]



> On Thursday, August 1, 2019 at 12:17:08 PM UTC-5, Dan Nagle wrote:
> Hi,
>
>
> > On Aug 1, 2019, at 08:10 , Ehsan Madadi <ehs....@gmail.com> wrote:
>
> > real, copointer :: kc2caf(:)[*]
> >
> > kc2 => elem2R(:,e2r_Temp(next_e2r_temparray)
>
> > Error: Invalid character in name at (1) runge_kutta.f08:222:7: kc2caf => elem2RV%elemC2R(:,e2r_Temp(next_e2r_temparray))
>
> There is no copointer.
>
> A regular pointer is used to point to a target on an image.
> There are no inter-image pointers.
>
> --
>
> Cheers!
> Dan Nagle
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "OpenCoarrays" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opencoarrays...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/opencoarrays/c5714e60-cd58-4301-b248-9a86f95f683e%40googlegroups.com.


--

Cheers!
Dan Nagle


Reply all
Reply to author
Forward
0 new messages