16 implicit none ;
private
18 #include <MOM_memory.h>
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))