From ab1f5790c9edb2ce0bee369c14bb5abb1e83a77c Mon Sep 17 00:00:00 2001 From: He Wang Date: Wed, 15 Jan 2025 23:31:05 -0500 Subject: [PATCH] Depreciate TIDE_SAL_SCALAR_VALUE Using the recently added `old_name` option in `get_params`. --- .../lateral/MOM_self_attr_load.F90 | 20 ++++++--------- .../lateral/MOM_tidal_forcing.F90 | 25 +++++++------------ 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/parameterizations/lateral/MOM_self_attr_load.F90 b/src/parameterizations/lateral/MOM_self_attr_load.F90 index 9aa325cfb8..eaf18b6c5d 100644 --- a/src/parameterizations/lateral/MOM_self_attr_load.F90 +++ b/src/parameterizations/lateral/MOM_self_attr_load.F90 @@ -193,7 +193,7 @@ subroutine SAL_init(G, GV, US, param_file, CS) logical :: calculate_sal=.false. logical :: tides=.false., use_tidal_sal_file=.false., bq_sal_tides_bug=.false. integer :: tides_answer_date=99991231 ! Recover old answers with tides - real :: sal_scalar_value, tide_sal_scalar_value ! Scaling SAL factors [nondim] + real :: sal_scalar_value=0.0 ! Scaling SAL factors [nondim] integer :: isd, ied, jsd, jed isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed @@ -245,18 +245,12 @@ subroutine SAL_init(G, GV, US, param_file, CS) if (CS%use_sal_scalar .and. CS%use_bpa) & call MOM_error(WARNING, trim(mdl) // ", SAL_init: Using bottom pressure anomaly for scalar "//& "approximation SAL is unsubstantiated.") - call get_param(param_file, '', "TIDE_SAL_SCALAR_VALUE", tide_sal_scalar_value, & - units="m m-1", default=0.0, do_not_log=.True.) - if (tide_sal_scalar_value/=0.0) & - call MOM_error(WARNING, "TIDE_SAL_SCALAR_VALUE is a deprecated parameter. "//& - "Use SAL_SCALAR_VALUE instead." ) - call get_param(param_file, mdl, "SAL_SCALAR_VALUE", sal_scalar_value, & - "The constant of proportionality between sea surface "//& - "height (really it should be bottom pressure) anomalies "//& - "and bottom geopotential anomalies. This is only used if "//& - "USE_SAL_SCALAR is true or USE_PREVIOUS_TIDES is true.", & - default=tide_sal_scalar_value, units="m m-1", & - do_not_log=(.not. CS%use_sal_scalar) .and. (.not. CS%use_tidal_sal_prev)) + call get_param(param_file, mdl, "SAL_SCALAR_VALUE", sal_scalar_value, "The constant of "//& + "proportionality between self-attraction and loading (SAL) geopotential "//& + "anomaly and barotropic geopotential anomaly. This is only used if "//& + "SAL_SCALAR_APPROX is true or USE_PREVIOUS_TIDES is true.", default=0.0, & + units="m m-1", do_not_log=.not.(CS%use_sal_scalar .or. CS%use_tidal_sal_prev), & + old_name='TIDE_SAL_SCALAR_VALUE') call get_param(param_file, mdl, "SAL_HARMONICS", CS%use_sal_sht, & "If true, use the online spherical harmonics method to calculate "//& "self-attraction and loading.", default=.false.) diff --git a/src/parameterizations/lateral/MOM_tidal_forcing.F90 b/src/parameterizations/lateral/MOM_tidal_forcing.F90 index 5e624d4aea..252a105dbb 100644 --- a/src/parameterizations/lateral/MOM_tidal_forcing.F90 +++ b/src/parameterizations/lateral/MOM_tidal_forcing.F90 @@ -45,9 +45,9 @@ module MOM_tidal_forcing !! equilibrium tide. Set to false if providing tidal phases !! that have already been shifted by the !! astronomical/equilibrium argument. - real :: sal_scalar !< The constant of proportionality between sea surface - !! height (really it should be bottom pressure) anomalies - !! and bottom geopotential anomalies [nondim]. + real :: sal_scalar = 0.0 !< The constant of proportionality between self-attraction and + !! loading (SAL) geopotential anomaly and total geopotential geopotential + !! anomalies. This is only used if USE_PREVIOUS_TIDES is true. [nondim]. integer :: nc !< The number of tidal constituents in use. real, dimension(MAX_CONSTITUENTS) :: & freq, & !< The frequency of a tidal constituent [rad T-1 ~> rad s-1]. @@ -267,7 +267,6 @@ subroutine tidal_forcing_init(Time, G, US, param_file, CS, HA_CS) character(len=40) :: mdl = "MOM_tidal_forcing" ! This module's name. character(len=128) :: mesg character(len=200) :: tidal_input_files(4*MAX_CONSTITUENTS) - real :: tide_sal_scalar_value ! The constant of proportionality with the scalar approximation to SAL [nondim] integer :: i, j, c, is, ie, js, je, isd, ied, jsd, jed, nc is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec @@ -362,18 +361,12 @@ subroutine tidal_forcing_init(Time, G, US, param_file, CS, HA_CS) "If true, use the SAL from the previous iteration of the "//& "tides to facilitate convergent iteration. "//& "This is only used if TIDES is true.", default=.false.) - call get_param(param_file, '', "TIDE_SAL_SCALAR_VALUE", tide_sal_scalar_value, & - units="m m-1", default=0.0, do_not_log=.True.) - if (tide_sal_scalar_value/=0.0) & - call MOM_error(WARNING, "TIDE_SAL_SCALAR_VALUE is a deprecated parameter. "//& - "Use SAL_SCALAR_VALUE instead." ) - call get_param(param_file, mdl, "SAL_SCALAR_VALUE", CS%sal_scalar, & - "The constant of proportionality between sea surface "//& - "height (really it should be bottom pressure) anomalies "//& - "and bottom geopotential anomalies. This is only used if "//& - "USE_SAL_SCALAR is true or USE_PREVIOUS_TIDES is true.", & - default=tide_sal_scalar_value, units="m m-1", & - do_not_log=(.not. CS%use_tidal_sal_prev)) + if (CS%use_tidal_sal_prev) & + call get_param(param_file, mdl, "SAL_SCALAR_VALUE", CS%sal_scalar, "The constant of "//& + "proportionality between self-attraction and loading (SAL) geopotential "//& + "anomaly and barotropic geopotential anomalies. This is only used if "//& + "SAL_SCALAR_APPROX is true or USE_PREVIOUS_TIDES is true.", default=0.0, & + units="m m-1", do_not_log=.true., old_name='TIDE_SAL_SCALAR_VALUE') if (nc > MAX_CONSTITUENTS) then write(mesg,'("Increase MAX_CONSTITUENTS in MOM_tidal_forcing.F90 to at least",I3, &