Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config_src/drivers/solo_driver/MESO_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
! are in W m-2 and positive for heat going into the ocean. All fresh water
! fluxes are in kg m-2 s-1 and positive for water moving into the ocean.

real :: Temp_restore ! The temperature that is being restored toward [degC].
real :: Salin_restore ! The salinity that is being restored toward [ppt]
real :: density_restore ! The potential density that is being restored toward [R ~> kg m-3].
real :: rhoXcp ! The mean density times the heat capacity [Q R degC-1 ~> J m-3 degC-1].
real :: buoy_rest_const ! A constant relating density anomalies to the
Expand Down
1 change: 0 additions & 1 deletion config_src/drivers/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ program MOM_main
! representation of dt_forcing.
real :: dt_forcing ! The coupling time step [s].
real :: dt ! The nominal baroclinic dynamics time step [s].
real :: dt_off ! Offline time step [s].
integer :: ntstep ! The number of baroclinic dynamics time steps
! within dt_forcing.
real :: dt_therm ! The thermodynamic timestep [s]
Expand Down
2 changes: 0 additions & 2 deletions config_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ subroutine g_tracer_get_3D_val(g_tracer_list,name,member,array,isd,jsd,ntau,posi
integer, optional, intent(in) :: ntau !< Unknown
logical, optional, intent(in) :: positive !< Unknown
real, dimension(isd:,jsd:,:), intent(out):: array !< Unknown
integer :: tau
character(len=fm_string_len), parameter :: sub_name = 'g_tracer_get_3D_val'
end subroutine g_tracer_get_3D_val

Expand Down Expand Up @@ -257,7 +256,6 @@ end subroutine g_tracer_set_real

subroutine g_tracer_send_diag(g_tracer_list,model_time,tau)
type(g_tracer_type), pointer :: g_tracer_list !< pointer to the head of the generic tracer list
type(g_tracer_type), pointer :: g_tracer !< Pointer to tracer node
type(time_type), intent(in) :: model_time !< Time
integer, intent(in) :: tau !< The time step for the %field 4D field to be reported
end subroutine g_tracer_send_diag
Expand Down
2 changes: 0 additions & 2 deletions config_src/infra/FMS1/MOM_couplertype_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ subroutine CT_set_data(array_in, bc_index, field_index, var, &
!! the second dimension of the output array
!! in a non-decreasing list

integer :: subfield ! An integer indicating which field to set.

call coupler_type_set_data(array_in, bc_index, field_index, var, scale_factor, halo_size, idim, jdim)

end subroutine CT_set_data
Expand Down
10 changes: 3 additions & 7 deletions config_src/infra/FMS1/MOM_domain_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ subroutine pass_var_2d(array, MOM_dom, sideflag, complete, position, halo, inner
! Local variables
real, allocatable, dimension(:,:) :: tmp
integer :: pos, i_halo, j_halo
integer :: isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB
integer :: inner, i, j, isfw, iefw, isfe, iefe, jsfs, jefs, jsfn, jefn
integer :: isc, iec, jsc, jec, isd, ied, jsd, jed
integer :: i, j, isfw, iefw, isfe, iefe, jsfs, jefs, jsfn, jefn
integer :: dirflag
logical :: block_til_complete

Expand Down Expand Up @@ -593,7 +593,6 @@ subroutine fill_vector_symmetric_edges_2d(u_cmpt, v_cmpt, MOM_dom, stagger, scal
integer :: dirflag
integer :: i, j, isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB
real, allocatable, dimension(:) :: sbuff_x, sbuff_y, wbuff_x, wbuff_y
logical :: block_til_complete

if (.not. MOM_dom%symmetric) then
return
Expand Down Expand Up @@ -1328,10 +1327,8 @@ subroutine create_MOM_domain(MOM_dom, n_global, n_halo, reentrant, tripolar_N, l
!! nonblocking halo updates, or false if missing.

! local variables
integer, dimension(4) :: global_indices ! The lower and upper global i- and j-index bounds
integer :: X_FLAGS ! A combination of integers encoding the x-direction grid connectivity.
integer :: Y_FLAGS ! A combination of integers encoding the y-direction grid connectivity.
integer :: xhalo_d2, yhalo_d2
character(len=200) :: mesg ! A string for use in error messages
logical :: mask_table_exists ! Mask_table is present and the file it points to exists

Expand Down Expand Up @@ -1516,7 +1513,6 @@ subroutine clone_MD_to_MD(MD_in, MOM_dom, min_halo, halo_size, symmetric, domain
integer, optional, intent(in) :: extra_halo !< An extra number of points in the halos
!! compared with MD_in

integer :: global_indices(4)
logical :: mask_table_exists
integer, dimension(:), allocatable :: exni ! The extents of the grid for each i-row of the layout.
! The sum of exni must equal MOM_dom%niglobal.
Expand Down Expand Up @@ -1819,7 +1815,7 @@ subroutine get_domain_extent_d2D(Domain, isc, iec, jsc, jec, isd, ied, jsd, jed)
integer, optional, intent(out) :: jed !< The end j-index of the data domain

! Local variables
integer :: isd_, ied_, jsd_, jed_, jsg_, jeg_, isg_, ieg_
integer :: isd_, ied_, jsd_, jed_

call mpp_get_compute_domain(Domain, isc, iec, jsc, jec)
call mpp_get_data_domain(Domain, isd_, ied_, jsd_, jed_)
Expand Down
3 changes: 1 addition & 2 deletions config_src/infra/FMS1/MOM_io_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,8 @@ subroutine read_field_4d(filename, fieldname, data, MOM_Domain, &
! Local variables
character(len=80) :: varname ! The name of a variable in the file
type(fieldtype), allocatable :: fields(:) ! An array of types describing all the variables in the file
logical :: use_fms_read_data, file_is_global
logical :: file_is_global
integer :: n, unit, ndim, nvar, natt, ntime
integer :: is, ie, js, je

! This single call does not work for a 4-d array due to FMS limitations, so multiple calls are
! needed.
Expand Down
3 changes: 1 addition & 2 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
type(ALE_CS), pointer :: CS !< Module control structure

! Local variables
real, allocatable :: dz(:)
character(len=40) :: mdl = "MOM_ALE" ! This module's name.
character(len=80) :: string, vel_string ! Temporary strings
real :: filter_shallow_depth, filter_deep_depth
Expand Down Expand Up @@ -1427,7 +1426,7 @@ subroutine ALE_initThicknessToCoord( CS, G, GV, h )
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: h !< layer thickness [H ~> m or kg m-2]

! Local variables
integer :: i, j, k
integer :: i, j

do j = G%jsd,G%jed ; do i = G%isd,G%ied
h(i,j,:) = GV%Z_to_H * getStaticThickness( CS%regridCS, 0., G%bathyT(i,j)+G%Z_ref )
Expand Down
7 changes: 1 addition & 6 deletions src/ALE/MOM_hybgen_regrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ subroutine hybgen_regrid(G, GV, US, dp, tv, CS, dzInterface, PCM_cell)
! each target layer, in the unusual case where the the input grid is
! larger than the new grid. This situation only occurs during certain
! types of initialization or when generating output diagnostics.
integer :: i, j, k, nk, m, k2, nk_in
integer :: i, j, k, nk, k2, nk_in

nk = CS%nk

Expand Down Expand Up @@ -532,8 +532,6 @@ subroutine hybgen_column_init(nk, nsigma, dp0k, ds0k, dp00i, topiso_i_j, &
! --- --------------------------------------------------------------

! Local variables
character(len=256) :: mesg ! A string for output messages
real :: hybrlx ! The relaxation rate in the hybrid region [timestep-1]?
real :: qdep ! Total water column thickness as a fraction of dp0k (vs ds0k) [nondim]
real :: q ! A portion of the thickness that contributes to the new cell [H ~> m or kg m-2]
real :: p_int(nk+1) ! Interface depths [H ~> m or kg m-2]
Expand Down Expand Up @@ -641,8 +639,6 @@ real function cushn(delp, dp0)
real, intent(in) :: delp ! A thickness change [H ~> m or kg m-2]
real, intent(in) :: dp0 ! A non-negative reference thickness [H ~> m or kg m-2]

real :: qq ! A limited ratio of delp/dp0 [nondim]

! These are the nondimensional parameters that define the cushion function.
real, parameter :: qqmn=-4.0, qqmx=2.0 ! shifted range for cushn [nondim]
! real, parameter :: qqmn=-2.0, qqmx=4.0 ! traditional range for cushn [nondim]
Expand Down Expand Up @@ -705,7 +701,6 @@ subroutine hybgen_column_regrid(CS, nk, thkbot, onem, epsil, Rcv_tgt, &
real :: h_hat0 ! A first guess at thickness movement upward across the interface
! between layers k and k-1 [H ~> m or kg m-2]
real :: dh_cor ! Thickness changes [H ~> m or kg m-2]
real :: h1_tgt ! A target thickness for the top layer [H ~> m or kg m-2]
real :: tenm ! ten m in pressure units [H ~> m or kg m-2]
real :: onemm ! one mm in pressure units [H ~> m or kg m-2]
logical :: trap_errors
Expand Down
1 change: 0 additions & 1 deletion src/ALE/MOM_hybgen_remap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ subroutine hybgen_weno_coefs(s, h_src, edges, nk, ns, thin, PCM_lay)
real :: seh1, seh2 ! Tracer slopes at the cell edges times the cell grid spacing [A]
real :: q01, q02 ! Various tracer differences between a cell average and the edge values [A]
real :: q001, q002 ! Tracer slopes at the cell edges times the cell grid spacing [A]
real :: ds2a, ds2b ! Squared tracer differences between a cell average and the edge values [A2]
logical :: PCM_layer(nk) ! True for layers that should use PCM remapping, either because they are
! very thin, or because this is specified by PCM_lay.
real :: dp(nk) ! Input grid layer thicknesses, but with a minimum thickness given by thin [H ~> m or kg m-2]
Expand Down
3 changes: 0 additions & 3 deletions src/ALE/MOM_hybgen_unmix.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ subroutine init_hybgen_unmix(CS, GV, US, param_file, hybgen_regridCS)
type(param_file_type), intent(in) :: param_file !< Parameter file
type(hybgen_regrid_CS), pointer :: hybgen_regridCS !< Control structure for hybgen
!! regridding for sharing parameters.

character(len=40) :: mdl = "MOM_hybgen" ! This module's name.
integer :: k

if (associated(CS)) call MOM_error(FATAL, "init_hybgen_unmix: CS already associated!")
Expand Down Expand Up @@ -315,7 +313,6 @@ subroutine hybgen_column_unmix(CS, nk, Rcv_tgt, temp, saln, Rcv, eqn_of_state, &
! used for updating the concentration of passive tracers [nondim]
real :: swap_T ! A swap variable for temperature [degC]
real :: swap_S ! A swap variable for salinity [ppt]
real :: swap_R ! A swap variable for the coordinate potential density [R ~> kg m-3]
real :: swap_tr ! A temporary swap variable for the tracers [conc]
logical, parameter :: lunmix=.true. ! unmix a too light deepest layer
integer :: k, ka, kp, kt, m
Expand Down
21 changes: 15 additions & 6 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ subroutine initialize_regridding(CS, GV, US, max_depth, param_file, mdl, coord_m
character(len=200) :: inputdir, fileName
character(len=320) :: message ! Temporary strings
character(len=12) :: expected_units, alt_units ! Temporary strings
logical :: tmpLogical, fix_haloclines, set_max, do_sum, main_parameters
logical :: tmpLogical, fix_haloclines, do_sum, main_parameters
logical :: coord_is_state_dependent, ierr
logical :: default_2018_answers, remap_answers_2018
real :: filt_len, strat_tol, index_scale, tmpReal, P_Ref
real :: filt_len, strat_tol, tmpReal, P_Ref
real :: maximum_depth ! The maximum depth of the ocean [m] (not in Z).
real :: dz_fixed_sfc, Rho_avg_depth, nlay_sfc_int
real :: adaptTimeRatio, adaptZoom, adaptZoomCoeff, adaptBuoyCoeff, adaptAlpha
Expand Down Expand Up @@ -1152,7 +1152,10 @@ subroutine build_zstar_grid( CS, G, GV, h, dzInterface, frac_shelf_h)
real, dimension(SZI_(G),SZJ_(G)), optional,intent(in) :: frac_shelf_h !< Fractional
!! ice shelf coverage [nondim].
! Local variables
real :: nominalDepth, minThickness, totalThickness, dh ! Depths and thicknesses [H ~> m or kg m-2]
real :: nominalDepth, minThickness, totalThickness ! Depths and thicknesses [H ~> m or kg m-2]
#ifdef __DO_SAFETY_CHECKS__
real :: dh ! [H ~> m or kg m-2]
#endif
real, dimension(SZK_(GV)+1) :: zOld ! Previous coordinate interface heights [H ~> m or kg m-2]
real, dimension(CS%nk+1) :: zNew ! New coordinate interface heights [H ~> m or kg m-2]
integer :: i, j, k, nz
Expand All @@ -1165,7 +1168,10 @@ subroutine build_zstar_grid( CS, G, GV, h, dzInterface, frac_shelf_h)
!$OMP parallel do default(none) shared(G,GV,dzInterface,CS,nz,h,frac_shelf_h, &
!$OMP ice_shelf,minThickness) &
!$OMP private(nominalDepth,totalThickness, &
!$OMP zNew,dh,zOld)
#ifdef __DO_SAFETY_CHECKS__
!$OMP dh, &
#endif
!$OMP zNew,zOld)
do j = G%jsc-1,G%jec+1
do i = G%isc-1,G%iec+1

Expand Down Expand Up @@ -1257,7 +1263,10 @@ subroutine build_sigma_grid( CS, G, GV, h, dzInterface )
! Local variables
integer :: i, j, k
integer :: nz
real :: nominalDepth, totalThickness, dh
real :: nominalDepth, totalThickness
#ifdef __DO_SAFETY_CHECKS__
real :: dh
#endif
real, dimension(SZK_(GV)+1) :: zOld ! Previous coordinate interface heights [H ~> m or kg m-2]
real, dimension(CS%nk+1) :: zNew ! New coordinate interface heights [H ~> m or kg m-2]

Expand Down Expand Up @@ -1503,7 +1512,7 @@ subroutine build_grid_HyCOM1( G, GV, US, h, tv, h_new, dzInterface, CS, frac_she
real, dimension(CS%nk+1) :: z_col_new ! New interface positions relative to the surface [H ~> m or kg m-2]
real, dimension(CS%nk+1) :: dz_col ! The realized change in z_col [H ~> m or kg m-2]
integer :: i, j, k, nki
real :: depth, nominalDepth
real :: nominalDepth
real :: h_neglect, h_neglect_edge
real :: z_top_col, totalThickness
logical :: ice_shelf
Expand Down
6 changes: 1 addition & 5 deletions src/ALE/MOM_remapping.F90
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ subroutine remapping_core_h(CS, n0, h0, u0, n1, h1, u1, h_neglect, h_neglect_edg
real, dimension(n0,2) :: ppoly_r_E ! Edge value of polynomial
real, dimension(n0,2) :: ppoly_r_S ! Edge slope of polynomial
real, dimension(n0,CS%degree+1) :: ppoly_r_coefs ! Coefficients of polynomial
real :: edges(n0,2) ! Interpolation edge values [A]
real :: slope(n0) ! Interpolation slopes per cell width [A]
real :: h0tot, h0err ! Sum of source cell widths and round-off error in this sum [H]
real :: h1tot, h1err ! Sum of target cell widths and round-off error in this sum [H]
real :: u0tot, u0err ! Integrated values on the source grid and round-off error in this sum [H A]
Expand Down Expand Up @@ -298,7 +296,7 @@ subroutine remapping_core_w( CS, n0, h0, u0, n1, dx, u1, h_neglect, h_neglect_ed
real, dimension(n0,2) :: ppoly_r_S !Edge slope of polynomial
real, dimension(n0,CS%degree+1) :: ppoly_r_coefs !Coefficients of polynomial
integer :: k
real :: eps, h0tot, h0err, h1tot, h1err
real :: h0tot, h0err, h1tot, h1err
real :: u0tot, u0err, u0min, u0max, u1tot, u1err, u1min, u1max, uh_err
real, dimension(n1) :: h1 !< Cell widths on target grid
real :: hNeglect, hNeglect_edge
Expand Down Expand Up @@ -389,8 +387,6 @@ subroutine build_reconstructions_1d( CS, n0, h0, u0, ppoly_r_coefs, &

! Local variables
integer :: local_remapping_scheme
integer :: remapping_scheme !< Remapping scheme
logical :: boundary_extrapolation !< Extrapolate at boundaries if true
integer :: k, n

! Reset polynomial
Expand Down
6 changes: 2 additions & 4 deletions src/ALE/PLM_functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,9 @@ subroutine PLM_reconstruction( N, h, u, edge_values, ppoly_coef, h_neglect )

! Local variables
integer :: k ! loop index
real :: u_l, u_c, u_r ! left, center and right cell averages
real :: h_l, h_c, h_r, h_cn ! left, center and right cell widths
real :: u_l, u_r ! left and right cell averages
real :: slope ! retained PLM slope
real :: a, b ! auxiliary variables
real :: u_min, u_max, e_l, e_r, edge
real :: e_r, edge
real :: almost_one
real, dimension(N) :: slp, mslp
real :: hNeglect
Expand Down
4 changes: 1 addition & 3 deletions src/ALE/coord_slight.F90
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,11 @@ subroutine build_slight_column(CS, eqn_of_state, H_to_pres, H_subroundoff, &
real :: Lfilt ! A filtering lengthscale [H ~> m or kg m-2].
logical :: maximum_depths_set ! If true, the maximum depths of interface have been set.
logical :: maximum_h_set ! If true, the maximum layer thicknesses have been set.
real :: k2_used, k2here, dz_sum, z_max
integer :: k2
real :: h_tr, b_denom_1, b1, d1 ! Temporary variables used by the tridiagonal solver.
real, dimension(nz) :: c1 ! Temporary variables used by the tridiagonal solver.
integer :: kur1, kur2 ! The indicies at the top and bottom of an unreliable region.
integer :: kur_ss ! The index to start with in the search for the next unstable region.
integer :: i, j, k, nkml
integer :: k, nkml

maximum_depths_set = allocated(CS%max_interface_depths)
maximum_h_set = allocated(CS%max_layer_thickness)
Expand Down
Loading