<p><b>dwj07@fsu.edu</b> 2013-03-27 14:36:54 -0600 (Wed, 27 Mar 2013)</p><p><br>
        -- TRUNK COMMIT --<br>
        COMMENTS AND WHITESPACE ONLY.<br>
<br>
        Adding doxygen comments to shared code.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/framework/mpas_attlist.F
===================================================================
--- trunk/mpas/src/framework/mpas_attlist.F        2013-03-27 19:26:14 UTC (rev 2674)
+++ trunk/mpas/src/framework/mpas_attlist.F        2013-03-27 20:36:54 UTC (rev 2675)
@@ -1,3 +1,16 @@
+!***********************************************************************
+!
+! mpas_attlist
+!
+!> \brief MPAS Attribute list module
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This module provides type definitions and subroutines for working with attribute lists.
+!
+!-----------------------------------------------------------------------
+
module mpas_attlist
use mpas_kind_types
@@ -42,15 +55,26 @@
contains
+!***********************************************************************
+!
+! routine mpas_add_att_int0d
+!
+!> \brief MPAS Add 0D integer attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine adds a 0D integer attribute the attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_add_att_int0d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_add_att_int0d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- integer, intent(in) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ integer, intent(in) :: attValue !< Input: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -72,17 +96,28 @@
write(cursor % attName,'(a)') trim(attName)
cursor % attValueInt = attValue
- end subroutine mpas_add_att_int0d
+ end subroutine mpas_add_att_int0d!}}}
+!***********************************************************************
+!
+! routine mpas_add_att_int1d
+!
+!> \brief MPAS Add 1D integer attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine adds a 1D integer attribute the attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_add_att_int1d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_add_att_int1d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- integer, dimension(:), intent(in) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ integer, dimension(:), intent(in) :: attValue !< Input: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -105,17 +140,28 @@
write(cursor % attName,'(a)') trim(attName)
cursor % attValueIntA(:) = attValue(:)
- end subroutine mpas_add_att_int1d
+ end subroutine mpas_add_att_int1d!}}}
+!***********************************************************************
+!
+! routine mpas_add_att_real0d
+!
+!> \brief MPAS Add 0D real attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine adds a 0D real attribute the attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_add_att_real0d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_add_att_real0d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- real (kind=RKIND), intent(in) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ real (kind=RKIND), intent(in) :: attValue !< Input: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -137,17 +183,28 @@
write(cursor % attName,'(a)') trim(attName)
cursor % attValueReal = attValue
- end subroutine mpas_add_att_real0d
+ end subroutine mpas_add_att_real0d!}}}
+!***********************************************************************
+!
+! routine mpas_add_att_real1d
+!
+!> \brief MPAS Add 1D real attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine adds a 1D real attribute the attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_add_att_real1d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_add_att_real1d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- real (kind=RKIND), dimension(:), intent(in) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ real (kind=RKIND), dimension(:), intent(in) :: attValue !< Input: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -170,17 +227,28 @@
write(cursor % attName,'(a)') trim(attName)
cursor % attValueRealA(:) = attValue(:)
- end subroutine mpas_add_att_real1d
+ end subroutine mpas_add_att_real1d!}}}
+!***********************************************************************
+!
+! routine mpas_add_att_text
+!
+!> \brief MPAS Add text attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine adds a text attribute the attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_add_att_text(attList, attName, attValue, ierr)!{{{
- subroutine mpas_add_att_text(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- character (len=*), intent(in) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ character (len=*), intent(in) :: attValue !< Input: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -202,17 +270,28 @@
write(cursor % attName,'(a)') trim(attName)
write(cursor % attValueText,'(a)') trim(attValue)
- end subroutine mpas_add_att_text
+ end subroutine mpas_add_att_text!}}}
+!***********************************************************************
+!
+! routine mpas_get_att_int0d
+!
+!> \brief MPAS get 0D integer attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine returns the attribute value of a 0D integer attribute.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_get_att_int0d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_get_att_int0d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- integer, intent(out) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ integer, intent(out) :: attValue !< Output: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -233,17 +312,28 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_get_att_int0d
+ end subroutine mpas_get_att_int0d!}}}
+!***********************************************************************
+!
+! routine mpas_get_att_int1d
+!
+!> \brief MPAS get 1D integer attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine returns the attribute value of a 1D integer attribute.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_get_att_int1d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_get_att_int1d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- integer, dimension(:), pointer :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ integer, dimension(:), pointer :: attValue !< Output: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -265,17 +355,28 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_get_att_int1d
+ end subroutine mpas_get_att_int1d!}}}
+!***********************************************************************
+!
+! routine mpas_get_att_real0d
+!
+!> \brief MPAS get 0D real attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine returns the attribute value of a 0D real attribute.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_get_att_real0d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_get_att_real0d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- real (kind=RKIND), intent(out) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ real (kind=RKIND), intent(out) :: attValue !< Output: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -296,17 +397,28 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_get_att_real0d
+ end subroutine mpas_get_att_real0d!}}}
+!***********************************************************************
+!
+! routine mpas_get_att_real1d
+!
+!> \brief MPAS get 1D real attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine returns the attribute value of a 1D real attribute.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_get_att_real1d(attList, attName, attValue, ierr)!{{{
- subroutine mpas_get_att_real1d(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- real (kind=RKIND), dimension(:), pointer :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ real (kind=RKIND), dimension(:), pointer :: attValue !< Output: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -328,17 +440,28 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_get_att_real1d
+ end subroutine mpas_get_att_real1d!}}}
+!***********************************************************************
+!
+! routine mpas_get_att_text
+!
+!> \brief MPAS get text attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine returns the attribute value of a text attribute.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_get_att_text(attList, attName, attValue, ierr)!{{{
- subroutine mpas_get_att_text(attList, attName, attValue, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- character (len=*), intent(out) :: attValue
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ character (len=*), intent(out) :: attValue !< Output: Attribute value
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -359,16 +482,27 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_get_att_text
+ end subroutine mpas_get_att_text!}}}
+!***********************************************************************
+!
+! routine mpas_remove_att
+!
+!> \brief MPAS remove attribute routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine removes an attribute from an attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_remove_att(attList, attName, ierr)!{{{
- subroutine mpas_remove_att(attList, attName, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- character (len=*), intent(in) :: attName
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ character (len=*), intent(in) :: attName !< Input: Attribute name
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor, cursor_prev
@@ -410,15 +544,26 @@
if (present(ierr)) ierr = 1 ! Not found
- end subroutine mpas_remove_att
+ end subroutine mpas_remove_att!}}}
+!***********************************************************************
+!
+! routine mpas_deallocate_attlist
+!
+!> \brief MPAS attribute list deallocation routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine deallocates an attribute list.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_deallocate_attlist(attList, ierr)!{{{
- subroutine mpas_deallocate_attlist(attList, ierr)
-
implicit none
- type (att_list_type), pointer :: attList
- integer, intent(out), optional :: ierr
+ type (att_list_type), pointer :: attList !< Input/Output: Attribute list
+ integer, intent(out), optional :: ierr !< Output: Error flag
type (att_list_type), pointer :: cursor
@@ -436,6 +581,6 @@
cursor => attList
end do
- end subroutine mpas_deallocate_attlist
+ end subroutine mpas_deallocate_attlist!}}}
end module mpas_attlist
Modified: trunk/mpas/src/framework/mpas_hash.F
===================================================================
--- trunk/mpas/src/framework/mpas_hash.F        2013-03-27 19:26:14 UTC (rev 2674)
+++ trunk/mpas/src/framework/mpas_hash.F        2013-03-27 20:36:54 UTC (rev 2675)
@@ -1,14 +1,19 @@
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! MODULE HASH
+!***********************************************************************
!
-! Purpose: This module provides a dictionary/hashtable with insert, search, and
-! remove routines.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! mpas_hash
+!
+!> \brief MPAS Hash table module
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This module provides A dictionary/hashtable with insert, search, and remove routines.
+!
+!-----------------------------------------------------------------------
module mpas_hash
! Parameters
- integer, parameter :: TABLESIZE=27183 ! Number of spaces in the table (the
- ! number of linked lists)
+ integer, parameter :: TABLESIZE=27183 !< Number of spaces in the table (the number of linked lists)
type hashnode
integer :: key
@@ -16,29 +21,35 @@
end type hashnode
type hashnode_ptr
- type (hashnode), pointer :: p ! Pointer to a list of entries
+ type (hashnode), pointer :: p !< Pointer to a list of entries
end type hashnode_ptr
type hashtable
integer :: size
- type (hashnode_ptr), dimension(TABLESIZE) :: table ! The hashtable array
+ type (hashnode_ptr), dimension(TABLESIZE) :: table !< The hashtable array
end type hashtable
contains
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ! Name: hash_init
- !
- ! Purpose: To initialize a hashtable
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- subroutine mpas_hash_init(h)
+!***********************************************************************
+!
+! routine mpas_hash_init
+!
+!> \brief MPAS Hash table init routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine initializes a hashtable.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_hash_init(h)!{{{
implicit none
! Arguments
- type (hashtable), intent(inout) :: h
+ type (hashtable), intent(inout) :: h !< Input/Output: Hash table
! Local variables
integer :: i
@@ -49,25 +60,29 @@
nullify(h%table(i)%p)
end do
- end subroutine mpas_hash_init
+ end subroutine mpas_hash_init!}}}
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ! Name: hash_insert
- !
- ! Purpose: Given a hashtable h and a key to be inserted into the hashtable,
- ! this routine adds key to the table.
- !
- ! NOTE: If the key already exists in the table, a second copy of the
- ! key is added to the table
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- subroutine mpas_hash_insert(h, key)
+!***********************************************************************
+!
+! routine mpas_hash_insert
+!
+!> \brief MPAS Hash table insert routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine inserts a key into a hashtable. If the key already exists in the hash table,
+!> a second copy of the key is added to the table.
+!
+!-----------------------------------------------------------------------
+ subroutine mpas_hash_insert(h, key)!{{{
implicit none
! Arguments
- integer, intent(in) :: key
- type (hashtable), intent(inout) :: h
+ integer, intent(in) :: key !< Input: Key
+ type (hashtable), intent(inout) :: h !< Input/Output: Hashtable
! Local variables
integer :: hashval, i
@@ -82,22 +97,27 @@
h%size = h%size + 1
- end subroutine mpas_hash_insert
+ end subroutine mpas_hash_insert!}}}
-
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ! Name: hash_search
- !
- ! Purpose: This function returns TRUE if the specified key was found in the
- ! hashtable h, and FALSE otherwise.
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- logical function mpas_hash_search(h, key)
+!***********************************************************************
+!
+! logical function mpas_hash_search
+!
+!> \brief MPAS Hash table search routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This function searches for a key within a hashtable. If the key is found TRUE is returned, and FALSE is return otherwise.
+!
+!-----------------------------------------------------------------------
+ logical function mpas_hash_search(h, key)!{{{
implicit none
! Arguments
- integer, intent(in) :: key
- type (hashtable), intent(inout) :: h
+ integer, intent(in) :: key !< Input: Key
+ type (hashtable), intent(inout) :: h !< Input/Output: Hashtable
! Local variables
integer :: hashval, i
@@ -170,6 +190,6 @@
h%size = 0
- end subroutine mpas_hash_destroy
+ end subroutine mpas_hash_destroy!}}}
end module mpas_hash
Modified: trunk/mpas/src/framework/mpas_kind_types.F
===================================================================
--- trunk/mpas/src/framework/mpas_kind_types.F        2013-03-27 19:26:14 UTC (rev 2674)
+++ trunk/mpas/src/framework/mpas_kind_types.F        2013-03-27 20:36:54 UTC (rev 2675)
@@ -1,3 +1,16 @@
+!***********************************************************************
+!
+! mpas_kind_types
+!
+!> \brief MPAS Kind definition module
+!> \author Michael Duda, Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This module defines the kind types for basic fortran data types within MPAS.
+!
+!-----------------------------------------------------------------------
+
module mpas_kind_types
#ifdef SINGLE_PRECISION
@@ -10,6 +23,18 @@
contains
+!***********************************************************************
+!
+! routine dummy_kinds
+!
+!> \brief MPAS Dummy kind routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This is a dummy routine that doesn't do anything.
+!
+!-----------------------------------------------------------------------
subroutine dummy_kinds()
end subroutine dummy_kinds
Modified: trunk/mpas/src/framework/mpas_sort.F
===================================================================
--- trunk/mpas/src/framework/mpas_sort.F        2013-03-27 19:26:14 UTC (rev 2674)
+++ trunk/mpas/src/framework/mpas_sort.F        2013-03-27 20:36:54 UTC (rev 2675)
@@ -1,3 +1,16 @@
+!***********************************************************************
+!
+! mpas_sort
+!
+!> \brief MPAS Sort and search module
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This module provides routines for various sorting methods, in addition to a binary search.
+!
+!-----------------------------------------------------------------------
+
module mpas_sort
use mpas_kind_types
@@ -11,13 +24,27 @@
contains
+!***********************************************************************
+!
+! recursive routine mpas_mergesort
+!
+!> \brief MPAS Merge sort
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine recursively calls itself to perform a merge sort on array.
+!
+!-----------------------------------------------------------------------
recursive subroutine mpas_mergesort(array, d1, n1, n2)!{{{
implicit none
! Arguments
- integer, intent(in) :: n1, n2, d1
- integer, dimension(1:d1,n1:n2), intent(inout) :: array
+ integer, intent(in) :: d1 !< Input: Size of first dimension of array
+ integer, intent(in) :: n1 !< Input: Beginning of second dimension of array
+ integer, intent(in) :: n2 !< Input: Ending of second dimension of array
+ integer, dimension(1:d1,n1:n2), intent(inout) :: array !< Input/Output: Array to be sorted (in-place)
! Local variables
integer :: i, j, k
@@ -73,12 +100,24 @@
end subroutine mpas_mergesort!}}}
+!***********************************************************************
+!
+! routine mpas_quicksort_1dint
+!
+!> \brief MPAS 1D integer quicksort
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine performs a quicksort on a 1D integer array
+!
+!-----------------------------------------------------------------------
subroutine mpas_quicksort_1dint(nArray, array)!{{{
implicit none
- integer, intent(in) :: nArray
- integer, dimension(nArray), intent(inout) :: array
+ integer, intent(in) :: nArray !< Input: Array size
+ integer, dimension(nArray), intent(inout) :: array !< Input/Output: Array to be sorted
integer :: i, j, top, l, r, pivot, s
integer :: pivot_value
@@ -135,12 +174,24 @@
end subroutine mpas_quicksort_1dint!}}}
+!***********************************************************************
+!
+! routine mpas_quicksort_1dreal
+!
+!> \brief MPAS 1D real quicksort
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine performs a quicksort on a 1D real array
+!
+!-----------------------------------------------------------------------
subroutine mpas_quicksort_1dreal(nArray, array)!{{{
implicit none
- integer, intent(in) :: nArray
- real (kind=RKIND), dimension(nArray), intent(inout) :: array
+ integer, intent(in) :: nArray !< Input: Array size
+ real (kind=RKIND), dimension(nArray), intent(inout) :: array !< Input/Output: Array to be sorted
integer :: i, j, top, l, r, pivot, s
real (kind=RKIND) :: pivot_value
@@ -197,12 +248,24 @@
end subroutine mpas_quicksort_1dreal!}}}
+!***********************************************************************
+!
+! routine mpas_quicksort_2dint
+!
+!> \brief MPAS 2D integer quicksort
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine performs a quicksort on a 2D integer array
+!
+!-----------------------------------------------------------------------
subroutine mpas_quicksort_2dint(nArray, array)!{{{
implicit none
- integer, intent(in) :: nArray
- integer, dimension(2,nArray), intent(inout) :: array
+ integer, intent(in) :: nArray !< Input: Array size
+ integer, dimension(2,nArray), intent(inout) :: array !< Input/Output: Array to be sorted
integer :: i, j, top, l, r, pivot, s
integer :: pivot_value
@@ -259,12 +322,24 @@
end subroutine mpas_quicksort_2dint!}}}
+!***********************************************************************
+!
+! routine mpas_quicksort_2dreal
+!
+!> \brief MPAS 2D real quicksort
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine performs a quicksort on a 2D real array
+!
+!-----------------------------------------------------------------------
subroutine mpas_quicksort_2dreal(nArray, array)!{{{
implicit none
- integer, intent(in) :: nArray
- real (kind=RKIND), dimension(2,nArray), intent(inout) :: array
+ integer, intent(in) :: nArray !< Input: Array size
+ real (kind=RKIND), dimension(2,nArray), intent(inout) :: array !< Input/Output: Array to be sorted
integer :: i, j, top, l, r, pivot, s
real (kind=RKIND) :: pivot_value
@@ -321,6 +396,18 @@
end subroutine mpas_quicksort_2dreal!}}}
+!***********************************************************************
+!
+! integer function mpas_binary_search
+!
+!> \brief MPAS Binary search routine
+!> \author Michael Duda
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine performs a binary search in array for the key. It either returns the index of the key within array, or n2+1 if the key is not found.
+!
+!-----------------------------------------------------------------------
integer function mpas_binary_search(array, d1, n1, n2, key)!{{{
implicit none
Modified: trunk/mpas/src/framework/mpas_timer.F
===================================================================
--- trunk/mpas/src/framework/mpas_timer.F        2013-03-27 19:26:14 UTC (rev 2674)
+++ trunk/mpas/src/framework/mpas_timer.F        2013-03-27 20:36:54 UTC (rev 2675)
@@ -1,3 +1,17 @@
+!***********************************************************************
+!
+! mpas_timer
+!
+!> \brief MPAS Timer module
+!> \author Michael Duda, Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This module provides developers with internal timer routines. These can be
+!> use to profile various parts of code within MPAS. Calls to TAU happen in this module as well
+!> to provide more detailed profiling.
+!
+!-----------------------------------------------------------------------
module mpas_timer
use mpas_kind_types
@@ -32,6 +46,19 @@
contains
+!***********************************************************************
+!
+! routine mpas_timer_start
+!
+!> \brief MPAS Timer start routine
+!> \author Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine starts a timer. By default, timer_name is searched for in the linked list of timers.
+!> If timer_ptr is provided, the search doesn't happen and the pointer to the timer is used (or allocated if not created yet).
+!
+!-----------------------------------------------------------------------
subroutine mpas_timer_start(timer_name, clear_timer, timer_ptr)!{{{
# ifdef _MPI
use mpi
@@ -161,6 +188,19 @@
end subroutine mpas_timer_start!}}}
+!***********************************************************************
+!
+! routine mpas_timer_stop
+!
+!> \brief MPAS Timer stop routine
+!> \author Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine stops a timer. By default, timer_name is searched for in the linked list of timers.
+!> If timer_ptr is provided, the search doesn't happen and the pointer to the timer is used.
+!
+!-----------------------------------------------------------------------
subroutine mpas_timer_stop(timer_name, timer_ptr)!{{{
# ifdef _MPI
use mpi
@@ -238,9 +278,23 @@
end subroutine mpas_timer_stop!}}}
+!***********************************************************************
+!
+! recursive routine mpas_timer_write
+!
+!> \brief MPAS Timer write routine
+!> \author Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine writes all timer output to stdout. It recursively calls
+!> itself until all timers have been written out. Prior to writing timers,
+!> this routine calls mpas_timer_sync.
+!
+!-----------------------------------------------------------------------
recursive subroutine mpas_timer_write(timer_ptr, total_ptr)!{{{
- type (timer_node), pointer, optional :: timer_ptr
- type (timer_node), pointer, optional :: total_ptr
+ type (timer_node), pointer, optional :: timer_ptr !< Input - Optional: Pointer to a specific timer to write out.
+ type (timer_node), pointer, optional :: total_ptr !< Input - Optional: Pointer to the total_time timer.
character (len=StrKIND) :: tname
logical :: total_found, string_equals
@@ -312,8 +366,20 @@
end subroutine mpas_timer_write!}}}
+!***********************************************************************
+!
+! routine mpas_timer_init
+!
+!> \brief MPAS Timer init routine
+!> \author Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine initializes the mpas_timer setup. It needs to have access to the dminfo object in order to sync timers.
+!
+!-----------------------------------------------------------------------
subroutine mpas_timer_init(domain)!{{{
- type (domain_type), intent(in), optional :: domain
+ type (domain_type), intent(in), optional :: domain !< Input - Optional: Domain structure
if( present(domain) ) then
domain_info => domain % dminfo
@@ -323,6 +389,19 @@
end subroutine mpas_timer_init!}}}
+!***********************************************************************
+!
+! routine mpas_timer_sync
+!
+!> \brief MPAS Timer sync routine
+!> \author Doug Jacobsen
+!> \date 03/27/13
+!> \version SVN:$Id$
+!> \details
+!> This routine synchronizes timers across all processors in order to better represent
+!> the entire run domain with the timer output.
+!
+!-----------------------------------------------------------------------
subroutine mpas_timer_sync()!{{{
use mpas_dmpar
</font>
</pre>