<div dir="ltr">Dear all<div>I am creating a vector in fortran like this</div><div><br><p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="color:rgb(51,187,200)">PetscReal,allocatable :: res(:,:)</span><br></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(51,187,200)">Vec :: v_res</span></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(51,187,200)">allocate( res(nvar,nvl_nvg) )</span></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(51,187,200)">call</span><span style="font-variant-ligatures:no-common-ligatures"> VecCreateMPIWithArray(PETSC_COMM_WORLD, nvar, nvar</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">*</span><span style="font-variant-ligatures:no-common-ligatures">nvl, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(213,59,211)">&</span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> PETSC_DECIDE, res(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">1</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">1</span><span style="font-variant-ligatures:no-common-ligatures">), v_res, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(213,59,211)">&</span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr); CHKERRQ(ierr)</span></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p>Note that my array "res" is larger than needed by the vector v_res.</div><div><br></div><div>Is this ok to do this ? </div><div><br></div><div>I use the extra "res" array for dummy ghost values, but I dont need v_res to be ghosted.</div><div><br></div><div>Thanks</div><div>praveen</div></div>