Skip to content

Commit

Permalink
+Remove rescale_grid_bathymetry
Browse files Browse the repository at this point in the history
  Removed the unused routine rescale_grid_bathymetry.  This routine was added in
August 2018 as a part of the development of the depth unit conversion and
dimensional consistency testing, but it is no longer being called now that this
conversion is essentially complete (and it has not been called by the code in
several years).  For the original commit that first added this code, see
github.com/mom-ocean/MOM6/commit/ddc9ed1c33a1b7357b213929118ecaa19ae63f9f.  All
answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Oct 12, 2023
1 parent 6bc72a4 commit e25b2c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module MOM
use MOM_forcing_type, only : copy_common_forcing_fields, set_derived_forcing_fields
use MOM_forcing_type, only : homogenize_forcing, homogenize_mech_forcing
use MOM_grid, only : ocean_grid_type, MOM_grid_init, MOM_grid_end
use MOM_grid, only : set_first_direction, rescale_grid_bathymetry
use MOM_grid, only : set_first_direction
use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_hor_index, only : rotate_hor_index
use MOM_interface_heights, only : find_eta, calc_derived_thermo, thickness_to_dz
Expand Down
36 changes: 1 addition & 35 deletions src/core/MOM_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module MOM_grid
#include <MOM_memory.h>

public MOM_grid_init, MOM_grid_end, set_derived_metrics, set_first_direction
public isPointInCell, hor_index_type, get_global_grid_size, rescale_grid_bathymetry
public isPointInCell, hor_index_type, get_global_grid_size

! A note on unit descriptions in comments: MOM6 uses units that can be rescaled for dimensional
! consistency testing. These are noted in comments with units like Z, H, L, and T, along with
Expand Down Expand Up @@ -400,40 +400,6 @@ subroutine MOM_grid_init(G, param_file, US, HI, global_indexing, bathymetry_at_v

end subroutine MOM_grid_init

!> rescale_grid_bathymetry permits a change in the internal units for the bathymetry on the grid,
!! both rescaling the depths and recording the new internal units.
subroutine rescale_grid_bathymetry(G, m_in_new_units)
type(ocean_grid_type), intent(inout) :: G !< The horizontal grid structure
real, intent(in) :: m_in_new_units !< The new internal representation of 1 m depth.
!### It appears that this routine is never called.

! Local variables
real :: rescale ! A unit rescaling factor [various combinations of units ~> 1]
integer :: i, j, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB

isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB

if (m_in_new_units == 1.0) return
if (m_in_new_units < 0.0) &
call MOM_error(FATAL, "rescale_grid_bathymetry: Negative depth units are not permitted.")
if (m_in_new_units == 0.0) &
call MOM_error(FATAL, "rescale_grid_bathymetry: Zero depth units are not permitted.")

rescale = 1.0 / m_in_new_units
do j=jsd,jed ; do i=isd,ied
G%bathyT(i,j) = rescale*G%bathyT(i,j)
enddo ; enddo
if (G%bathymetry_at_vel) then ; do j=jsd,jed ; do I=IsdB,IedB
G%Dblock_u(I,j) = rescale*G%Dblock_u(I,j) ; G%Dopen_u(I,j) = rescale*G%Dopen_u(I,j)
enddo ; enddo ; endif
if (G%bathymetry_at_vel) then ; do J=JsdB,JedB ; do i=isd,ied
G%Dblock_v(i,J) = rescale*G%Dblock_v(i,J) ; G%Dopen_v(i,J) = rescale*G%Dopen_v(i,J)
enddo ; enddo ; endif
G%max_depth = rescale*G%max_depth

end subroutine rescale_grid_bathymetry

!> set_derived_metrics calculates metric terms that are derived from other metrics.
subroutine set_derived_metrics(G, US)
type(ocean_grid_type), intent(inout) :: G !< The horizontal grid structure
Expand Down

0 comments on commit e25b2c1

Please sign in to comment.