Hi Michael,<div><br></div><div>Thanks for putting these together. I don&#39;t have any issues with using this setup.</div><div><br></div><div>If no one else has any input on this topic I&#39;ll commit these two Makefiles before the merge.</div>

<div><br></div><div>Thanks!</div><div>Doug</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 3:03 PM, Michael Duda <span dir="ltr">&lt;<a href="mailto:duda@ucar.edu" target="_blank">duda@ucar.edu</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Doug.<br>
<br>
Attached is an example of what I had in mind.  The Makefile and<br>
Makefile.in.CESM_OCN files contain very little overlap, which should<br>
relieve most of the burden of applying changes in multiple places.<br>
In general, I&#39;m not sure we can ever escape the need for updating other<br>
files when one changes; for example, when changing the interfaces in a<br>
module, one necessarily has to update all other code that depends on<br>
that module interface.  However, I do appreciate that it would be much<br>
more difficult for developers to ensure that changes to the Makefile<br>
won&#39;t break the CESM build of MPAS-O.  We can also hope that at least<br>
one person will catch such problems at the time the changes are proposed<br>
for inclusion in the trunk.<br>
<br>
I think having Makefiles that are as transparent as possible (without<br>
multiple layers of &quot;ifeq&quot; statements to mentally apply) should reduce<br>
the chances of mistakes overall, especially when adding in changes for<br>
MPAS-A and CAM.<br>
<br>
Sticking with CESM, rather than COUPLED, would be fine for us,<br>
especially with include files used as in the attached makefiles.<br>
<br>
Of course, I&#39;m open to other suggestions for dealing with different<br>
builds of MPAS-O and MPAS-A (stand-alone and coupled) from the same<br>
source.<br>
<br>
Regards,<br>
Michael<br>
<div><div><br>
<br>
On Tue, Dec 04, 2012 at 12:23:41PM -0700, Doug Jacobsen wrote:<br>
&gt; Hey Michael,<br>
&gt;<br>
&gt; Just to clarify. Do you want to have a copy of the entire makefile in<br>
&gt; Makefile.in.CESM_OCN, just without the ifeq&#39;s for CESM?<br>
&gt;<br>
&gt; The only problem I would have with this is the amount of effort to maintain<br>
&gt; all of the makefile we would need. Even with two, I think it&#39;s going to be<br>
&gt; difficult for developers to remember to updated both Makefile and<br>
&gt; Makefile.in.CESM_OCN when they make some change to Makefile.<br>
&gt;<br>
&gt; Other than that issue, I don&#39;t see a reason that it couldn&#39;t happen like<br>
&gt; that. I don&#39;t really have a strong preference either way.<br>
&gt;<br>
&gt; With regards to working with CAM, would you guys prefer to have the flag be<br>
&gt; COUPLED rather than CESM?<br>
&gt;<br>
&gt; Thanks for the comments,<br>
&gt; Doug<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Dec 4, 2012 at 12:04 PM, Michael Duda &lt;<a href="mailto:duda@ucar.edu" target="_blank">duda@ucar.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi, Doug.<br>
&gt; &gt;<br>
&gt; &gt; Since this will affect everyone, including our work here to implement<br>
&gt; &gt; MPAS-A as a dynamical core in CAM, I thought I&#39;d bring this up with the<br>
&gt; &gt; larger group.  The Makefile in the src directory (i.e., src/Makefile) of<br>
&gt; &gt; the branch is looking a bit tangled to me with all of the &quot;ifeq&quot;<br>
&gt; &gt; statements.  As a potential solution, I&#39;m wondering whether we could<br>
&gt; &gt; make use of include files, so src/Makefile looks something like:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ifeq &quot;$(CESM)&quot; &quot;true&quot;<br>
&gt; &gt;<br>
&gt; &gt; include Makefile.in.CESM_OCN<br>
&gt; &gt;<br>
&gt; &gt; else<br>
&gt; &gt;<br>
&gt; &gt;    #<br>
&gt; &gt;    # Current contents of the Makefile<br>
&gt; &gt;    #<br>
&gt; &gt;<br>
&gt; &gt; endif<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; This would allow us the flexibility to do whatever we need to for MPAS-O<br>
&gt; &gt; and MPAS-A, while still keeping the Makefile for a stand-alone build<br>
&gt; &gt; looking clean. I&#39;d imagined that, when building the MPAS-A dycore within<br>
&gt; &gt; CAM, we could add a little extra logic:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ifeq &quot;$(CESM)&quot; &quot;true&quot;<br>
&gt; &gt;<br>
&gt; &gt; ifeq &quot;$(CORE)&quot; &quot;ocean&quot;<br>
&gt; &gt; include Makefile.in.CESM_OCN<br>
&gt; &gt; endif<br>
&gt; &gt;<br>
&gt; &gt; ifeq &quot;$(CORE)&quot; &quot;nhyd_atmos&quot;<br>
&gt; &gt; include Makefile.in.CESM_ATM<br>
&gt; &gt; endif<br>
&gt; &gt;<br>
&gt; &gt; else<br>
&gt; &gt;<br>
&gt; &gt;    #<br>
&gt; &gt;    # Current contents of the Makefile<br>
&gt; &gt;    #<br>
&gt; &gt;<br>
&gt; &gt; endif<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Does this sound like a potentially viable approach? I think that<br>
&gt; &gt; splitting out the specifics for CESM and CAM builds could make it easier<br>
&gt; &gt; for other developers (and future users, potentially) to follow the build<br>
&gt; &gt; sequence and dependencies.<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Michael<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Mon, Dec 03, 2012 at 01:25:19PM -0700, Doug Jacobsen wrote:<br>
&gt; &gt; &gt; Hello All,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have been working recently on coupling MPAS-O to CESM. I currently have<br>
&gt; &gt; &gt; it setup to where MPAS build&#39;s in a suitable method for CESM, and the<br>
&gt; &gt; Ocean<br>
&gt; &gt; &gt; model can run within CESM (without being forced).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Several changes were made that were needed to be able to have MPAS build<br>
&gt; &gt; &gt; properly for inclusion in to CESM. I want to merge the branch I have been<br>
&gt; &gt; &gt; working under to the trunk before putting more work on the forcing side.<br>
&gt; &gt; &gt; This way, we have a checkpoint on the trunk of a working version of MPAS<br>
&gt; &gt; &gt; with the CESM.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Also, I think I won&#39;t need to make any more changes to the shared areas<br>
&gt; &gt; of<br>
&gt; &gt; &gt; MPAS after this commit.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The branch in question is branches/ocean_projects/cesm_coupling. I&#39;ll<br>
&gt; &gt; &gt; commit it on Wednesday if I don&#39;t hear anything about it, but any<br>
&gt; &gt; questions<br>
&gt; &gt; &gt; or comments are welcome.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks!<br>
&gt; &gt; &gt; Doug<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; mpas-developers mailing list<br>
&gt; &gt; &gt; <a href="mailto:mpas-developers@mailman.ucar.edu" target="_blank">mpas-developers@mailman.ucar.edu</a><br>
&gt; &gt; &gt; <a href="http://mailman.ucar.edu/mailman/listinfo/mpas-developers" target="_blank">http://mailman.ucar.edu/mailman/listinfo/mpas-developers</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
</div></div></blockquote></div><br></div>