<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> This should work for at least the last three versions of PETSc. Please upgrade to the latest PETSc version and let us know if you continue to get this error message.<div class=""><br class=""></div><div class=""> Yes, for some PETSc versions between 3.8 and 3.14 it may generate this error message with some Fortran compilers.<br class=""><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 21, 2022, at 9:23 AM, wang yuqi <<a href="mailto:yu1299885905@outlook.com" class="">yu1299885905@outlook.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class="">从<span lang="EN-US" class=""><span class="Apple-converted-space"> </span>Windows<span class="Apple-converted-space"> </span></span>版<span lang="EN-US" class=""><a href="https://go.microsoft.com/fwlink/?LinkId=550986" style="color: blue; text-decoration: underline;" class=""><span lang="EN-US" class=""><span lang="EN-US" class="">邮件</span></span></a></span>发送</div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-size: 12pt; font-family: SimSun;" class="">Hi, Dear developer:<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: rgb(51, 51, 51); background-color: rgb(247, 248, 250);" class="">I had compilation problems when using VecGetValues. My procedure is as follows:<o:p class=""></o:p></span></div><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">program</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>main<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(86, 156, 214);" class="">#</span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">include</span><span lang="EN-US" style="font-family: Consolas; color: rgb(86, 156, 214);" class=""><span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(206, 145, 120);" class=""><petsc/finclude/petscvec.h></span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">use</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>petscvec<o:p class=""></o:p></span></div></div></div></div><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> Vec x<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> PetscInt N,i,ione<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> PetscErrorCode ierr<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> PetscMPIInt rank<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> PetscScalar one<o:p class=""></o:p></span></div></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>PetscInitialize(PETSC_NULL_CHARACTER,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">if</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>(ierr .ne.<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">0</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class="">)<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">then</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">print</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class="">*,</span><span lang="EN-US" style="font-family: Consolas; color: rgb(206, 145, 120);" class="">'PetscInitialize failed'</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">stop</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">endif</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> one =<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">1.0</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)<o:p class=""></o:p></span></div></div></div></div><div class=""><div class=""><div class=""><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> N = rank +<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">1</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecCreateMPI(PETSC_COMM_WORLD,N,PETSC_DECIDE,x,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecGetSize(x,N,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecSet(x,one,ierr)<o:p class=""></o:p></span></div></div></div></div><div class=""><div class=""><div class=""><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> ione =<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">1</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">do</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">100</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>i=</span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">0</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class="">,N-rank</span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">-1</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> </span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecSetValues(x,ione,i,one,ADD_VALUES,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> </span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">100</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span> </span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">continue</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div></div></div><div class=""><div class=""><div class=""><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecAssemblyBegin(x,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecAssemblyEnd(x,ierr)<o:p class=""></o:p></span></div></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">if</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>(rank .eq.<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">0</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class="">)<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">then</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> ione =<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(181, 206, 168);" class="">0</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecGetValues(x,ione,i,one,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">endif</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecView(x,PETSC_VIEWER_STDOUT_WORLD,ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>VecDestroy(x,ierr)<o:p class=""></o:p></span></div></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">call</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>PetscFinalize(ierr)<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(197, 134, 192);" class="">end PROGRAM</span><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><span class="Apple-converted-space"> </span>main<o:p class=""></o:p></span></div></div></div></div><div style="margin: 0cm; text-align: left; font-size: 10.5pt; font-family: DengXian; line-height: 14.25pt; background-color: rgb(30, 30, 30);" class=""><span lang="EN-US" style="font-family: Consolas; color: rgb(212, 212, 212);" class=""><o:p class=""> </o:p></span></div></div></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: rgb(51, 51, 51); background-color: rgb(247, 248, 250);" class="">The compilation error is as follows:<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">mpif90 -I/root/soft/petsc/3.8.0/include -o ex2f.o ex2f.F90<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">ex2f.F90(62): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic. [C]<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class=""> call VecGetValues(x,ione,i,one,ierr)<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">-------------^<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">ex2f.F90(62): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic. [D]<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class=""> call VecGetValues(x,ione,i,one,ierr)<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">-------------^<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: red; background-color: rgb(247, 248, 250);" class="">compilation aborted for ex2f.F90 (code 1)<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: rgb(51, 51, 51); background-color: rgb(247, 248, 250);" class="">And this error only appears when the Petsc version is higher than 3.8.<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: rgb(51, 51, 51); background-color: rgb(247, 248, 250);" class="">I look forward to hearing from you.<o:p class=""></o:p></span></div><div style="margin: 0cm; text-align: justify; font-size: 10.5pt; font-family: DengXian;" class=""><span lang="EN-US" style="font-family: Tahoma, sans-serif; color: rgb(51, 51, 51); background-color: rgb(247, 248, 250);" class="">Thanks!</span></div></div></div></blockquote></div><br class=""></div></div></body></html>