276 type(time_type),
intent(in) :: time
278 type(verticalgrid_type),
intent(in) :: gv
279 type(param_file_type),
intent(in) :: param_file
280 type(diag_ctrl),
target,
intent(inout) :: diag
281 type(int_tide_input_cs),
pointer :: cs
282 type(int_tide_input_type),
pointer :: itide
293 logical :: read_tideamp
295 #include "version_variable.h" 296 character(len=40) :: mdl =
"MOM_int_tide_input" 297 character(len=20) :: tmpstr
298 character(len=200) :: filename, tideamp_file, h2_file
303 real :: kappa_h2_factor
305 real :: min_zbot_itides
307 integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
309 if (
associated(cs))
then 310 call mom_error(warning,
"int_tide_input_init called with an associated "// &
311 "control structure.")
314 if (
associated(itide))
then 315 call mom_error(warning,
"int_tide_input_init called with an associated "// &
316 "internal tide input type.")
322 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
323 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
328 call log_version(param_file, mdl, version,
"")
330 call get_param(param_file, mdl,
"INPUTDIR", cs%inputdir, default=
".")
331 cs%inputdir = slasher(cs%inputdir)
333 call get_param(param_file, mdl,
"DEBUG", cs%debug, default=.false., do_not_log=.true.)
335 call get_param(param_file, mdl,
"MIN_ZBOT_ITIDES", min_zbot_itides, &
336 "Turn off internal tidal dissipation when the total \n"//&
337 "ocean depth is less than this value.", units=
"m", default=0.0)
339 call get_param(param_file, mdl,
"UTIDE", utide, &
340 "The constant tidal amplitude used with INT_TIDE_DISSIPATION.", &
341 units=
"m s-1", default=0.0)
343 allocate(itide%Nb(isd:ied,jsd:jed)) ; itide%Nb(:,:) = 0.0
344 allocate(itide%h2(isd:ied,jsd:jed)) ; itide%h2(:,:) = 0.0
345 allocate(itide%TKE_itidal_input(isd:ied,jsd:jed)) ; itide%TKE_itidal_input(:,:) = 0.0
346 allocate(itide%tideamp(isd:ied,jsd:jed)) ; itide%tideamp(:,:) = utide
347 allocate(cs%TKE_itidal_coef(isd:ied,jsd:jed)) ; cs%TKE_itidal_coef(:,:) = 0.0
349 call get_param(param_file, mdl,
"KAPPA_ITIDES", kappa_itides, &
350 "A topographic wavenumber used with INT_TIDE_DISSIPATION. \n"//&
351 "The default is 2pi/10 km, as in St.Laurent et al. 2002.", &
352 units=
"m-1", default=8.e-4*atan(1.0))
354 call get_param(param_file, mdl,
"KAPPA_H2_FACTOR", kappa_h2_factor, &
355 "A scaling factor for the roughness amplitude with n"//&
356 "INT_TIDE_DISSIPATION.", units=
"nondim", default=1.0)
357 call get_param(param_file, mdl,
"TKE_ITIDE_MAX", cs%TKE_itide_max, &
358 "The maximum internal tide energy source availble to mix \n"//&
359 "above the bottom boundary layer with INT_TIDE_DISSIPATION.", &
360 units=
"W m-2", default=1.0e3)
362 call get_param(param_file, mdl,
"READ_TIDEAMP", read_tideamp, &
363 "If true, read a file (given by TIDEAMP_FILE) containing \n"//&
364 "the tidal amplitude with INT_TIDE_DISSIPATION.", default=.false.)
365 if (read_tideamp)
then 366 call get_param(param_file, mdl,
"TIDEAMP_FILE", tideamp_file, &
367 "The path to the file containing the spatially varying \n"//&
368 "tidal amplitudes with INT_TIDE_DISSIPATION.", default=
"tideamp.nc")
369 filename = trim(cs%inputdir) // trim(tideamp_file)
370 call log_param(param_file, mdl,
"INPUTDIR/TIDEAMP_FILE", filename)
371 call read_data(filename,
'tideamp', itide%tideamp, &
372 domain=g%domain%mpp_domain, timelevel=1)
375 call get_param(param_file, mdl,
"H2_FILE", h2_file, &
376 "The path to the file containing the sub-grid-scale \n"//&
377 "topographic roughness amplitude with INT_TIDE_DISSIPATION.", &
378 fail_if_missing=.true.)
379 filename = trim(cs%inputdir) // trim(h2_file)
380 call log_param(param_file, mdl,
"INPUTDIR/H2_FILE", filename)
381 call read_data(filename,
'h2', itide%h2, domain=g%domain%mpp_domain, &
384 do j=js,je ;
do i=is,ie
386 if (g%bathyT(i,j) < min_zbot_itides) mask_itidal = 0.0
388 itide%tideamp(i,j) = itide%tideamp(i,j) * mask_itidal * g%mask2dT(i,j)
391 itide%h2(i,j) = min(0.01*g%bathyT(i,j)**2, itide%h2(i,j))
394 cs%TKE_itidal_coef(i,j) = 0.5*kappa_h2_factor*gv%Rho0*&
395 kappa_itides * itide%h2(i,j) * itide%tideamp(i,j)**2
399 cs%id_TKE_itidal = register_diag_field(
'ocean_model',
'TKE_itidal_itide',diag%axesT1,time, &
400 'Internal Tide Driven Turbulent Kinetic Energy',
'Watt meter-2')
402 cs%id_Nb = register_diag_field(
'ocean_model',
'Nb_itide',diag%axesT1,time, &
403 'Bottom Buoyancy Frequency',
'sec-1')
405 cs%id_N2_bot = register_diag_field(
'ocean_model',
'N2_b_itide',diag%axesT1,time, &
406 'Bottom Buoyancy frequency squared',
's-2')
Ocean grid type. See mom_grid for details.