<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks Jason, and also Suoqing Ji for helpful answers. It worked by just adding</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">VARIABLE XYZ</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">to my Config file in the unit in question. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Note for others: by using the above statement then, in the Fortran routine, statements that say</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">#ifdef XYZ_VAR</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"> do something</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">#endif</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">will be executed - the declaration in the Config file is XYZ whereas in the Fortran code the ifdef test is on XYZ_VAR. By putting that VARIABLE statement in the Config file the Flash.h file gets a statement:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">#define XYZ_VAR N</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">where N is some number in the sequence of variables stored in the solnData array.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Jon</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 11, 2017 at 4:25 PM, Jason Galyardt <span dir="ltr"><<a href="mailto:jason.galyardt@gmail.com" target="_blank">jason.galyardt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Jon,<br><br></div>For macros that are used exclusively in a single unit, the best way to do this (in my opinion) is to create a header file within that unit's directory structure, define that macro in the header file, and then #include that header in the appropriate source file within that unit. <br><br>However, you seem to be looking at a solution array variable, which requires special care. These are all #defined in Flash.h automagically by the 'setup' command, using the Config files associated with the included FLASH units (Simulation, Grid, etc.). So, if you find that XYZ_VAR is not defined in Flash.h after you have run the 'setup' command, you should first look into whether you're missing a FLASH unit (or sub-unit) in your Simulation Config file. If you're sure that you're not missing the unit that defines and uses XYZ_VAR, you can define it in the appropriate Config file via a VARIABLE statement (<a href="http://flash.uchicago.edu/site/flashcode/user_support/flash4_ug_4p4/node44.html" target="_blank">here's an example</a>, and <a href="http://flash.uchicago.edu/site/flashcode/user_support/flash4_ug_4p4/node34.html" target="_blank">here's the syntax documentation</a>).<br><br></div>Cheers,<br></div>Jason<br><div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 11, 2017 at 3:55 PM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Hi,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I'm trying to debug some user contributed code that I modified. In that code there a line like:</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">#ifdef XYZ_VAR</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"> solnData(XYZ_VAR,x,y,z) = ...</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">#endif</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">So my question is, how should one define some variable XYZ_VAR? In the Config file? It seems not like an ordinary variable definition since it's associated with the definition of solnData. Any help would be appreciated.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Regards,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Jon </div><span class="m_-9163695650028011491HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-9163695650028011491m_5198213022455036982gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a> 60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a> Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a> USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">________________________________________________________<br>Jonathan D. Slavin Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a> 60 Garden Street, MS 83<br>phone: (617) 496-7981 Cambridge, MA 02138-1516<br>cell: (781) 363-0035 USA<br>________________________________________________________<br><br></div></div></div></div>
</div></div>