From c88a8520cde68508d9b5b72c1484374e169c49a6 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Fri, 24 Jun 2016 18:11:56 -0400 Subject: [PATCH] Eliminated the use of SZD... macros in EOS code The various SZDI_, etc., macros always resolve to the same thing, so in the interest of code clarity, these macros have been eliminated throughout the MOM6 equation_of_state code. All answers are bitwise identical. --- src/equation_of_state/MOM_EOS.F90 | 151 +++++++++++++---------- src/equation_of_state/MOM_EOS_Wright.F90 | 44 ++++--- src/equation_of_state/MOM_EOS_linear.F90 | 42 ++++--- 3 files changed, 140 insertions(+), 97 deletions(-) diff --git a/src/equation_of_state/MOM_EOS.F90 b/src/equation_of_state/MOM_EOS.F90 index e05d868c88..20f72c8364 100644 --- a/src/equation_of_state/MOM_EOS.F90 +++ b/src/equation_of_state/MOM_EOS.F90 @@ -311,34 +311,34 @@ end subroutine calculate_2_densities subroutine int_specific_vol_dp(T, S, p_t, p_b, alpha_ref, HI, EOS, & dza, intp_dza, intx_dza, inty_dza, halo_size) !> The horizontal index structure - type(hor_index_type), intent(in) :: HI + type(hor_index_type), intent(in) :: HI !> Potential temperature referenced to the surface (degC) - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: T + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), intent(in) :: T !> Salinity (PSU) - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: S + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), intent(in) :: S !> Pressure at the top of the layer in Pa. - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: p_t + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), intent(in) :: p_t !> Pressure at the bottom of the layer in Pa. - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: p_b + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), intent(in) :: p_b !> A mean specific volume that is subtracted out to reduce the magnitude of !! each of the integrals, m3 kg-1. The calculation is mathematically identical !! with different values of alpha_ref, but this reduces the effects of roundoff. - real, intent(in) :: alpha_ref + real, intent(in) :: alpha_ref !> Equation of state structure - type(EOS_type), pointer :: EOS + type(EOS_type), pointer :: EOS !> The change in the geopotential anomaly across the layer, in m2 s-2. - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(out) :: dza + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), intent(out) :: dza !> The integral in pressure through the layer of the geopotential anomaly !! relative to the anomaly at the bottom of the layer, in Pa m2 s-2. - real, dimension(SZDI_(HI),SZDJ_(HI)), optional, intent(out) :: intp_dza + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), optional, intent(out) :: intp_dza !> The integral in x of the difference between the geopotential anomaly at the !! top and bottom of the layer divided by the x grid spacing, in m2 s-2. - real, dimension(SZDIB_(HI),SZDJ_(HI)), optional, intent(out) :: intx_dza + real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), optional, intent(out) :: intx_dza !> The integral in y of the difference between the geopotential anomaly at the !! top and bottom of the layer divided by the y grid spacing, in m2 s-2. - real, dimension(SZDI_(HI),SZDJB_(HI)), optional, intent(out) :: inty_dza + real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), optional, intent(out) :: inty_dza !> The width of halo points on which to calculate dza. - integer, optional, intent(in) :: halo_size + integer, optional, intent(in) :: halo_size if (.not.associated(EOS)) call MOM_error(FATAL, & "int_specific_vol_dp called with an unassociated EOS_type EOS.") @@ -374,13 +374,13 @@ subroutine int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, EOS, & !> Ocean horizontal index structures for the output arrays type(hor_index_type), intent(in) :: HIO !> Potential temperature referenced to the surface (degC) - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), intent(in) :: T !> Salinity (PSU) - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: S + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), intent(in) :: S !> Height at the top of the layer in m. - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: z_t + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), intent(in) :: z_t !> Height at the bottom of the layer in m. - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: z_b + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), intent(in) :: z_b !> A mean density, in kg m-3, that is subtracted out to reduce the magnitude !! of each of the integrals. (The pressure is calculated as p~=-z*rho_0*G_e.) real, intent(in) :: rho_ref @@ -392,16 +392,16 @@ subroutine int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, EOS, & !> Equation of state structure type(EOS_type), pointer :: EOS !> The change in the pressure anomaly across the layer, in Pa. - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), intent(out) :: dpa !> The integral through the thickness of the layer of the pressure anomaly !! relative to the anomaly at the top of the layer, in Pa m. - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), optional, intent(out) :: intz_dpa !> The integral in x of the difference between the pressure anomaly at the !! top and bottom of the layer divided by the x grid spacing, in Pa. - real, dimension(SZDIB_(HIO),SZDJ_(HIO)), optional, intent(out) :: intx_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), optional, intent(out) :: intx_dpa !> The integral in y of the difference between the pressure anomaly at the !! top and bottom of the layer divided by the y grid spacing, in Pa. - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), optional, intent(out) :: inty_dpa if (.not.associated(EOS)) call MOM_error(FATAL, & "int_density_dz called with an unassociated EOS_type EOS.") @@ -561,14 +561,19 @@ end subroutine EOS_use_linear subroutine int_density_dz_generic(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, & EOS, dpa, intz_dpa, intx_dpa, inty_dpa) - type(hor_index_type), intent(in) :: HII, HIO - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T, S, z_t, z_b - real, intent(in) :: rho_ref, rho_0, G_e - type(EOS_type), pointer :: EOS !< Equation of state structure - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa - real, dimension(SZDIB_(HIO),SZDJ_(HIO)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa + type(hor_index_type), intent(in) :: HII, HIO + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & + intent(in) :: T, S, z_t, z_b + real, intent(in) :: rho_ref, rho_0, G_e + type(EOS_type), pointer :: EOS !< Equation of state structure + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & + optional, intent(out) :: intx_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: inty_dpa ! This subroutine calculates (by numerical quadrature) integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. The one @@ -897,16 +902,21 @@ subroutine int_density_dz_generic_plm (T_t, T_b, S_t, S_b, z_t, z_b, rho_ref, & rho_0, G_e, H_subroundoff, bathyT, HII, HIO, EOS, dpa, & intz_dpa, intx_dpa, inty_dpa, & useMassWghtInterp) - type(hor_index_type), intent(in) :: HII, HIO - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T_t, T_b, S_t, S_b, z_t, z_b - real, intent(in) :: rho_ref, rho_0, G_e, H_subroundoff - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: bathyT - type(EOS_type), pointer :: EOS !< Equation of state structure - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa - real, dimension(SZDIB_(HIO),SZDJ_(HIO)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa - logical, optional, intent(in) :: useMassWghtInterp + type(hor_index_type), intent(in) :: HII, HIO + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & + intent(in) :: T_t, T_b, S_t, S_b, z_t, z_b + real, intent(in) :: rho_ref, rho_0, G_e, H_subroundoff + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), intent(in) :: bathyT + type(EOS_type), pointer :: EOS !< Equation of state structure + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & + optional, intent(out) :: intx_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: inty_dpa + logical, optional, intent(in) :: useMassWghtInterp ! This subroutine calculates (by numerical quadrature) integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. The one @@ -1294,16 +1304,19 @@ subroutine int_density_dz_generic_ppm (T, T_t, T_b, S, S_t, S_b, & z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, & EOS, dpa, intz_dpa, intx_dpa, inty_dpa) - type(hor_index_type), intent(in) :: HII, HIO - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T, T_t, T_b, S, S_t, S_b, & - z_t, z_b + type(hor_index_type), intent(in) :: HII, HIO + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & + intent(in) :: T, T_t, T_b, S, S_t, S_b, z_t, z_b real, intent(in) :: rho_ref, rho_0, G_e - type(EOS_type), pointer :: EOS !< Equation of state structure - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa - - real, dimension(SZDIB_(HIO),SZDJB_(HIO)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa + type(EOS_type), pointer :: EOS !< Equation of state structure + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: intx_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: inty_dpa ! This subroutine calculates (by numerical quadrature) integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. The one @@ -1543,14 +1556,19 @@ end subroutine int_density_dz_generic_ppm subroutine int_density_dz_generic_plm_analytic (T_t, T_b, S_t, S_b, z_t, & z_b, rho_ref, rho_0, G_e, HI, EOS, dpa, intz_dpa, intx_dpa, inty_dpa) - type(hor_index_type), intent(in) :: HI - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: T_t, T_b, S_t, S_b, z_t, z_b - real, intent(in) :: rho_ref, rho_0, G_e - type(EOS_type), pointer :: EOS !< Equation of state structure - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(out) :: dpa - real, dimension(SZDI_(HI),SZDJ_(HI)), optional, intent(out) :: intz_dpa - real, dimension(SZDIB_(HI),SZDJ_(HI)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HI),SZDJB_(HI)), optional, intent(out) :: inty_dpa + type(hor_index_type), intent(in) :: HI + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(in) :: T_t, T_b, S_t, S_b, z_t, z_b + real, intent(in) :: rho_ref, rho_0, G_e + type(EOS_type), pointer :: EOS !< Equation of state structure + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(out) :: dpa + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & + optional, intent(out) :: intx_dpa + real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & + optional, intent(out) :: inty_dpa ! This subroutine calculates (by numerical quadrature) integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. The one @@ -1949,15 +1967,20 @@ end subroutine evaluate_shape_quadratic subroutine int_spec_vol_dp_generic(T, S, p_t, p_b, alpha_ref, HI, EOS, & dza, intp_dza, intx_dza, inty_dza, halo_size) - type(hor_index_type), intent(in) :: HI - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: T, S, p_t, p_b - real, intent(in) :: alpha_ref - type(EOS_type), pointer :: EOS !< Equation of state structure - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(out) :: dza - real, dimension(SZDI_(HI),SZDJ_(HI)), optional, intent(out) :: intp_dza - real, dimension(SZDIB_(HI),SZDJ_(HI)), optional, intent(out) :: intx_dza - real, dimension(SZDI_(HI),SZDJB_(HI)), optional, intent(out) :: inty_dza - integer, optional, intent(in) :: halo_size + type(hor_index_type), intent(in) :: HI + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(in) :: T, S, p_t, p_b + real, intent(in) :: alpha_ref + type(EOS_type), pointer :: EOS !< Equation of state structure + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(out) :: dza + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + optional, intent(out) :: intp_dza + real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & + optional, intent(out) :: intx_dza + real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & + optional, intent(out) :: inty_dza + integer, optional, intent(in) :: halo_size ! This subroutine calculates analytical and nearly-analytical integrals in ! pressure across layers of geopotential anomalies, which are required for ! calculating the finite-volume form pressure accelerations in a non-Boussinesq diff --git a/src/equation_of_state/MOM_EOS_Wright.F90 b/src/equation_of_state/MOM_EOS_Wright.F90 index 97e0b90e8b..778dff90ae 100644 --- a/src/equation_of_state/MOM_EOS_Wright.F90 +++ b/src/equation_of_state/MOM_EOS_Wright.F90 @@ -259,13 +259,18 @@ end subroutine calculate_2_densities_wright subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, & dpa, intz_dpa, intx_dpa, inty_dpa) - type(hor_index_type), intent(in) :: HII, HIO - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T, S, z_t, z_b - real, intent(in) :: rho_ref, rho_0, G_e - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa - real, dimension(SZDIB_(HIO),SZDJ_(HIO)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa + type(hor_index_type), intent(in) :: HII, HIO + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & + intent(in) :: T, S, z_t, z_b + real, intent(in) :: rho_ref, rho_0, G_e + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & + optional, intent(out) :: intx_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: inty_dpa ! This subroutine calculates analytical and nearly-analytical integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. @@ -293,7 +298,7 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, ! pressure anomaly at the top and bottom of the layer ! divided by the y grid spacing, in Pa. - real, dimension(SZDI_(HII),SZDJ_(HII)) :: al0_2d, p0_2d, lambda_2d + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed) :: al0_2d, p0_2d, lambda_2d real :: al0, p0, lambda real :: eps, eps2, rho_anom, rem real :: w_left, w_right, intz(5) @@ -393,14 +398,19 @@ end subroutine int_density_dz_wright subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, alpha_ref, HI, dza, & intp_dza, intx_dza, inty_dza, halo_size) - type(hor_index_type), intent(in) :: HI - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: T, S, p_t, p_b - real, intent(in) :: alpha_ref - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(out) :: dza - real, dimension(SZDI_(HI),SZDJ_(HI)), optional, intent(out) :: intp_dza - real, dimension(SZDIB_(HI),SZDJ_(HI)), optional, intent(out) :: intx_dza - real, dimension(SZDI_(HI),SZDJB_(HI)), optional, intent(out) :: inty_dza - integer, optional, intent(in) :: halo_size + type(hor_index_type), intent(in) :: HI + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(in) :: T, S, p_t, p_b + real, intent(in) :: alpha_ref + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(out) :: dza + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + optional, intent(out) :: intp_dza + real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & + optional, intent(out) :: intx_dza + real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & + optional, intent(out) :: inty_dza + integer, optional, intent(in) :: halo_size ! This subroutine calculates analytical and nearly-analytical integrals in ! pressure across layers of geopotential anomalies, which are required for ! calculating the finite-volume form pressure accelerations in a non-Boussinesq @@ -431,7 +441,7 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, alpha_ref, HI, dza, & ! divided by the y grid spacing, in m2 s-2. ! (in,opt) halo_size - The width of halo points on which to calculate dza. - real, dimension(SZDI_(HI),SZDJ_(HI)) :: al0_2d, p0_2d, lambda_2d + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed) :: al0_2d, p0_2d, lambda_2d real :: al0, p0, lambda real :: alpha_anom, dp, p_ave real :: rem, eps, eps2 diff --git a/src/equation_of_state/MOM_EOS_linear.F90 b/src/equation_of_state/MOM_EOS_linear.F90 index 090e12f5ac..96e2468ae5 100644 --- a/src/equation_of_state/MOM_EOS_linear.F90 +++ b/src/equation_of_state/MOM_EOS_linear.F90 @@ -213,14 +213,19 @@ end subroutine calculate_2_densities_linear subroutine int_density_dz_linear(T, S, z_t, z_b, rho_ref, rho_0_pres, G_e, HII, HIO, & Rho_T0_S0, dRho_dT, dRho_dS, dpa, intz_dpa, intx_dpa, inty_dpa) - type(hor_index_type), intent(in) :: HII, HIO - real, dimension(SZDI_(HII),SZDJ_(HII)), intent(in) :: T, S, z_t, z_b - real, intent(in) :: rho_ref, rho_0_pres, G_e - real, intent(in) :: Rho_T0_S0, dRho_dT, dRho_dS - real, dimension(SZDI_(HIO),SZDJ_(HIO)), intent(out) :: dpa - real, dimension(SZDI_(HIO),SZDJ_(HIO)), optional, intent(out) :: intz_dpa - real, dimension(SZDIB_(HIO),SZDJ_(HIO)), optional, intent(out) :: intx_dpa - real, dimension(SZDI_(HIO),SZDJB_(HIO)), optional, intent(out) :: inty_dpa + type(hor_index_type), intent(in) :: HII, HIO + real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & + intent(in) :: T, S, z_t, z_b + real, intent(in) :: rho_ref, rho_0_pres, G_e + real, intent(in) :: Rho_T0_S0, dRho_dT, dRho_dS + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + intent(out) :: dpa + real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & + optional, intent(out) :: intz_dpa + real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & + optional, intent(out) :: intx_dpa + real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), & + optional, intent(out) :: inty_dpa ! This subroutine calculates analytical and nearly-analytical integrals of ! pressure anomalies across layers, which are required for calculating the ! finite-volume form pressure accelerations in a Boussinesq model. @@ -292,14 +297,19 @@ end subroutine int_density_dz_linear subroutine int_spec_vol_dp_linear(T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, & dRho_dT, dRho_dS, dza, intp_dza, intx_dza, inty_dza, halo_size) - type(hor_index_type), intent(in) :: HI - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(in) :: T, S, p_t, p_b - real, intent(in) :: alpha_ref - real, intent(in) :: Rho_T0_S0, dRho_dT, dRho_dS - real, dimension(SZDI_(HI),SZDJ_(HI)), intent(out) :: dza - real, dimension(SZDI_(HI),SZDJ_(HI)), optional, intent(out) :: intp_dza - real, dimension(SZDIB_(HI),SZDJ_(HI)), optional, intent(out) :: intx_dza - real, dimension(SZDI_(HI),SZDJB_(HI)), optional, intent(out) :: inty_dza + type(hor_index_type), intent(in) :: HI + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(in) :: T, S, p_t, p_b + real, intent(in) :: alpha_ref + real, intent(in) :: Rho_T0_S0, dRho_dT, dRho_dS + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + intent(out) :: dza + real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & + optional, intent(out) :: intp_dza + real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & + optional, intent(out) :: intx_dza + real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & + optional, intent(out) :: inty_dza integer, optional, intent(in) :: halo_size ! This subroutine calculates analytical and nearly-analytical integrals in ! pressure across layers of geopotential anomalies, which are required for