MOM6
lock_exchange_initialization Module Reference

Detailed Description

The module configures the model for 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, 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(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.
[out]hThe thickness that is being initialized, in m.
[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 41 of file lock_exchange_initialization.F90.

References mom_error_handler::mom_mesg().

Referenced by mom_state_initialization::mom_initialize_state().

41  type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
42  type(verticalgrid_type), intent(in) :: gv !< The ocean's vertical grid structure.
43  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
44  intent(out) :: h !< The thickness that is being initialized, in m.
45  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
46  !! to parse for model parameter values.
47  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
48  !! only read parameters without changing h.
49 
50  real :: e0(szk_(gv)) ! The resting interface heights, in m, usually !
51  ! negative because it is positive upward. !
52  real :: e_pert(szk_(gv)) ! Interface height perturbations, positive !
53  ! upward, in m. !
54  real :: eta1d(szk_(gv)+1)! Interface height relative to the sea surface !
55  ! positive upward, in m. !
56  real :: front_displacement ! Vertical displacement acrodd front
57  real :: thermocline_thickness ! Thickness of stratified region
58  logical :: just_read ! If true, just read parameters but set nothing.
59 ! This include declares and sets the variable "version".
60 #include "version_variable.h"
61  character(len=40) :: mdl = "lock_exchange_initialize_thickness" ! This subroutine's name.
62  integer :: i, j, k, is, ie, js, je, nz
63 
64  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
65 
66  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
67 
68  if (.not.just_read) &
69  call mom_mesg(" lock_exchange_initialization.F90, lock_exchange_initialize_thickness: setting thickness", 5)
70 
71  if (.not.just_read) call log_version(param_file, mdl, version, "")
72  call get_param(param_file, mdl, "FRONT_DISPLACEMENT", front_displacement, &
73  "The vertical displacement of interfaces across the front. \n"//&
74  "A value larger in magnitude that MAX_DEPTH is truncated,", &
75  units="m", fail_if_missing=.not.just_read, do_not_log=just_read)
76  call get_param(param_file, mdl, "THERMOCLINE_THICKNESS", thermocline_thickness, &
77  "The thickness of the thermocline in the lock exchange \n"//&
78  "experiment. A value of zero creates a two layer system \n"//&
79  "with vanished layers in between the two inflated layers.", &
80  default=0., units="m", do_not_log=just_read)
81 
82  if (just_read) return ! All run-time parameters have been read, so return.
83 
84  do j=g%jsc,g%jec ; do i=g%isc,g%iec
85  do k=2,nz
86  eta1d(k) = -0.5 * g%max_depth & ! Middle of column
87  - thermocline_thickness * ( (real(k-1))/real(nz) -0.5 ) ! Stratification
88  if (g%geoLonT(i,j)-g%west_lon < 0.5 * g%len_lon) then
89  eta1d(k)=eta1d(k) + 0.5 * front_displacement
90  elseif (g%geoLonT(i,j)-g%west_lon > 0.5 * g%len_lon) then
91  eta1d(k)=eta1d(k) - 0.5 * front_displacement
92  endif
93  enddo
94  eta1d(nz+1) = -g%max_depth ! Force bottom interface to bottom
95  do k=nz,2,-1 ! Make sure interfaces increase upwards
96  eta1d(k) = max( eta1d(k), eta1d(k+1) + gv%Angstrom )
97  enddo
98  eta1d(1) = 0. ! Force bottom interface to bottom
99  do k=2,nz ! Make sure interfaces decrease downwards
100  eta1d(k) = min( eta1d(k), eta1d(k-1) - gv%Angstrom )
101  enddo
102  do k=nz,1,-1
103  h(i,j,k) = eta1d(k) - eta1d(k+1)
104  enddo
105  enddo ; enddo
106 
Here is the call graph for this function:
Here is the caller graph for this function: