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
29 changes: 17 additions & 12 deletions config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ module MOM_surface_forcing_gfdl
real :: gust_const !< Constant unresolved background gustiness for ustar [R L Z T-2 ~> Pa]
logical :: read_gust_2d !< If true, use a 2-dimensional gustiness supplied from an input file.
real, pointer, dimension(:,:) :: &
TKE_tidal => NULL() !< Turbulent kinetic energy introduced to the bottom boundary layer
!! by drag on the tidal flows [R Z3 T-3 ~> W m-2].
BBL_tidal_dis => NULL() !< Tidal energy dissipation in the bottom boundary layer that can act as a
!! source of energy for bottom boundary layer mixing [R Z L2 T-3 ~> W m-2]
real, pointer, dimension(:,:) :: &
gust => NULL() !< A spatially varying unresolved background gustiness that
!! contributes to ustar [R L Z T-2 ~> Pa]. gust is used when read_gust_2d is true.
Expand Down Expand Up @@ -302,7 +302,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
call safe_alloc_ptr(fluxes%salt_flux,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%salt_flux_in,isd,ied,jsd,jed)

call safe_alloc_ptr(fluxes%TKE_tidal,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%BBL_tidal_dis,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%ustar_tidal,isd,ied,jsd,jed)

call safe_alloc_ptr(fluxes%heat_added,isd,ied,jsd,jed)
Expand All @@ -311,7 +311,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (associated(IOB%excess_salt)) call safe_alloc_ptr(fluxes%salt_left_behind,isd,ied,jsd,jed)

do j=js-2,je+2 ; do i=is-2,ie+2
fluxes%TKE_tidal(i,j) = CS%TKE_tidal(i,j)
fluxes%BBL_tidal_dis(i,j) = CS%BBL_tidal_dis(i,j)
fluxes%ustar_tidal(i,j) = CS%ustar_tidal(i,j)
enddo ; enddo

Expand Down Expand Up @@ -1304,11 +1304,15 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)

! Local variables
real :: utide ! The RMS tidal velocity [Z T-1 ~> m s-1].
real, dimension(SZI_(G),SZJ_(G)) :: &
utide_2d ! A 2d array of RMS tidal velocities [Z T-1 ~> m s-1].
real :: Flux_const_dflt ! A default piston velocity for restoring surface properties [m day-1]
logical :: Boussinesq ! If true, this run is fully Boussinesq
logical :: semi_Boussinesq ! If true, this run is partially non-Boussinesq
real :: rho_TKE_tidal ! The constant bottom density used to translate tidal amplitudes into the
! tidal bottom TKE input used with INT_TIDE_DISSIPATION [R ~> kg m-3]
real :: rho_TKE_tidal ! The constant bottom density used to translate tidal amplitudes into
! the tidal bottom TKE input used with INT_TIDE_DISSIPATION, times the
! factor rescaling from the units of TKE to those of mean kinetic
! energy [R L2 Z-2 ~> kg m-3]
logical :: new_sim ! False if this simulation was started from a restart file
! or other equivalent files.
logical :: iceberg_flux_diags ! If true, diagnostics of fluxes from icebergs are available.
Expand Down Expand Up @@ -1573,27 +1577,28 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
call get_param(param_file, mdl, "TKE_TIDAL_RHO", rho_TKE_tidal, &
"The constant bottom density used to translate tidal amplitudes into the tidal "//&
"bottom TKE input used with INT_TIDE_DISSIPATION.", &
units="kg m-3", default=CS%Rho0*US%R_to_kg_m3, scale=US%kg_m3_to_R, &
units="kg m-3", default=CS%Rho0*US%R_to_kg_m3, scale=US%kg_m3_to_R*US%Z_to_L**2, &
do_not_log=.not.(CS%read_TIDEAMP.or.(CS%utide>0.0)))

call safe_alloc_ptr(CS%TKE_tidal,isd,ied,jsd,jed)
call safe_alloc_ptr(CS%BBL_tidal_dis,isd,ied,jsd,jed)
call safe_alloc_ptr(CS%ustar_tidal,isd,ied,jsd,jed)

if (CS%read_TIDEAMP) then
TideAmp_file = trim(CS%inputdir) // trim(TideAmp_file)
! NOTE: There are certain cases where FMS is unable to read this file, so
! we use read_netCDF_data in place of MOM_read_data.
call read_netCDF_data(TideAmp_file, 'tideamp', CS%TKE_tidal, G%Domain, &
utide_2d(:,:) = 0.0
call read_netCDF_data(TideAmp_file, 'tideamp', utide_2d, G%Domain, &
rescale=US%m_to_Z*US%T_to_s)
do j=jsd, jed; do i=isd, ied
utide = CS%TKE_tidal(i,j)
CS%TKE_tidal(i,j) = G%mask2dT(i,j)*rho_TKE_tidal*CS%cd_tides*(utide*utide*utide)
utide = utide_2d(i,j)
CS%BBL_tidal_dis(i,j) = G%mask2dT(i,j)*rho_TKE_tidal*CS%cd_tides*(utide*utide*utide)
CS%ustar_tidal(i,j) = sqrt(CS%cd_tides)*utide
enddo ; enddo
else
do j=jsd,jed; do i=isd,ied
utide = CS%utide
CS%TKE_tidal(i,j) = rho_TKE_tidal*CS%cd_tides*(utide*utide*utide)
CS%BBL_tidal_dis(i,j) = rho_TKE_tidal*CS%cd_tides*(utide*utide*utide)
CS%ustar_tidal(i,j) = sqrt(CS%cd_tides)*utide
enddo ; enddo
endif
Expand Down
4 changes: 2 additions & 2 deletions config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
call safe_alloc_ptr(fluxes%salt_flux_in,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%salt_flux_added,isd,ied,jsd,jed)

call safe_alloc_ptr(fluxes%TKE_tidal,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%BBL_tidal_dis,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%ustar_tidal,isd,ied,jsd,jed)

if (CS%allow_flux_adjustments) then
Expand All @@ -304,7 +304,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
endif

do j=js-2,je+2 ; do i=is-2,ie+2
fluxes%TKE_tidal(i,j) = CS%TKE_tidal(i,j)
fluxes%BBL_tidal_dis(i,j) = US%Z_to_L**2*CS%TKE_tidal(i,j)
fluxes%ustar_tidal(i,j) = CS%ustar_tidal(i,j)
enddo ; enddo

Expand Down
4 changes: 2 additions & 2 deletions config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
call safe_alloc_ptr(fluxes%salt_flux_in,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%salt_flux_added,isd,ied,jsd,jed)

call safe_alloc_ptr(fluxes%TKE_tidal,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%BBL_tidal_dis,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%ustar_tidal,isd,ied,jsd,jed)

if (CS%allow_flux_adjustments) then
Expand All @@ -326,7 +326,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
endif

do j=js-2,je+2 ; do i=is-2,ie+2
fluxes%TKE_tidal(i,j) = CS%TKE_tidal(i,j)
fluxes%BBL_tidal_dis(i,j) = US%Z_to_L**2*CS%TKE_tidal(i,j)
fluxes%ustar_tidal(i,j) = CS%ustar_tidal(i,j)
enddo ; enddo

Expand Down
30 changes: 16 additions & 14 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ module MOM_forcing_type

! tide related inputs
real, pointer, dimension(:,:) :: &
TKE_tidal => NULL(), & !< tidal energy source driving mixing in bottom boundary layer [R Z3 T-3 ~> W m-2]
BBL_tidal_dis => NULL(), & !< Tidal energy dissipation in the bottom boundary layer that can act
!! as a source of energy for bottom boundary layer mixing [R Z L2 T-3 ~> W m-2]
ustar_tidal => NULL() !< tidal contribution to bottom ustar [Z T-1 ~> m s-1]

! iceberg related inputs
Expand Down Expand Up @@ -1313,8 +1314,9 @@ subroutine MOM_forcing_chksum(mesg, fluxes, G, US, haloshift)
call hchksum(fluxes%ice_fraction, mesg//" fluxes%ice_fraction", G%HI, haloshift=hshift)
if (associated(fluxes%salt_flux)) &
call hchksum(fluxes%salt_flux, mesg//" fluxes%salt_flux", G%HI, haloshift=hshift, unscale=US%RZ_T_to_kg_m2s)
if (associated(fluxes%TKE_tidal)) &
call hchksum(fluxes%TKE_tidal, mesg//" fluxes%TKE_tidal", G%HI, haloshift=hshift, unscale=US%RZ3_T3_to_W_m2)
if (associated(fluxes%BBL_tidal_dis)) &
call hchksum(fluxes%BBL_tidal_dis, mesg//" fluxes%BBL_tidal_dis", G%HI, haloshift=hshift, &
unscale=US%L_to_Z**2*US%RZ3_T3_to_W_m2)
if (associated(fluxes%ustar_tidal)) &
call hchksum(fluxes%ustar_tidal, mesg//" fluxes%ustar_tidal", G%HI, haloshift=hshift, unscale=US%Z_to_m*US%s_to_T)
if (associated(fluxes%lrunoff)) &
Expand Down Expand Up @@ -1438,7 +1440,7 @@ subroutine forcing_SinglePointPrint(fluxes, G, i, j, mesg)
call locMsg(fluxes%seaice_melt_heat,'seaice_melt_heat')
call locMsg(fluxes%p_surf,'p_surf')
call locMsg(fluxes%salt_flux,'salt_flux')
call locMsg(fluxes%TKE_tidal,'TKE_tidal')
call locMsg(fluxes%BBL_tidal_dis,'BBL_tidal_dis')
call locMsg(fluxes%ustar_tidal,'ustar_tidal')
call locMsg(fluxes%lrunoff,'lrunoff')
call locMsg(fluxes%frunoff,'frunoff')
Expand Down Expand Up @@ -1546,7 +1548,7 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles,
cmor_standard_name='sea_water_pressure_at_sea_water_surface')

handles%id_TKE_tidal = register_diag_field('ocean_model', 'TKE_tidal', diag%axesT1, Time, &
'Tidal source of BBL mixing', 'W m-2', conversion=US%RZ3_T3_to_W_m2)
'Tidal source of BBL mixing', 'W m-2', conversion=US%L_to_Z**2*US%RZ3_T3_to_W_m2)

if (.not. use_temperature) then
handles%id_buoy = register_diag_field('ocean_model', 'buoy', diag%axesT1, Time, &
Expand Down Expand Up @@ -3174,8 +3176,8 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h
if ((handles%id_psurf > 0) .and. associated(fluxes%p_surf)) &
call post_data(handles%id_psurf, fluxes%p_surf, diag)

if ((handles%id_TKE_tidal > 0) .and. associated(fluxes%TKE_tidal)) &
call post_data(handles%id_TKE_tidal, fluxes%TKE_tidal, diag)
if ((handles%id_TKE_tidal > 0) .and. associated(fluxes%BBL_tidal_dis)) &
call post_data(handles%id_TKE_tidal, fluxes%BBL_tidal_dis, diag)

if ((handles%id_buoy > 0) .and. associated(fluxes%buoy)) &
call post_data(handles%id_buoy, fluxes%buoy, diag)
Expand Down Expand Up @@ -3362,8 +3364,8 @@ subroutine allocate_forcing_by_ref(fluxes_ref, G, fluxes, turns)
call myAlloc(fluxes%buoy, G%isd, G%ied, G%jsd, G%jed, &
associated(fluxes_ref%buoy))

call myAlloc(fluxes%TKE_tidal, G%isd, G%ied, G%jsd, G%jed, &
associated(fluxes_ref%TKE_tidal))
call myAlloc(fluxes%BBL_tidal_dis, G%isd, G%ied, G%jsd, G%jed, &
associated(fluxes_ref%BBL_tidal_dis))
call myAlloc(fluxes%ustar_tidal, G%isd, G%ied, G%jsd, G%jed, &
associated(fluxes_ref%ustar_tidal))

Expand Down Expand Up @@ -3580,7 +3582,7 @@ subroutine deallocate_forcing_type(fluxes)
if (associated(fluxes%salt_flux)) deallocate(fluxes%salt_flux)
if (associated(fluxes%p_surf_full)) deallocate(fluxes%p_surf_full)
if (associated(fluxes%p_surf)) deallocate(fluxes%p_surf)
if (associated(fluxes%TKE_tidal)) deallocate(fluxes%TKE_tidal)
if (associated(fluxes%BBL_tidal_dis)) deallocate(fluxes%BBL_tidal_dis)
if (associated(fluxes%ustar_tidal)) deallocate(fluxes%ustar_tidal)
if (associated(fluxes%ustar_shelf)) deallocate(fluxes%ustar_shelf)
if (associated(fluxes%iceshelf_melt)) deallocate(fluxes%iceshelf_melt)
Expand Down Expand Up @@ -3727,8 +3729,8 @@ subroutine rotate_forcing(fluxes_in, fluxes, turns)
if (associated(fluxes_in%buoy)) &
call rotate_array(fluxes_in%buoy, turns, fluxes%buoy)

if (associated(fluxes_in%TKE_tidal)) &
call rotate_array(fluxes_in%TKE_tidal, turns, fluxes%TKE_tidal)
if (associated(fluxes_in%BBL_tidal_dis)) &
call rotate_array(fluxes_in%BBL_tidal_dis, turns, fluxes%BBL_tidal_dis)
if (associated(fluxes_in%ustar_tidal)) &
call rotate_array(fluxes_in%ustar_tidal, turns, fluxes%ustar_tidal)

Expand Down Expand Up @@ -3999,8 +4001,8 @@ subroutine homogenize_forcing(fluxes, G, GV, US)
if (associated(fluxes%buoy)) &
call homogenize_field_t(fluxes%buoy, G, tmp_scale=US%L_to_m**2*US%s_to_T**3)

if (associated(fluxes%TKE_tidal)) &
call homogenize_field_t(fluxes%TKE_tidal, G, tmp_scale=US%RZ3_T3_to_W_m2)
if (associated(fluxes%BBL_tidal_dis)) &
call homogenize_field_t(fluxes%BBL_tidal_dis, G, tmp_scale=US%L_to_Z**2*US%RZ3_T3_to_W_m2)

if (associated(fluxes%ustar_tidal)) &
call homogenize_field_t(fluxes%ustar_tidal, G, tmp_scale=US%Z_to_m*US%s_to_T)
Expand Down
7 changes: 5 additions & 2 deletions src/core/MOM_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ module MOM_variables
kv_bbl_v, & !< The bottom boundary layer viscosity at the v-points [H Z T-1 ~> m2 s-1 or Pa s]
ustar_BBL, & !< The turbulence velocity in the bottom boundary layer at
!! h points [H T-1 ~> m s-1 or kg m-2 s-1].
TKE_BBL, & !< A term related to the bottom boundary layer source of turbulent kinetic
!! energy, currently in [H Z2 T-3 ~> m3 s-3 or W m-2].
BBL_meanKE_loss, & !< The viscous loss of mean kinetic energy in the bottom boundary layer
!! [H L2 T-3 ~> m3 s-3 or W m-2].
BBL_meanKE_loss_sqrtCd, & !< The viscous loss of mean kinetic energy in the bottom boundary layer
!! divided by the square root of the drag coefficient [H L2 T-3 ~> m3 s-3 or W m-2].
!! This is being set only to retain old answers, and should be phased out.
taux_shelf, & !< The zonal stresses on the ocean under shelves [R Z L T-2 ~> Pa].
tauy_shelf !< The meridional stresses on the ocean under shelves [R Z L T-2 ~> Pa].
real, allocatable, dimension(:,:) :: tbl_thick_shelf_u
Expand Down
Loading