MOM6
lock_exchange_initialization Module Reference

Detailed Description

Initialization of the "lock exchange" experiment. lock_exchange = A 2-d density driven hydraulic exchange flow.

Functions/Subroutines

subroutine, public lock_exchange_initialize_thickness (h, G, GV, US, param_file, just_read_params)
 This subroutine initializes layer thicknesses for the lock_exchange experiment. More...
 

Function/Subroutine Documentation

◆ lock_exchange_initialize_thickness()

subroutine, public lock_exchange_initialization::lock_exchange_initialize_thickness ( real, dimension( g %isd: g %ied, g %jsd: g %jed, gv %ke), intent(out)  h,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(unit_scale_type), intent(in)  US,
type(param_file_type), intent(in)  param_file,
logical, intent(in), optional  just_read_params 
)

This subroutine initializes layer thicknesses for the lock_exchange experiment.

Parameters
[in]gThe ocean's grid structure.
[in]gvThe ocean's vertical grid structure.
[in]usA dimensional unit scaling type
[out]hThe thickness that is being initialized [H ~> m or kg m-2].
[in]param_fileA structure indicating the open file to parse for model parameter values.
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 27 of file lock_exchange_initialization.F90.

27  type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
28  type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
29  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
30  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
31  intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2].
32  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
33  !! to parse for model parameter values.
34  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
35  !! only read parameters without changing h.
36 
37  real :: e0(SZK_(GV)) ! The resting interface heights [Z ~> m], usually
38  ! negative because it is positive upward.
39  real :: e_pert(SZK_(GV)) ! Interface height perturbations, positive upward [Z ~> m].
40  real :: eta1D(SZK_(GV)+1)! Interface height relative to the sea surface
41  ! positive upward [Z ~> m].
42  real :: front_displacement ! Vertical displacement acrodd front
43  real :: thermocline_thickness ! Thickness of stratified region
44  logical :: just_read ! If true, just read parameters but set nothing.
45 ! This include declares and sets the variable "version".
46 #include "version_variable.h"
47  character(len=40) :: mdl = "lock_exchange_initialize_thickness" ! This subroutine's name.
48  integer :: i, j, k, is, ie, js, je, nz
49 
50  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
51 
52  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
53 
54  if (.not.just_read) &
55  call mom_mesg(" lock_exchange_initialization.F90, lock_exchange_initialize_thickness: setting thickness", 5)
56 
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)
67 
68  if (just_read) return ! All run-time parameters have been read, so return.
69 
70  do j=g%jsc,g%jec ; do i=g%isc,g%iec
71  do k=2,nz
72  eta1d(k) = -0.5 * g%max_depth & ! Middle of column
73  - thermocline_thickness * ( (real(k-1))/real(nz) -0.5 ) ! Stratification
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
78  endif
79  enddo
80  eta1d(nz+1) = -g%max_depth ! Force bottom interface to bottom
81  do k=nz,2,-1 ! Make sure interfaces increase upwards
82  eta1d(k) = max( eta1d(k), eta1d(k+1) + gv%Angstrom_Z )
83  enddo
84  eta1d(1) = 0. ! Force bottom interface to bottom
85  do k=2,nz ! Make sure interfaces decrease downwards
86  eta1d(k) = min( eta1d(k), eta1d(k-1) - gv%Angstrom_Z )
87  enddo
88  do k=nz,1,-1
89  h(i,j,k) = gv%Z_to_H * (eta1d(k) - eta1d(k+1))
90  enddo
91  enddo ; enddo
92 

References mom_error_handler::mom_mesg().

Referenced by mom_state_initialization::mom_initialize_state().

Here is the call graph for this function:
Here is the caller graph for this function: