<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> You would use <span style="color: rgb(180, 36, 25); font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;"><b>PETSC_NULL_DM</b></span><span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">LABEL but Matt needs to customize the PETSc Fortran stub for DMAddField() for you to handle accepting the NULL from PETSc.</span><div><font face="Menlo"><span style="font-size: 14px;"><br></span></font></div><div><font face="Menlo"><span style="font-size: 14px;"> Barry</span></font></div><div><font face="Menlo"><span style="font-size: 14px;"><br></span></font></div><div><font face="Menlo"><span style="font-size: 14px;"><br></span></font><div><font face="Menlo"><span style="font-size: 14px;"><br></span></font></div><div><font face="Menlo"><span style="font-size: 14px;"><br></span></font><div><br><blockquote type="cite"><div>On Dec 8, 2022, at 1:05 PM, Nicholas Arnold-Medabalimi <narnoldm@umich.edu> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Hi Petsc Users<br><br>I am trying to use DMAddField in a Fortran code. I had some questions on casting/passing NULL. I follow how to pass NULL for standard types (INT, CHAR, etc). <br><br>Is there a method/best practice for passing NULL for Petsc type arguments? (In this case DMAddLabel I'd want to pass NULL to a DMLabel Parameter not an intrinsic type)<br><br>For the 2nd question, In some cases in C we would cast a more specific object to Petsc Object <br>DMAddField(dm, NULL, (PetscObject)fvm); (where fvm is a PetscFVM type)<br>Is there a method or practice to do the same in Fortran.<br><br>Thanks<br>Nicholas<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font>Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></body></html>