Mark and Michael,<div><br></div><div>Thanks for the comments. Here is an updated version of the code with the loop split into two loops, each with it&#39;s own logical surrounding it.</div><div><br></div><div>Please let me know if there are any more comments. Thanks again!</div>

<div><br></div><div>Doug<br><br><div class="gmail_quote">On Tue, Jan 25, 2011 at 12:42 PM, Mark Petersen <span dir="ltr">&lt;<a href="mailto:mpetersen@lanl.gov">mpetersen@lanl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Doug,<br>
<br>
Thanks for taking the time to commit this.  I also need to use wind stress and bottom drag in the sw core, so this is perfect.<br>
<br>
I would go a step further and separate the loops to avoid ifs within dos:<br>
<br>
    if(config_wind_stress) then<br>
        do iEdge=1,grid % nEdges<br>
        ...<br>
    endif<br>
<br>
    if (config_bottom_drag) then<br>
        do iEdge=1,grid % nEdges<br>
        ...<br>
    endif<br>
<br>
I think branches within loops are a greater efficiency hit than multiple loops, but it depends on how smart the compiler is.<br>
<br>
As for c, I copied the bottom drag from POP.  The manual says, &quot;The dimensionless constant c is typically chosen to be of order 10^{-3}&quot;. This is definitely one of those tunable parameters set based on experience.<br>

<font color="#888888">
<br>
Mark</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
On Mon, 24 Jan 2011, Michael Duda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, Doug.<br>
<br>
Overall, the changes look good to me. As a performance improvement, though,<br>
you could add an if-test around the new block of code at line 503 in<br>
module_time_integration.F to prevent the edge loop from iterating if neither<br>
of the new options are active, e.g.,<br>
<br>
     if (config_wind_stress .or. config_bottom_drag) then<br>
        ...<br>
     end if<br>
<br>
Also, I was wondering where the 1.0e-3 constant at line 518 comes from; is<br>
this just the inverse of rho_ref?<br>
<br>
Cheers!<br>
Michael<br>
<br>
<br>
On Fri, Jan 21, 2011 at 04:48:32PM -0500, Doug Jacobsen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Everyone,<br>
<br>
I am adding Wind Stress forcing and Bottom Drag to the Shallow water core.<br>
They are implemented in the same fashion as the Ocean core. I have added<br>
logicals to the namelist that allow the user to selectively turn each on or<br>
off for a run. Please let me know if anyone has any comments, I will commit<br>
these at the latest on Wednesday unless there are any objections.<br>
<br>
Doug<br>
</blockquote>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
mpas-developers mailing list<br>
<a href="mailto:mpas-developers@mailman.ucar.edu" target="_blank">mpas-developers@mailman.ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/mpas-developers" target="_blank">http://mailman.ucar.edu/mailman/listinfo/mpas-developers</a><br>
</blockquote>
<br>
_______________________________________________<br>
mpas-developers mailing list<br>
<a href="mailto:mpas-developers@mailman.ucar.edu" target="_blank">mpas-developers@mailman.ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/mpas-developers" target="_blank">http://mailman.ucar.edu/mailman/listinfo/mpas-developers</a><br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>