<p><b>duda</b> 2012-10-25 17:36:34 -0600 (Thu, 25 Oct 2012)</p><p>BRANCH COMMIT<br>
<br>
A few minor changes to improve performance for large meshes:<br>
<br>
-- Increase hash table size -- we should find a way to dynamically size this in future<br>
<br>
-- Perform check in quicksort routines for already-sorted input <br>
<br>
<br>
M src/framework/mpas_hash.F<br>
M src/framework/mpas_sort.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/framework/mpas_hash.F
===================================================================
--- branches/atmos_physics/src/framework/mpas_hash.F        2012-10-25 22:41:11 UTC (rev 2271)
+++ branches/atmos_physics/src/framework/mpas_hash.F        2012-10-25 23:36:34 UTC (rev 2272)
@@ -7,8 +7,8 @@
module mpas_hash
! Parameters
- integer, parameter :: TABLESIZE=27183 ! Number of spaces in the table (the
- ! number of linked lists)
+ integer, parameter :: TABLESIZE=6000000 ! Number of spaces in the table (the
+ ! number of linked lists)
type hashnode
integer :: key
Modified: branches/atmos_physics/src/framework/mpas_sort.F
===================================================================
--- branches/atmos_physics/src/framework/mpas_sort.F        2012-10-25 22:41:11 UTC (rev 2271)
+++ branches/atmos_physics/src/framework/mpas_sort.F        2012-10-25 23:36:34 UTC (rev 2272)
@@ -88,6 +88,12 @@
if (nArray < 1) return
+ ! Do a quick check to see if the array is already sorted
+ do i=2,nArray
+ if (array(1,i) < array(1,i-1)) exit
+ end do
+ if (i == nArray+1) return
+
top = 1
lstack(top) = 1
rstack(top) = nArray
@@ -155,6 +161,12 @@
lstack(top) = 1
rstack(top) = nArray
+ ! Do a quick check to see if the array is already sorted
+ do i=2,nArray
+ if (array(1,i) < array(1,i-1)) exit
+ end do
+ if (i == nArray+1) return
+
do while (top > 0)
l = lstack(top)
</font>
</pre>