Skip to content

Commit

Permalink
Cleaned up MOM_remapping to reduce compiler warnings
Browse files Browse the repository at this point in the history
- Addressed compiler warnings about unused variables and
  argument intent.
- Note there is one dummy argument that was unused and the best way
  to address the warnings was to remove the argument, i.e. and API change.
  This was only in a debugging/utility function so does not impact the
  rest of the model.
  • Loading branch information
adcroft committed Mar 12, 2024
1 parent 0bd4c16 commit b46638e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/ALE/MOM_remapping.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ module MOM_remapping
integer, parameter :: INTEGRATION_PPM = 3 !< Piecewise Parabolic Method
integer, parameter :: INTEGRATION_PQM = 5 !< Piecewise Quartic Method

character(len=40) :: mdl = "MOM_remapping" !< This module's name.

!> Documentation for external callers
character(len=360), public :: remappingSchemesDoc = &
"PCM (1st-order accurate)\n"//&
Expand Down Expand Up @@ -181,7 +179,6 @@ subroutine remapping_core_h(CS, n0, h0, u0, n1, h1, u1, h_neglect, h_neglect_edg
real :: uh_err ! A bound on the error in the sum of u*h, as estimated by the remapping code [A H]
real :: hNeglect, hNeglect_edge ! Negligibly small cell widths in the same units as h0 [H]
integer :: iMethod ! An integer indicating the integration method used
integer :: k

hNeglect = 1.0e-30 ; if (present(h_neglect)) hNeglect = h_neglect
hNeglect_edge = 1.0e-10 ; if (present(h_neglect_edge)) hNeglect_edge = h_neglect_edge
Expand All @@ -190,7 +187,7 @@ subroutine remapping_core_h(CS, n0, h0, u0, n1, h1, u1, h_neglect, h_neglect_edg
hNeglect, hNeglect_edge, PCM_cell )

if (CS%check_reconstruction) call check_reconstructions_1d(n0, h0, u0, CS%degree, &
CS%boundary_extrapolation, ppoly_r_coefs, ppoly_r_E, ppoly_r_S)
CS%boundary_extrapolation, ppoly_r_coefs, ppoly_r_E)

call remap_via_sub_cells( n0, h0, u0, ppoly_r_E, ppoly_r_coefs, n1, h1, iMethod, &
CS%force_bounds_in_subcell, u1, uh_err )
Expand Down Expand Up @@ -233,7 +230,7 @@ subroutine remapping_core_w( CS, n0, h0, u0, n1, dx, u1, h_neglect, h_neglect_ed
hNeglect, hNeglect_edge )

if (CS%check_reconstruction) call check_reconstructions_1d(n0, h0, u0, CS%degree, &
CS%boundary_extrapolation, ppoly_r_coefs, ppoly_r_E, ppoly_r_S)
CS%boundary_extrapolation, ppoly_r_coefs, ppoly_r_E)

! This is a temporary step prior to switching to remapping_core_h()
do k = 1, n1
Expand Down Expand Up @@ -387,15 +384,14 @@ end subroutine build_reconstructions_1d

!> Checks that edge values and reconstructions satisfy bounds
subroutine check_reconstructions_1d(n0, h0, u0, deg, boundary_extrapolation, &
ppoly_r_coefs, ppoly_r_E, ppoly_r_S)
ppoly_r_coefs, ppoly_r_E)
integer, intent(in) :: n0 !< Number of cells on source grid
real, dimension(n0), intent(in) :: h0 !< Cell widths on source grid [H]
real, dimension(n0), intent(in) :: u0 !< Cell averages on source grid [A]
integer, intent(in) :: deg !< Degree of polynomial reconstruction
logical, intent(in) :: boundary_extrapolation !< Extrapolate at boundaries if true
real, dimension(n0,deg+1),intent(out) :: ppoly_r_coefs !< Coefficients of polynomial [A]
real, dimension(n0,2), intent(out) :: ppoly_r_E !< Edge value of polynomial [A]
real, dimension(n0,2), intent(out) :: ppoly_r_S !< Edge slope of polynomial [A H-1]
real, dimension(n0,deg+1),intent(in) :: ppoly_r_coefs !< Coefficients of polynomial [A]
real, dimension(n0,2), intent(in) :: ppoly_r_E !< Edge value of polynomial [A]
! Local variables
integer :: i0, n
real :: u_l, u_c, u_r ! Cell averages [A]
Expand Down Expand Up @@ -997,8 +993,8 @@ end subroutine reintegrate_column
!! separation dh.
real function average_value_ppoly( n0, u0, ppoly0_E, ppoly0_coefs, method, i0, xa, xb)
integer, intent(in) :: n0 !< Number of cells in source grid
real, intent(in) :: u0(:) !< Cell means [A]
real, intent(in) :: ppoly0_E(:,:) !< Edge value of polynomial [A]
real, intent(in) :: u0(n0) !< Cell means [A]
real, intent(in) :: ppoly0_E(n0,2) !< Edge value of polynomial [A]
real, intent(in) :: ppoly0_coefs(:,:) !< Coefficients of polynomial [A]
integer, intent(in) :: method !< Remapping scheme to use
integer, intent(in) :: i0 !< Source cell index
Expand Down

0 comments on commit b46638e

Please sign in to comment.