Skip to content

Commit

Permalink
dOxyGenized MOM_spatial_means.F90
Browse files Browse the repository at this point in the history
  Added dOxyGen comments for all routines and arguments in
MOM_spatial_means.F90.  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed May 7, 2018
1 parent 5490e5a commit ce614c6
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/framework/MOM_spatial_means.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ module MOM_spatial_means

contains

!> Return the global area mean of a variable. This uses reproducing sums.
function global_area_mean(var,G)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
real, dimension(SZI_(G), SZJ_(G)), intent(in) :: var
real, dimension(SZI_(G), SZJ_(G)), intent(in) :: var !< The variable to average
real, dimension(SZI_(G), SZJ_(G)) :: tmpForSumming
real :: global_area_mean

Expand All @@ -40,9 +41,10 @@ function global_area_mean(var,G)

end function global_area_mean

!> Return the global area integral of a variable. This uses reproducing sums.
function global_area_integral(var,G)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
real, dimension(SZI_(G), SZJ_(G)), intent(in) :: var
real, dimension(SZI_(G), SZJ_(G)), intent(in) :: var !< The variable to integrate
real, dimension(SZI_(G), SZJ_(G)) :: tmpForSumming
real :: global_area_integral

Expand All @@ -57,10 +59,11 @@ function global_area_integral(var,G)

end function global_area_integral

!> Return the layerwise global thickness-weighted mean of a variable. This uses reproducing sums.
function global_layer_mean(var, h, G, GV)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: var
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: var !< The variable to average
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2)
real, dimension(SZK_(GV)) :: global_layer_mean

Expand All @@ -86,7 +89,7 @@ function global_layer_mean(var, h, G, GV)

end function global_layer_mean

!> Find the global thickness-weighted mean of a variable.
!> Find the global thickness-weighted mean of a variable. This uses reproducing sums.
function global_volume_mean(var, h, G, GV)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
Expand Down Expand Up @@ -114,7 +117,7 @@ function global_volume_mean(var, h, G, GV)
end function global_volume_mean


!> Find the global mass-weighted integral of a variable
!> Find the global mass-weighted integral of a variable. This uses reproducing sums.
function global_mass_integral(h, G, GV, var, on_PE_only)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
Expand Down Expand Up @@ -158,11 +161,14 @@ function global_mass_integral(h, G, GV, var, on_PE_only)
end function global_mass_integral


!> Determine the global mean of a field along rows of constant i, returning it
!! in a 1-d array using the local indexing. This uses reproducing sums.
subroutine global_i_mean(array, i_mean, G, mask)
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: array
real, dimension(SZJ_(G)), intent(out) :: i_mean
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: mask
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: array !< The variable being averaged
real, dimension(SZJ_(G)), intent(out) :: i_mean !< Global mean of array along its i-axis
real, dimension(SZI_(G),SZJ_(G)), &
optional, intent(in) :: mask !< An array used for weighting the i-mean

! This subroutine determines the global mean of a field along rows of
! constant i, returning it in a 1-d array using the local indexing.
Expand Down Expand Up @@ -236,11 +242,14 @@ subroutine global_i_mean(array, i_mean, G, mask)

end subroutine global_i_mean

!> Determine the global mean of a field along rows of constant j, returning it
!! in a 1-d array using the local indexing. This uses reproducing sums.
subroutine global_j_mean(array, j_mean, G, mask)
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: array
real, dimension(SZI_(G)), intent(out) :: j_mean
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: mask
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: array !< The variable being averaged
real, dimension(SZI_(G)), intent(out) :: j_mean !< Global mean of array along its j-axis
real, dimension(SZI_(G),SZJ_(G)), &
optional, intent(in) :: mask !< An array used for weighting the j-mean

! This subroutine determines the global mean of a field along rows of
! constant j, returning it in a 1-d array using the local indexing.
Expand Down

0 comments on commit ce614c6

Please sign in to comment.