<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> I do not know. It depends on how the Fortran compiler decides to interprete the [] and pass the address down. In the end the address of the actual array in p has to sent down since it will be used later so if the compiler makes a new array with [] or does something fancy it may or may not work.<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 11, 2025, at 12:08 PM, Sanjay Govindjee <s_g@berkeley.edu> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div><br clear="all"></div><div><div dir="ltr" class="gmail_signature"><div>Would a construct like</div><div style="margin-left:40px">call VecCreateSeqWithArray(PETSC_COMM_WORLD, nvar, nvar*g%nvl, &<br> [s%res(1,1)] , p%v_res, ierr); CHKERRQ(ierr)</div></div></div><div>or</div><div style="margin-left:40px">call VecCreateSeqWithArray(PETSC_COMM_WORLD, nvar, nvar*g%nvl, &<br> (/ s%res(1,1) /), p%v_res, ierr); CHKERRQ(ierr)</div>be sufficient in this case?</div><div dir="ltr"><br></div><div>-sanjay</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Aug 11, 2025 at 7:54 AM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div> <div> PETSc now provides Fortran interface definitions in the Fortran modules for most PETSc functions. This means the argument types and array dimensions of the function must match the expected type and dimension. </div><div><br></div><div> In this case, the argument s%res(1,1) is likely a scalar while VecCreateSeqWithArray is expected to be a one-dimensional array. You can change your code to declare res(1,1) to be a one-dimensional array, or possibly use reshape to have the compiler treat it as a one-dimensional array when passing it in as an argument.</div><div><br></div><div><br><div><br><blockquote type="cite"><div>On Aug 10, 2025, at 4:12 AM, kiran hegde <<a href="mailto:kiranhegde75@gmail.com" target="_blank">kiranhegde75@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">Hi,<div>The error highlighted is gone, the path to the include file was wrong. </div><div>The code was developed during petsc-3.9 and it looks like i have to fix many of the petsc call functions.</div><div>There are big changes in post petsc-3.9.</div><div><br></div><div>Currently, the error shifted to another location in the code:</div><div>for the below line i am getting error:</div><div>call VecCreateSeqWithArray(PETSC_COMM_WORLD, nvar, nvar*g%nvl, &<br> s%res(1,1), p%v_res, ierr); CHKERRQ(ierr)<br></div><div><br></div><div>Error: There is no specific subroutine for the generic 'veccreateseqwitharray' at (1)</div><div><br></div><div>Regards,</div><div>Kiran</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 8, 2025 at 6:39 AM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> Please send (cut and paste) all the output of <div><br></div><div> make ex5f (should succeed)</div><div><br></div><div>and</div><div><br></div><div>make "your code"</div><div><br></div><div>we need to see the exact calls for both codes and the exact error message.</div><div><br></div><div><br></div><div><br id="m_8450732158780578758m_-955382105676580027lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 5, 2025, at 12:44 AM, kiran hegde <<a href="mailto:kiranhegde75@gmail.com" target="_blank">kiranhegde75@gmail.com</a>> wrote:</div><br><div><div dir="auto"><div><div>Hi,</div><div dir="auto"><br></div><div dir="auto">Sorry, the tutorial case run succeeded. No errors reported. When i used the makefile file flags in my code, my code is still reported error.</div><div><br></div><div><div dir="ltr">Regards,<br><br>Kiran Hegde<br>Mobile:+91 9972600235<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 5, 2025, 6:11 AM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div><div> "I have tried the options ex5f, but getting the same error."</div><div><br> So you did </div><div><br></div><div> cd src/snes/tutorials/</div><div> make ex5f</div><div><br></div><div> and got some errors? Please cut and paste all the output from make ex5f and sent it here.</div><div><br></div><div><br></div><div><br><blockquote type="cite"><div>On Aug 4, 2025, at 11:15 AM, kiran hegde <<a href="mailto:kiranhegde75@gmail.com" rel="noreferrer" target="_blank">kiranhegde75@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi Satish,</div><div><br></div><div>I have tried the options ex5f, but getting the same error.</div><div>The code was running without any issues long back and I was using petsc ver 3.9 using gcc 12.X.X.</div><div>My makefile flags are :</div><div><br></div><div>FFLAGS = -march=native -O3 -pipe -ffree-form -cpp -ffree-line-length-none \<br> -Wall -Wextra -Wtabs -Wintrinsics-std -Wsurprising -Waliasing \<br> -Wno-unused-parameter -Wno-unused-dummy-argument \<br> -D$(MODEL) \<br> -DVERSION=\"$(GIT_VERSION)\" \<br> -I$(PETSC_DIR)/include<br>FPPFLAGS = -cpp -E -dM -C -P -D$(MODEL)<br>LDFLAGS = -lpetsc -L$(PETSC_DIR)/lib</div><div>LDFLAGS += -Wl,-rpath=$(PETSC_DIR)/lib</div><div><br></div><div>Have i missed anything? </div><div><br></div><div><br></div><div>Regards,</div><div>Kiran</div><div><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 3, 2025 at 9:56 PM Satish Balay <<a href="mailto:balay.anl@fastmail.org" rel="noreferrer" target="_blank">balay.anl@fastmail.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, 3 Aug 2025, kiran hegde wrote:<br>
<br>
> Hi,<br>
> <br>
> Please find the attached configure.log file.<br>
> PETSC installation successfully completes with make check, without any<br>
> error.<br>
> But, when compiling fortan codes with petsc library+include in the<br>
> makefile i get this error.<br>
<br>
Then likely your compile command is missing some options. you can:<br>
<br>
- compile a petsc example - say:<br>
cd src/snes/tutorials<br>
make ex5f<br>
<br>
- now compile your application<br>
<br>
- And compare the compile commands and see if there are any differences (missing options, wrong order of include files etc..)<br>
<br>
Satish<br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Regards,<br><br>Kiran Hegde<br>Mobile:+91 9972600235<br></div></div></div>
</div></blockquote></div><br></div></blockquote></div></div></div>
</div></blockquote></div><br></div></div></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Regards,<br><br>Kiran Hegde<br>Mobile:+91 9972600235<br></div></div></div>
</div></blockquote></div><br></div></div></blockquote></div></div>
</div></blockquote></div><br></body></html>