Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to main 20240228 commit #127

Merged
Merged
Changes from 1 commit
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
620d933
Autoconf: Find Python, even if PYTHON is empty
marshallward Jul 5, 2023
77b5881
+Refactor nominal depth in ALE code
Hallberg-NOAA Jun 18, 2023
7970347
Add restart subroutine to MOM.F90
adcroft Jun 1, 2023
37ee5cc
+Add tv%valid_SpV_halo to debug non-Boussinesq mode
Hallberg-NOAA Jun 26, 2023
b1210a0
(*)+Use RHO_KV_CONVERT to set nonBous GV%H_to_m
Hallberg-NOAA Jun 27, 2023
2342a58
+Add new (not yet used) arguments to 7 routines
Hallberg-NOAA Jul 12, 2023
df0eaf0
Fms2 io read3d slice (#399)
MJHarrison-GFDL Jul 20, 2023
25feaf2
Fix logic for setting KV_ML_INVZ2 from KVML
adcroft Jul 18, 2023
a5129ca
+Use RHO_PGF_REF for the pressure gradient forces
Hallberg-NOAA Jun 30, 2023
bb71c34
Converted warning about depth_list to a note
adcroft Jul 20, 2023
b9c7c86
Correct diagnostic coordinate interpolation scheme
adcroft Jul 19, 2023
ccd3ded
+(*)Fix wave_speed_init mono_N2_depth bug
Hallberg-NOAA Jul 20, 2023
6102be2
*+Revise non-Boussinesq gprime expressions
Hallberg-NOAA Jun 30, 2023
2f6e86e
*Non-Boussinesq revision of MOM_thickness_diffuse
Hallberg-NOAA Jul 21, 2023
147ddf1
Brine plume (#401)
kshedstrom Jul 25, 2023
d5ba107
+add h to drifters interface (#408)
cspencerjones Jul 25, 2023
249a078
+*Revise units of arguments to vert_fill_TS
Hallberg-NOAA Jul 11, 2023
e465b1f
Add comment justifying rescaling in vert_fill_TS
Hallberg-NOAA Jul 26, 2023
636d610
+*Add and use find_ustar
Hallberg-NOAA Jul 18, 2023
878fd1e
+wave_speed arg mono_N2_depth in thickness units
Hallberg-NOAA Jul 24, 2023
be5602e
*+Add BT_RHO_LINEARIZED to MOM_barotropic.F90
Hallberg-NOAA Jul 19, 2023
fffb6f3
+*Use thickness_to_dz in tracer modules
Hallberg-NOAA May 31, 2023
55fc59a
Fix a bug in the OMP directive for plume_flux
Hallberg-NOAA Jul 28, 2023
5af37b6
Generalized MOM restart function
marshallward Jun 27, 2023
3d9190c
Create restart directory if absent
marshallward Jul 6, 2023
5efad9b
Use POSIX stat to check if restart dir exists
marshallward Jul 21, 2023
84056b1
*Cancel out Z_to_H factors in MOM_hor_visc.F90
Hallberg-NOAA Mar 30, 2023
3fd2191
+*Revise the units of 12 vertvisc_type elements
Hallberg-NOAA Jul 14, 2023
2d42dca
+Thickness-based diffusivity arguments
Hallberg-NOAA Jul 16, 2023
359bdcb
+*Use [H Z2 T-3 ~> m3 s-3 or W m-2] for TKE units
Hallberg-NOAA Jul 19, 2023
fc773d9
+*Non-Boussinesq Rossby_front initialization
Hallberg-NOAA Jul 5, 2023
8f5465b
*Fix logic of an inconsistent initialization test
Hallberg-NOAA Jul 30, 2023
d22b667
+Add find_rho_bottom
Hallberg-NOAA Jul 20, 2023
e4f76c0
+*Non-Boussinesq internal tide drag uses density
Hallberg-NOAA Jul 20, 2023
fd31e01
+(*)Minimum non-Boussinesq answer date of 20230701
Hallberg-NOAA Jul 4, 2023
45cd5c6
Move file parser inquire calls to root PE
marshallward Jul 21, 2023
f01d256
+Non-Boussinesq revisions to wave_interface
Hallberg-NOAA Aug 3, 2023
8f7cc0e
Ice shelf melt parameterization fixes (#395)
claireyung Aug 7, 2023
46c5262
*Use tv%SpV_avg in non-Boussinesq regridding
Hallberg-NOAA Jun 20, 2023
ba70663
*Non-Boussinesq revision of diabatic_driver
Hallberg-NOAA Aug 2, 2023
648012e
Adding a knob for strength of brine plume mixing.
kshedstrom Aug 4, 2023
07713af
+*Ignore SURFACE_ANSWER_DATE when non-Boussinesq
Hallberg-NOAA Jun 30, 2023
597bbf1
+*Non-Boussinesq revision of full_convection
Hallberg-NOAA Aug 5, 2023
3ce1368
+*Non-Boussinesq revision of MOM_vertvisc.F90
Hallberg-NOAA Aug 2, 2023
c4ff021
*+Add forcing%tau_mag_gustless & tau_mag opt args
Hallberg-NOAA Jun 30, 2023
23df713
+*Non-Boussinesq revision of tidal_mixing
Hallberg-NOAA Aug 5, 2023
9e756af
*Fix allocate_forcing_by_ref tau_mag_gustless bug
Hallberg-NOAA Aug 12, 2023
2642c1c
Fix rescaling in regularize_surface debugging
Hallberg-NOAA Jun 14, 2023
f847b3c
*Non-Boussinesq revision of 3 MOM_CVMix modules
Hallberg-NOAA Aug 6, 2023
22a370c
*Non-Boussinesq revision of MOM_CVMix_KPP
Hallberg-NOAA Aug 7, 2023
c803904
Bugfix for MOM_tracer_advect for ad_x/y and ad2d_x/y diagnostic fields
Aug 14, 2023
a808881
*Non-Boussinesq interface_filter
Hallberg-NOAA Jun 16, 2023
d223f25
*Revise calc_isoneutral_slopes when non-Boussinesq
Hallberg-NOAA Jun 8, 2023
d16f343
Refactor rescaling of CFC_cap flux diagnostics
Hallberg-NOAA May 31, 2023
546728a
*+Non-Boussinesq revision of set_viscosity
Hallberg-NOAA Aug 4, 2023
9b86edb
*Non-Boussinesq revision of set_diffusivity
Hallberg-NOAA Aug 12, 2023
828a178
*Non-Boussinesq refactoring of entrain_diffusive
Hallberg-NOAA Aug 6, 2023
be0e800
Merge branch 'main' into dev/gfdl
marshallward Aug 18, 2023
212f2a1
+Add RESTORE_FLUX_RHO and TKE_TIDAL_RHO
Hallberg-NOAA Jun 30, 2023
cf6ac00
Add tau_mag to allocate_forcing_type calls
Hallberg-NOAA Jun 30, 2023
994ce9e
+Set tau_mag in idealized_hurricane_wind_forcing
Hallberg-NOAA Jun 30, 2023
d107737
+Use RESTORE_FLUX_RHO in dumbbell & SCM_CVMix_tests
Hallberg-NOAA Jul 5, 2023
5afb122
Resolve warning about S_REF units
adcroft Jul 25, 2023
4c224e7
Bugfix in MLE for reproducible restarts with USE_BODNER23 = True
Aug 21, 2023
7e51f1d
+*Non-Boussinesq form of mixedlayer_restrat
Hallberg-NOAA Jul 26, 2023
d60c2e0
*Non-Boussinesq revision of kappa_shear
Hallberg-NOAA Aug 5, 2023
bd5fe0c
+(*)Use tv%SpV in MOM_sponge code
Hallberg-NOAA May 14, 2023
b3c7331
*Non-Boussinesq expressions for DOME inflow rates
Hallberg-NOAA Jul 7, 2023
32b5e8a
Separate SAL from tidal_forcing
herrwang0 Mar 9, 2023
4fec906
Decompose output from calc_tidal_forcing
herrwang0 Apr 26, 2023
b69d6fb
Fix SSH for calculating SAL with flooding points
herrwang0 Jun 6, 2023
b94a32c
Renaming input parameter names for the SAL module
herrwang0 Jun 6, 2023
00a63e8
Recover old answers with tides in Boussinesq mode
herrwang0 Jun 16, 2023
3061166
Refactor SAL and tides calls in Boussinesq mode
herrwang0 Jun 20, 2023
3515b80
Change SAL related parameter names
herrwang0 Aug 17, 2023
c6b6143
Modify reading SAL related parameters
herrwang0 Aug 17, 2023
095a3b5
*+Use TIDES_ANSWER_DATE with semi-Boussinesq tides
Hallberg-NOAA Aug 22, 2023
24160d5
*Non-Boussinesq revision of MOM.F90 for restarts
Hallberg-NOAA Aug 15, 2023
1872d3b
*Revise BFB_set_coord and BFB_buoyancy_forcing
Hallberg-NOAA Jul 7, 2023
279ee1c
Use GV%dZ_subroundoff
Hallberg-NOAA Aug 14, 2023
7d199ca
+*Revise non-Boussinesq offline tracer diffusivity
Hallberg-NOAA Jul 31, 2023
72fbee0
+Obsolete 18 2018_ANSWERS runtime parameters
Hallberg-NOAA Aug 12, 2023
9f7f86d
Autoconf: Update deps m4 macros
marshallward Aug 29, 2023
1577ae1
Ice-shelf bugfixes for restarts and halo updates
alex-huth Aug 23, 2023
1d35fa1
implement restart for internal tides (#463)
raphaeldussin Sep 8, 2023
1bb8852
*+Non-Boussinesq MEKE and add MEKE_TOTAL_DEPTH_RHO
Hallberg-NOAA Aug 9, 2023
d342b29
CI: Run test (and test.summary) locally
marshallward Aug 17, 2023
9de6ce7
New TIDAL_SAL_FLATHER option
MJHarrison-GFDL Jul 13, 2023
25b57f4
makedep: Support externals alongside program units
marshallward Sep 6, 2023
a7444b3
*Test for convergence in dz_to_thickness_EOS
Hallberg-NOAA Jul 11, 2023
dd5c47d
*Non-Boussinesq revision of energetic_PBL
Hallberg-NOAA Aug 14, 2023
2337404
+SpV_avg optional argument to extract_optics_slice
Hallberg-NOAA Aug 2, 2023
2f1bdc0
+*Non-Boussinesq bulk mixed layer calculations
Hallberg-NOAA Aug 2, 2023
8d628bd
+*Non-Boussinesq revision of diabatic_aux
Hallberg-NOAA Aug 6, 2023
3ef5b93
Do not allocate ustar and tau_mag together
Hallberg-NOAA Aug 20, 2023
e2d244f
We need an extra pass_var for Kv_shear
kshedstrom Oct 5, 2023
08704f8
+*Non-Boussinesq wave_speed calculations
Hallberg-NOAA Aug 2, 2023
2047676
+*Add halo_size argument to wave_speeds
Hallberg-NOAA Sep 28, 2023
6756b48
makedep: Module dependency in nested includes
marshallward Oct 3, 2023
6d68459
+(*)Non-Boussinesq default for Z_INIT_REMAP_GENERAL
Hallberg-NOAA Sep 30, 2023
13f2603
+*Non-Boussinesq revision of lateral_mixing_coeffs
Hallberg-NOAA Aug 7, 2023
a41d0a0
.testing: Codecov upload uses Github Actions token
marshallward Oct 3, 2023
7cef1e4
+Rename OBC sea surface height variables
Hallberg-NOAA Jul 27, 2023
de38562
Read OBC SSH data in Z units
Hallberg-NOAA Jul 28, 2023
55c948a
+Add find_col_avg_SpV
Hallberg-NOAA Jul 28, 2023
54b46f6
+Non-Boussinesq Flather open boundary conditions
Hallberg-NOAA Jul 28, 2023
06bc001
+Add segment%dZtot
Hallberg-NOAA Jul 29, 2023
e2deaec
*Patches for nonBous_OBCs to prevent blocking
MJHarrison-GFDL Oct 5, 2023
3650339
New treatment of ice shelf boundaries (#467)
alex-huth Oct 7, 2023
c399372
.testing: Codecov token for unit test upload
marshallward Oct 6, 2023
23345f0
*Fix non-Boussinesq Flather BT_OBC%dZ_v bug
Hallberg-NOAA Oct 6, 2023
41609c2
Modify quadrature used for ice shelf viscosity (#468)
alex-huth Oct 10, 2023
2ac48a6
SSA convergence based on change of norm (#469)
alex-huth Oct 11, 2023
bd4c87c
*Use thickness_to_dz in dumbbell_initialize_sponges
Hallberg-NOAA Jul 7, 2023
95d6e93
(+*) Fix bugs in tracer index in tracer reservoirs (#480)
WenhaoChen89 Oct 12, 2023
38aeccd
+Add particle code option to advect with uhtr (#492)
cspencerjones Oct 13, 2023
89506fa
Ice shelf Coulomb friction law (#470)
alex-huth Oct 13, 2023
0c491ce
+REMAP_AUX needs at least one more halo update. (#496)
kshedstrom Oct 13, 2023
ead68d4
+Refactored diapyc_energy_req_test
Hallberg-NOAA Jun 12, 2023
43a4fa9
Refactor diapyc_energy_req_calc and find_PE_chg
Hallberg-NOAA Oct 7, 2023
475590d
Acceleration of Zanna-Bolton-2020 parameterization and new features r…
Pperezhogin Oct 19, 2023
ac66061
Ice-shelf solo driver and MISMIP+ updates (#471)
alex-huth Oct 23, 2023
c9fc30d
ice shelf dHdt and optimization
alex-huth Aug 23, 2023
e5b64f9
Merge branch 'main' into dev/gfdl
marshallward Oct 25, 2023
f514529
Ice sheet thickness boundary condition (#474)
alex-huth Oct 26, 2023
503a9f4
ice shelf front advection: When determining a reference thickness for…
alex-huth Oct 27, 2023
ddb88f8
+Add timestamp and directory to particles restart
cspencerjones Oct 16, 2023
615e57f
extension to the internal tides module (#481)
raphaeldussin Oct 28, 2023
d210cc6
+Remove build_grid_arbitrary
Hallberg-NOAA Aug 16, 2023
467d1dd
+Remove rescale_grid_bathymetry
Hallberg-NOAA Aug 16, 2023
19f0147
+Fix dimensional rescaling with HARMONICS_SAL
Hallberg-NOAA Oct 13, 2023
ffa6af6
Document 31 real variables units
Hallberg-NOAA Oct 30, 2023
11c3f56
+Save tv%p_surf to some restart files
Hallberg-NOAA Oct 11, 2023
ab54a1e
Added capability to write an ice_shelf.stats file (or with custom fil…
alex-huth Oct 27, 2023
3ab3dfc
Fix ice-sheet grounding based on ocean column thickness (#512)
alex-huth Nov 2, 2023
1242a64
Merge branch 'main' into dev/gfdl
marshallward Nov 6, 2023
d85fe73
ice-sheet/ocean coupling for misomip (#511)
alex-huth Nov 7, 2023
4329f47
Update makedep to support directory exclusion
marshallward Nov 1, 2023
4964b8b
Target framework fix; config flag refactor
marshallward Nov 3, 2023
715f53a
Update default FMS to 2023.03
marshallward Nov 3, 2023
feaeb11
*Non-Boussinesq refactoring of brine plumes
Hallberg-NOAA Oct 11, 2023
0f2a69d
Obc tracer fix (#507)
kshedstrom Nov 8, 2023
b15a9d4
Adds stand alone test_MOM_EOS and time_MOM_EOS (#516)
adcroft Nov 10, 2023
753cab3
+Refactor ALE_remap_velocities
Hallberg-NOAA Nov 7, 2023
cce4b3d
Fix a bug that left OBC%debug uninitialized
Hallberg-NOAA Nov 8, 2023
f4c95ec
Revert post_data fix to CFC concentration
marshallward Nov 15, 2023
7ef6a57
Fix the saltFluxAdded diagnoistic, broken in #401
kshedstrom Nov 21, 2023
40134ed
change target to pointer and check for association
Dec 4, 2023
0de5c14
Merge pull request #1618 from jiandewang/DEV-EMC-candidate-20230122
jiandewang Jan 31, 2024
6d7c00a
Restore bit repro using FMA in selected runs
marshallward Feb 22, 2024
2ab885e
Merge pull request #1616 from NOAA-GFDL/dev-gfdl-main-candidate-2023-…
marshallward Feb 28, 2024
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
Prev Previous commit
Next Next commit
+*Non-Boussinesq internal tide drag uses density
  Use the in situ near bottom density to calculate the internal tide drag,
energy input and energy loss terms when in non-Boussinesq mode.  This change
includes the addition of an argument containing the near-bottom density to
propagate_int_tide, itidal_lowmode_loss and find_N2_bottom.  The recently added
routine find_rho_bottom is used to calculate this near-bottom density.

  Several instances where the Boussinesq reference density or GV%Z_to_H were
used have been eliminated from use in non-Boussinesq cases by this change,  to
simplify the code and reduce the dependence on the value of GV%Rho_0 in
non-Boussinesq mode.  This involved changing the units of 4 internal variables
in find_N2_bottom to use thickness units or related units.  In some places,
GV%Rho0 was replaced with GV%H_to_RZ.  It also includes the rescaling of a
variable in int_tide_CS, and a new element with the bottom drag in the
int_tide_input_type.

 All answers are bitwise identical in Boussinesq mode, but some solutions will
change in non-Boussinesq mode with this change, and there are new arguments to
publicly visible subroutines and a new element in a transparent type.
Hallberg-NOAA authored and marshallward committed Jul 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e4f76c0e2fb121e2e99538925fe5fe8dbf32b396
91 changes: 55 additions & 36 deletions src/parameterizations/lateral/MOM_internal_tides.F90
Original file line number Diff line number Diff line change
@@ -78,9 +78,10 @@ module MOM_internal_tides
real, allocatable, dimension(:,:,:,:,:) :: TKE_Froude_loss
!< energy lost due to wave breaking [R Z3 T-3 ~> W m-2]
real, allocatable, dimension(:,:) :: TKE_itidal_loss_fixed
!< Fixed part of the energy lost due to small-scale drag [R L-2 Z3 ~> kg m-2] here;
!! This will be multiplied by N and the squared near-bottom velocity to get
!! the energy losses in [R Z3 T-3 ~> W m-2]
!< Fixed part of the energy lost due to small-scale drag [R Z3 L-2 ~> kg m-2] here;
!! This will be multiplied by N and the squared near-bottom velocity (and by
!! the near-bottom density in non-Boussinesq mode) to get the energy losses
!! in [R Z4 H-1 L-2 ~> kg m-2 or m]
real, allocatable, dimension(:,:,:,:,:) :: TKE_itidal_loss
!< energy lost due to small-scale wave drag [R Z3 T-3 ~> W m-2]
real, allocatable, dimension(:,:,:,:,:) :: TKE_residual_loss
@@ -120,7 +121,7 @@ module MOM_internal_tides
real :: cdrag !< The bottom drag coefficient [nondim].
real :: drag_min_depth !< The minimum total ocean thickness that will be used in the denominator
!! of the quadratic drag terms for internal tides when
!! INTERNAL_TIDE_QUAD_DRAG is true [Z ~> m]
!! INTERNAL_TIDE_QUAD_DRAG is true [H ~> m or kg m-2]
logical :: apply_background_drag
!< If true, apply a drag due to background processes as a sink.
logical :: apply_bottom_drag
@@ -187,7 +188,7 @@ module MOM_internal_tides

!> Calls subroutines in this file that are needed to refract, propagate,
!! and dissipate energy density of the internal tide.
subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, Rho_bot, dt, &
G, GV, US, CS)
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
@@ -203,6 +204,8 @@ subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: Nb !< Near-bottom buoyancy frequency [T-1 ~> s-1].
!! In some cases the input values are used, but in
!! others this is set along with the wave speeds.
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: Rho_bot !< Near-bottom density or the Boussinesq
!! reference density [R ~> kg m-3].
real, intent(in) :: dt !< Length of time over which to advance
!! the internal tides [T ~> s].
type(int_tide_CS), intent(inout) :: CS !< Internal tide control structure
@@ -228,8 +231,8 @@ subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
real :: frac_per_sector ! The inverse of the number of angular, modal and frequency bins [nondim]
real :: f2 ! The squared Coriolis parameter interpolated to a tracer point [T-2 ~> s-2]
real :: Kmag2 ! A squared horizontal wavenumber [L-2 ~> m-2]
real :: I_D_here ! The inverse of the local depth [Z-1 ~> m-1]
real :: I_rho0 ! The inverse fo the Boussinesq density [R-1 ~> m3 kg-1]
real :: I_D_here ! The inverse of the local water column thickness [H-1 ~> m-1 or m2 kg-1]
real :: I_mass ! The inverse of the local water mass [R-1 Z-1 ~> m2 kg-1]
real :: freq2 ! The frequency squared [T-2 ~> s-2]
real :: PE_term ! total potential energy of profile [R Z ~> kg m-2]
real :: KE_term ! total kinetic energy of profile [R Z ~> kg m-2]
@@ -244,16 +247,15 @@ subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
real :: En_initial, Delta_E_check ! Energies for debugging [R Z3 T-2 ~> J m-2]
real :: TKE_Froude_loss_check, TKE_Froude_loss_tot ! Energy losses for debugging [R Z3 T-3 ~> W m-2]
character(len=160) :: mesg ! The text of an error message
integer :: a, m, fr, i, j, k, is, ie, js, je, isd, ied, jsd, jed, nAngle, nzm
integer :: a, m, fr, i, j, k, is, ie, js, je, isd, ied, jsd, jed, nAngle
integer :: id_g, jd_g ! global (decomp-invar) indices (for debugging)
type(group_pass_type), save :: pass_test, pass_En
type(time_type) :: time_end
logical:: avg_enabled

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nAngle = CS%NAngle
nzm = GV%ke
I_rho0 = 1.0 / GV%Rho0

cn_subRO = 1e-30*US%m_s_to_L_T
en_subRO = 1e-30*US%W_m2_to_RZ3_T3*US%s_to_T

@@ -429,11 +431,20 @@ subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
do k=1,GV%ke ; do j=jsd,jed ; do i=isd,ied
htot(i,j) = htot(i,j) + h(i,j,k)
enddo ; enddo ; enddo
do j=jsd,jed ; do i=isd,ied
I_D_here = 1.0 / (max(GV%H_to_Z*htot(i,j), CS%drag_min_depth))
drag_scale(i,j) = CS%cdrag * sqrt(max(0.0, US%L_to_Z**2*vel_btTide(i,j)**2 + &
tot_En(i,j) * I_rho0 * I_D_here)) * I_D_here
enddo ; enddo
if (GV%Boussinesq) then
! This is mathematically equivalent to the form in the option below, but they differ at roundoff.
do j=jsd,jed ; do i=isd,ied
I_D_here = 1.0 / (max(htot(i,j), CS%drag_min_depth))
drag_scale(i,j) = CS%cdrag * sqrt(max(0.0, US%L_to_Z**2*vel_btTide(i,j)**2 + &
tot_En(i,j) * GV%RZ_to_H * I_D_here)) * GV%Z_to_H*I_D_here
enddo ; enddo
else
do j=jsd,jed ; do i=isd,ied
I_mass = GV%RZ_to_H / (max(htot(i,j), CS%drag_min_depth))
drag_scale(i,j) = (CS%cdrag * (Rho_bot(i,j)*I_mass)) * &
sqrt(max(0.0, US%L_to_Z**2*vel_btTide(i,j)**2 + tot_En(i,j) * I_mass))
enddo ; enddo
endif
do m=1,CS%nMode ; do fr=1,CS%nFreq ; do a=1,CS%nAngle ; do j=jsd,jed ; do i=isd,ied
! Calculate loss rate and apply loss over the time step ; apply the same drag timescale
! to each En component (technically not correct; fix later)
@@ -504,7 +515,7 @@ subroutine propagate_int_tide(h, tv, TKE_itidal_input, vel_btTide, Nb, dt, &
! Finally, apply loss
if (CS%apply_wave_drag) then
! Calculate loss rate and apply loss over the time step
call itidal_lowmode_loss(G, US, CS, Nb, Ub, CS%En, CS%TKE_itidal_loss_fixed, &
call itidal_lowmode_loss(G, GV, US, CS, Nb, Rho_bot, Ub, CS%En, CS%TKE_itidal_loss_fixed, &
CS%TKE_itidal_loss, dt, full_halos=.false.)
endif
! Check for En<0 - for debugging, delete later
@@ -782,18 +793,21 @@ end subroutine sum_En

!> Calculates the energy lost from the propagating internal tide due to
!! scattering over small-scale roughness along the lines of Jayne & St. Laurent (2001).
subroutine itidal_lowmode_loss(G, US, CS, Nb, Ub, En, TKE_loss_fixed, TKE_loss, dt, full_halos)
subroutine itidal_lowmode_loss(G, GV, US, CS, Nb, Rho_bot, Ub, En, TKE_loss_fixed, TKE_loss, dt, full_halos)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(int_tide_CS), intent(in) :: CS !< Internal tide control structure
real, dimension(G%isd:G%ied,G%jsd:G%jed), &
intent(in) :: Nb !< Near-bottom stratification [T-1 ~> s-1].
real, dimension(G%isd:G%ied,G%jsd:G%jed), &
intent(in) :: Rho_bot !< Near-bottom density [R ~> kg m-3].
real, dimension(G%isd:G%ied,G%jsd:G%jed,CS%nFreq,CS%nMode), &
intent(inout) :: Ub !< RMS (over one period) near-bottom horizontal
!! mode velocity [L T-1 ~> m s-1].
real, dimension(G%isd:G%ied,G%jsd:G%jed), &
intent(in) :: TKE_loss_fixed !< Fixed part of energy loss [R L-2 Z3 ~> kg m-2]
!! (rho*kappa*h^2).
intent(in) :: TKE_loss_fixed !< Fixed part of energy loss [R Z4 H-1 L-2 ~> kg m-2 or m]
!! (rho*kappa*h^2) or (kappa*h^2).
real, dimension(G%isd:G%ied,G%jsd:G%jed,CS%NAngle,CS%nFreq,CS%nMode), &
intent(inout) :: En !< Energy density of the internal waves [R Z3 T-2 ~> J m-2].
real, dimension(G%isd:G%ied,G%jsd:G%jed,CS%NAngle,CS%nFreq,CS%nMode), &
@@ -830,14 +844,18 @@ subroutine itidal_lowmode_loss(G, US, CS, Nb, Ub, En, TKE_loss_fixed, TKE_loss,
enddo

! Calculate TKE loss rate; units of [R Z3 T-3 ~> W m-2] here.
TKE_loss_tot = q_itides * TKE_loss_fixed(i,j) * Nb(i,j) * Ub(i,j,fr,m)**2
if (GV%Boussinesq .or. GV%semi_Boussinesq) then
TKE_loss_tot = q_itides * GV%Z_to_H * TKE_loss_fixed(i,j) * Nb(i,j) * Ub(i,j,fr,m)**2
else
TKE_loss_tot = q_itides * (GV%RZ_to_H * Rho_bot(i,j)) * TKE_loss_fixed(i,j) * Nb(i,j) * Ub(i,j,fr,m)**2
endif

! Update energy remaining (this is a pseudo implicit calc)
! (E(t+1)-E(t))/dt = -TKE_loss(E(t+1)/E(t)), which goes to zero as E(t+1) goes to zero
if (En_tot > 0.0) then
do a=1,CS%nAngle
frac_per_sector = En(i,j,a,fr,m)/En_tot
TKE_loss(i,j,a,fr,m) = frac_per_sector*TKE_loss_tot ! Wm-2
TKE_loss(i,j,a,fr,m) = frac_per_sector*TKE_loss_tot ! [R Z3 T-3 ~> W m-2]
loss_rate = TKE_loss(i,j,a,fr,m) / (En(i,j,a,fr,m) + En_negl) ! [T-1 ~> s-1]
En(i,j,a,fr,m) = En(i,j,a,fr,m) / (1.0 + dt*loss_rate)
enddo
@@ -2458,8 +2476,8 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS)
call get_param(param_file, mdl, "INTERNAL_TIDE_DRAG_MIN_DEPTH", CS%drag_min_depth, &
"The minimum total ocean thickness that will be used in the denominator "//&
"of the quadratic drag terms for internal tides.", &
units="m", default=1.0, scale=US%m_to_Z, do_not_log=.not.CS%apply_bottom_drag)
CS%drag_min_depth = MAX(CS%drag_min_depth, GV%H_subroundoff * GV%H_to_Z)
units="m", default=1.0, scale=GV%m_to_H, do_not_log=.not.CS%apply_bottom_drag)
CS%drag_min_depth = MAX(CS%drag_min_depth, GV%H_subroundoff)
call get_param(param_file, mdl, "INTERNAL_TIDE_FROUDE_DRAG", CS%apply_Froude_drag, &
"If true, apply wave breaking as a sink.", &
default=.false.)
@@ -2543,9 +2561,10 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS)
else
h2(i,j) = max(h2(i,j), 0.0)
endif
! Compute the fixed part; units are [R L-2 Z3 ~> kg m-2] here
! will be multiplied by N and the squared near-bottom velocity to get into [R Z3 T-3 ~> W m-2]
CS%TKE_itidal_loss_fixed(i,j) = 0.5*kappa_h2_factor*GV%Rho0 * US%L_to_Z*kappa_itides * h2(i,j)
! Compute the fixed part; units are [R Z4 H-1 L-2 ~> kg m-2 or m] here
! will be multiplied by N and the squared near-bottom velocity (and by the
! near-bottom density in non-Boussinesq mode) to get into [R Z3 T-3 ~> W m-2]
CS%TKE_itidal_loss_fixed(i,j) = 0.5*kappa_h2_factor* GV%H_to_RZ * US%L_to_Z*kappa_itides * h2(i,j)
enddo ; enddo

deallocate(h2)
@@ -2644,16 +2663,16 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS)
enddo
call pass_var(CS%residual,G%domain)

CS%id_cg1 = register_diag_field('ocean_model', 'cn1', diag%axesT1, &
Time, 'First baroclinic mode (eigen) speed', 'm s-1', conversion=US%L_T_to_m_s)
allocate(CS%id_cn(CS%nMode), source=-1)
do m=1,CS%nMode
write(var_name, '("cn_mode",i1)') m
write(var_descript, '("Baroclinic (eigen) speed of mode ",i1)') m
CS%id_cn(m) = register_diag_field('ocean_model',var_name, diag%axesT1, &
Time, var_descript, 'm s-1', conversion=US%L_T_to_m_s)
call MOM_mesg("Registering "//trim(var_name)//", Described as: "//var_descript, 5)
enddo
CS%id_cg1 = register_diag_field('ocean_model', 'cn1', diag%axesT1, &
Time, 'First baroclinic mode (eigen) speed', 'm s-1', conversion=US%L_T_to_m_s)
allocate(CS%id_cn(CS%nMode), source=-1)
do m=1,CS%nMode
write(var_name, '("cn_mode",i1)') m
write(var_descript, '("Baroclinic (eigen) speed of mode ",i1)') m
CS%id_cn(m) = register_diag_field('ocean_model',var_name, diag%axesT1, &
Time, var_descript, 'm s-1', conversion=US%L_T_to_m_s)
call MOM_mesg("Registering "//trim(var_name)//", Described as: "//var_descript, 5)
enddo


! Register maps of reflection parameters
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
@@ -387,7 +387,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &
CS%int_tide_input_CSp)

call propagate_int_tide(h, tv, CS%int_tide_input%TKE_itidal_input, CS%int_tide_input%tideamp, &
CS%int_tide_input%Nb, dt, G, GV, US, CS%int_tide)
CS%int_tide_input%Nb, CS%int_tide_input%Rho_bot, dt, G, GV, US, CS%int_tide)
if (showCallTree) call callTree_waypoint("done with propagate_int_tide (diabatic)")
endif ! end CS%use_int_tides

Loading