16 implicit none ;
private 18 #include <MOM_memory.h> 20 public lock_exchange_initialize_thickness
26 subroutine lock_exchange_initialize_thickness(h, G, GV, US, param_file, just_read_params)
30 real,
dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
34 logical,
optional,
intent(in) :: just_read_params
39 real :: e_pert(szk_(gv))
40 real :: eta1D(szk_(gv)+1)
42 real :: front_displacement
43 real :: thermocline_thickness
46 #include "version_variable.h" 47 character(len=40) :: mdl =
"lock_exchange_initialize_thickness" 48 integer :: i, j, k, is, ie, js, je, nz
50 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
52 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
55 call mom_mesg(
" lock_exchange_initialization.F90, lock_exchange_initialize_thickness: setting thickness", 5)
57 if (.not.just_read)
call log_version(param_file, mdl, version,
"")
58 call get_param(param_file, mdl,
"FRONT_DISPLACEMENT", front_displacement, &
59 "The vertical displacement of interfaces across the front. "//&
60 "A value larger in magnitude that MAX_DEPTH is truncated,", &
61 units=
"m", fail_if_missing=.not.just_read, do_not_log=just_read, scale=us%m_to_Z)
62 call get_param(param_file, mdl,
"THERMOCLINE_THICKNESS", thermocline_thickness, &
63 "The thickness of the thermocline in the lock exchange "//&
64 "experiment. A value of zero creates a two layer system "//&
65 "with vanished layers in between the two inflated layers.", &
66 default=0., units=
"m", do_not_log=just_read, scale=us%m_to_Z)
70 do j=g%jsc,g%jec ;
do i=g%isc,g%iec
72 eta1d(k) = -0.5 * g%max_depth &
73 - thermocline_thickness * ( (
real(k-1))/
real(nz) -0.5 )
74 if (g%geoLonT(i,j)-g%west_lon < 0.5 * g%len_lon)
then 75 eta1d(k) = eta1d(k) + 0.5 * front_displacement
76 elseif (g%geoLonT(i,j)-g%west_lon > 0.5 * g%len_lon)
then 77 eta1d(k) = eta1d(k) - 0.5 * front_displacement
80 eta1d(nz+1) = -g%max_depth
82 eta1d(k) = max( eta1d(k), eta1d(k+1) + gv%Angstrom_Z )
86 eta1d(k) = min( eta1d(k), eta1d(k-1) - gv%Angstrom_Z )
89 h(i,j,k) = gv%Z_to_H * (eta1d(k) - eta1d(k+1))
93 end subroutine lock_exchange_initialize_thickness
Ocean grid type. See mom_grid for details.
A structure that can be parsed to read and document run-time parameters.
Provides the ocean grid type.
The MOM6 facility to parse input files for runtime parameters.
Describes various unit conversion factors.
This module contains the tracer_registry_type and the subroutines that handle registration of tracers...
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.
Type to carry basic tracer information.
Routines for error handling and I/O management.
Initialization of the "lock exchange" experiment. lock_exchange = A 2-d density driven hydraulic exch...
An overloaded interface to log version information about modules.
Describes the vertical ocean grid, including unit conversion factors.
Pointers to an assortment of thermodynamic fields that may be available, including potential temperat...
Provides a transparent vertical ocean grid type and supporting routines.
Provides transparent structures with groups of MOM6 variables and supporting routines.
An overloaded interface to read and log the values of various types of parameters.