Thanks Barry.
Another question is about subroutine ComputeMatrix(ksp,JJ,jac,ctx,ierr), which 
is called by KSPSetComputeOperators(ksp,ComputeMatrix,ctx,ierr).
In the tutorials, it seems that Mat JJ, the linear operator, is not assigned in 
ComputeMatrix. Only Mat jac, which supposed to be preconditioning matrix, is 
set. I am confused with this part. Why is the linear operator used without 
being set?
Looking forward to your reply.
Regards,
Pengyang
----------------------------------------------------------------
Pengyang Song(宋朋洋)
MSc candidate in Physical Oceanography
College of Oceanic and Atmospheric Sciences
Ocean University of China
No. 238 Songling Road, Qingdao 266100, Shandong, China
TEL: (+86) 15762264643

-----邮件原件-----
发件人: Smith, Barry F. <[email protected]> 
发送时间: 2018年10月27日 9:02
收件人: SONG Pengyang <[email protected]>
抄送: [email protected]
主题: Re: [petsc-users] Problems with fortran subroutine DMDAVecGetArrayF90


   You are calling the routine incorrectly. Take a look at usage in 
src/dm/examples/tutorials/ex11f90.F90

  Barry


> On Oct 26, 2018, at 5:16 AM, SONG Pengyang <[email protected]> wrote:
> 
> Hi all,
> I am trying to change a KSP tutorial code ex34.c to ex34f.F90. I found that 
> after I changed DMDAVecGetArray to DMDAVecGetArrayF90, and 
> DMDAVecRestoreArray to DMDAVecRestoreArrayF90. Compilation errors say that 
> there is no matching specific subroutine for this generic subroutine call. 
> Can anyone help me with the problem?
> The error massage is listed below and the fortran code is also attached. Many 
> thanks.
>  
> ex34f.F90(83): error #6285: There is no matching specific subroutine for this 
> generic subroutine call.   [DMDAVECGETARRAYF90]
>       call DMDAVecGetArrayF90(x,array,ierr) -----------^
> ex34f.F90(91): error #6285: There is no matching specific subroutine for this 
> generic subroutine call.   [DMDAVECRESTOREARRAYF90]
>       call DMDAVecRestoreArrayF90(x,array,ierr)
> -----------^
> compilation aborted for ex34f.F90 (code 1)
>  
> ----------------------------------------------------------------
> Pengyang Song(宋朋洋)
> MSc candidate in Physical Oceanography College of Oceanic and 
> Atmospheric Sciences Ocean University of China No. 238 Songling Road, 
> Qingdao 266100, Shandong, China
> TEL: (+86) 15762264643
>  
> <ex34f.F90>

Reply via email to