Skip to content

Commit

Permalink
fix units and description (last fixes from review)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Dussin authored and Raphael Dussin committed Aug 21, 2024
1 parent aab5f48 commit 58f43f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 13 additions & 9 deletions src/parameterizations/lateral/MOM_internal_tides.F90
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,13 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
real :: En_initial, Delta_E_check ! Energies for debugging [H Z2 T-2 ~> m3 s-2 or J m-2]
real :: TKE_Froude_loss_check, TKE_Froude_loss_tot ! Energy losses for debugging [H Z2 T-3 ~> m3 s-3 or W m-2]
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks
! [H Z2 T-3 ~> m3 s-3 or W m-2]
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks
! [H Z2 T-2 ~> m3 s-2 or J m-2]
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal
! [m3 s-3 or W m-2 ~> H Z2 T-3]
real :: J_m2_to_HZ2_T2 ! unit conversion factor for Energy from mks to internal
! [m3 s-2 or J m-2 ~> H Z2 T-2]
character(len=160) :: mesg ! The text of an error message
integer :: En_halo_ij_stencil ! The halo size needed for energy advection
integer :: a, m, fr, i, j, k, is, ie, js, je, isd, ied, jsd, jed, nAngle
Expand Down Expand Up @@ -425,8 +429,8 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
call hchksum(CS%u_struct_bot(:,:,1), "Ustruct_bot mode 1", G%HI, haloshift=0, scale=US%m_to_Z)
call hchksum(CS%u_struct_max(:,:,1), "Ustruct_max mode 1", G%HI, haloshift=0, scale=US%m_to_Z)
call hchksum(CS%int_w2(:,:,1), "int_w2", G%HI, haloshift=0, scale=GV%H_to_MKS)
call hchksum(CS%int_U2(:,:,1), "int_U2", G%HI, haloshift=0, scale=GV%H_to_m*US%m_to_Z**2)
call hchksum(CS%int_N2w2(:,:,1), "int_N2w2", G%HI, haloshift=0, scale=GV%H_to_m*US%s_to_T**2)
call hchksum(CS%int_U2(:,:,1), "int_U2", G%HI, haloshift=0, scale=GV%H_to_mks*US%m_to_Z**2)
call hchksum(CS%int_N2w2(:,:,1), "int_N2w2", G%HI, haloshift=0, scale=GV%H_to_mks*US%s_to_T**2)
endif

! Set the wave speeds for the modes, using cg(n) ~ cg(1)/n.**********************
Expand Down Expand Up @@ -1277,8 +1281,8 @@ subroutine itidal_lowmode_loss(G, GV, US, CS, Nb, Rho_bot, Ub, En, TKE_loss_fixe
real :: En_negl ! negligibly small number to prevent division by zero [H Z2 T-2 ~> m3 s-2 or J m-2]
real :: En_a, En_b ! energy before and after timestep [H Z2 T-2 ~> m3 s-2 or J m-2]
real :: I_dt ! The inverse of the timestep [T-1 ~> s-1]
real :: J_m2_to_HZ2_T2 ! unit conversion factor for Energy from mks to internal
real :: HZ2_T3_to_W_m2 ! unit conversion factor for Energy from internal to mks
real :: J_m2_to_HZ2_T2 ! unit conversion factor for Energy from mks to internal [m3 s-2 or J m-2 ~> H Z2 T-2]
real :: HZ2_T3_to_W_m2 ! unit conversion factor for Energy from internal to mks [H Z2 T-3 ~> m3 s-3 or W m-2]

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec

Expand Down Expand Up @@ -3244,7 +3248,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)

type(axis_info) :: axes_inttides(2)
real, dimension(:), allocatable :: angles, freqs ! Lables for angles and frequencies [nondim]
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks [H Z2 T-2 ~> m3 s-2 or J m-2]

isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed

Expand Down Expand Up @@ -3374,10 +3378,10 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS)
! nominal ocean depth, or a negative value for no limit [nondim]
real :: period_1 ! The period of the gravest modeled mode [T ~> s]
real :: period ! A tidal period read from namelist [T ~> s]
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal
real :: J_m2_to_HZ2_T2 ! unit conversion factor for Energy from mks to internal
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks [H Z2 T-2 ~> m3 s-2 or J m-2]
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks [H Z2 T-3 ~> m3 s-3 or W m-2]
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal [m3 s-3 or W m-2 ~> H Z2 T-3]
real :: J_m2_to_HZ2_T2 ! unit conversion factor for Energy from mks to internal [m3 s-2 or J m-2 ~> H Z2 T-2]
integer :: num_angle, num_freq, num_mode, m, fr
integer :: isd, ied, jsd, jed, a, id_ang, i, j, nz
type(axes_grp) :: axes_ang
Expand Down
8 changes: 4 additions & 4 deletions src/parameterizations/vertical/MOM_internal_tide_input.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ subroutine set_int_tide_input(u, v, h, tv, fluxes, itide, dt, G, GV, US, CS)
! equation of state.
logical :: avg_enabled ! for testing internal tides (BDM)
type(time_type) :: time_end !< For use in testing internal tides (BDM)
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks [H Z2 T-3 ~> m3 s-3 or W m-2]
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal [m3 s-3 or W m-2 ~> H Z2 T-3]

integer :: i, j, is, ie, js, je, nz, isd, ied, jsd, jed
integer :: i_global, j_global
Expand Down Expand Up @@ -404,8 +404,8 @@ subroutine int_tide_input_init(Time, G, GV, US, param_file, diag, CS, itide)
real :: kappa_h2_factor ! factor for the product of wavenumber * rms sgs height [nondim].
real :: kappa_itides ! topographic wavenumber and non-dimensional scaling [L-1 ~> m-1]
real :: min_zbot_itides ! Minimum ocean depth for internal tide conversion [Z ~> m].
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal
real :: HZ2_T3_to_W_m2 ! unit conversion factor for TKE from internal to mks [H Z2 T-3 ~> m3 s-3 or W m-2]
real :: W_m2_to_HZ2_T3 ! unit conversion factor for TKE from mks to internal [m3 s-3 or W m-2 ~> H Z2 T-3]
integer :: tlen_days !< Time interval from start for adding wave source
!! for testing internal tides (BDM)
integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
Expand Down

0 comments on commit 58f43f4

Please sign in to comment.