[petsc-users] VecGetArrayF90 vs. VecGetArrayReadF90

Runjian Wu wurunjian at gmail.com
Tue May 14 02:29:18 CDT 2024


Thanks for your explanation!

On Tue, May 14, 2024 at 10:33 AM Barry Smith <bsmith at petsc.dev> wrote:

>
>   It errors in C because the argument is labeled with const, but there
> does not seem to be a way in Fortran to indicate an array is read only.
>
>
>
> On May 13, 2024, at 10:21 PM, Runjian Wu <wurunjian at gmail.com> wrote:
>
> I only know the "intent(in)" attribute for the dummy arguments.
>
> In the counter function VecGetArrayRead(..), if I write values, will the
> compiler report an error?
>
> Runjian
>
> On Mon, May 13, 2024 at 9:36 PM Barry Smith <bsmith at petsc.dev> wrote:
>
>>
>>    I couldn't find a way in Fortran to declare an array as read-only. Is
>> there such support?
>>
>>    Barry
>>
>>
>> On May 13, 2024, at 7:28 AM, Runjian Wu <wurunjian at gmail.com> wrote:
>>
>> This Message Is From an External Sender
>> This message came from outside your organization.
>> Hi all,
>>
>> I have a question about VecGetArrayReadF90(...).  If I use
>> VecGetArrayReadF90(...), I can still write entries into the array like
>> VecGetArrayF90(...).  Is it possible to report an error during compile
>> process?
>>
>> Thanks,
>>
>> Runjian Wu
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240514/814e58e1/attachment-0001.html>


More information about the petsc-users mailing list