Skip to content

Commit

Permalink
Remove extra copy of compute_global_grid_integrals
Browse files Browse the repository at this point in the history
  The subroutine compute_global_grid_integrals appeared in both the
MOM_state_initialization and MOM_shared_initialization modules, but was only
being called from the latter.   This commit removes the extra copy in
MOM_state_initialization.  It also removes some unnecessary parentheses in the
copy that is being retained, in part to facilitate the review of this commit.
All answers are bitwise identical, and no publicly visible interfaces are
altered.
  • Loading branch information
Hallberg-NOAA authored and adcroft committed Dec 4, 2024
1 parent 51b4fb6 commit 20888e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
5 changes: 2 additions & 3 deletions src/initialization/MOM_shared_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1327,10 +1327,9 @@ subroutine compute_global_grid_integrals(G, US)
G%areaT_global = reproducing_sum(tmpForSumming)

if (G%areaT_global == 0.0) &
call MOM_error(FATAL, "compute_global_grid_integrals: "//&
"zero ocean area (check topography?)")
call MOM_error(FATAL, "compute_global_grid_integrals: zero ocean area (check topography?)")

G%IareaT_global = 1.0 / (G%areaT_global)
G%IareaT_global = 1.0 / G%areaT_global
end subroutine compute_global_grid_integrals
! -----------------------------------------------------------------------------

Expand Down
20 changes: 0 additions & 20 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2339,26 +2339,6 @@ subroutine set_velocity_depth_max(G)
enddo ; enddo
end subroutine set_velocity_depth_max

!> Subroutine to pre-compute global integrals of grid quantities for
!! later use in reporting diagnostics
subroutine compute_global_grid_integrals(G, US)
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
! Local variables
real, dimension(G%isc:G%iec, G%jsc:G%jec) :: tmpForSumming ! Masked and unscaled areas for sums [m2]
real :: area_scale ! A conversion factor to prepare for reproducing sums [m2 L-2 ~> 1]
integer :: i,j

area_scale = US%L_to_m**2
tmpForSumming(:,:) = 0.
G%areaT_global = 0.0 ; G%IareaT_global = 0.0
do j=G%jsc,G%jec ; do i=G%isc,G%iec
tmpForSumming(i,j) = area_scale*G%areaT(i,j) * G%mask2dT(i,j)
enddo ; enddo
G%areaT_global = reproducing_sum(tmpForSumming)
G%IareaT_global = 1. / (G%areaT_global)
end subroutine compute_global_grid_integrals

!> This subroutine sets the 4 bottom depths at velocity points to be the
!! minimum of the adjacent depths.
subroutine set_velocity_depth_min(G)
Expand Down

0 comments on commit 20888e3

Please sign in to comment.