MOM6
dense_water_initialization Module Reference

Detailed Description

Initialization routines for the dense water formation and overflow experiment.

This experiment consists of a shelf accumulating dense water, which spills over an upward slope and a sill, before flowing down a slope into an open ocean region. It's intended as a test of one of the motivating situations for the adaptive coordinate.

The nondimensional widths of the 5 regions are controlled by the DENSE_WATER_DOMAIN_PARAMS, and the heights of the sill and shelf as a fraction of the total domain depth are controlled by DENSE_WATER_SILL_HEIGHT and DENSE_WATER_SHELF_HEIGHT.

The density in the domain is governed by a linear equation of state, and is set up with a mixed layer of non-dimensional depth DENSE_WATER_MLD below which there is a linear stratification from S_REF, increasing by S_RANGE to the bottom.

To force the experiment, there are sponges on the inflow and outflow of the domain. The inflow sponge has a salinity anomaly of DENSE_WATER_EAST_SPONGE_SALT through the entire depth. The outflow sponge simply restores to the initial condition. Both sponges have controllable widths and restoring timescales.

Functions/Subroutines

subroutine, public dense_water_initialize_topography (D, G, param_file, max_depth)
 Initialize the topography field for the dense water experiment. More...
 
subroutine, public dense_water_initialize_ts (G, GV, param_file, eqn_of_state, T, S, h, just_read_params)
 Initialize the temperature and salinity for the dense water experiment. More...
 
subroutine, public dense_water_initialize_sponges (G, GV, tv, param_file, use_ALE, CSp, ACSp)
 Initialize the restoring sponges for the dense water experiment. More...
 

Variables

character(len=40) mdl = "dense_water_initialization"
 Module name. More...
 
real, parameter default_sill = 0.2
 Default depth of the sill [nondim]. More...
 
real, parameter default_shelf = 0.4
 Default depth of the shelf [nondim]. More...
 
real, parameter default_mld = 0.25
 Default depth of the mixed layer [nondim]. More...
 

Function/Subroutine Documentation

◆ dense_water_initialize_sponges()

subroutine, public dense_water_initialization::dense_water_initialize_sponges ( type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(thermo_var_ptrs), intent(in)  tv,
type(param_file_type), intent(in)  param_file,
logical, intent(in)  use_ALE,
type(sponge_cs), pointer  CSp,
type(ale_sponge_cs), pointer  ACSp 
)

Initialize the restoring sponges for the dense water experiment.

Parameters
[in]gHorizontal grid control structure
[in]gvVertical grid control structure
[in]tvThermodynamic variables
[in]param_fileParameter file structure
[in]use_aleALE flag
cspLayered sponge control structure pointer
acspALE sponge control structure pointer

Definition at line 154 of file dense_water_initialization.F90.

154  type(ocean_grid_type), intent(in) :: G !< Horizontal grid control structure
155  type(verticalGrid_type), intent(in) :: GV !< Vertical grid control structure
156  type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamic variables
157  type(param_file_type), intent(in) :: param_file !< Parameter file structure
158  logical, intent(in) :: use_ALE !< ALE flag
159  type(sponge_CS), pointer :: CSp !< Layered sponge control structure pointer
160  type(ALE_sponge_CS), pointer :: ACSp !< ALE sponge control structure pointer
161  ! Local variables
162  real :: west_sponge_time_scale, west_sponge_width
163  real :: east_sponge_time_scale, east_sponge_width
164 
165  real, dimension(SZI_(G),SZJ_(G)) :: Idamp ! inverse damping timescale
166  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: h, T, S ! sponge thicknesses, temp and salt
167  real, dimension(SZK_(GV)+1) :: e0, eta1D ! interface positions for ALE sponge
168 
169  integer :: i, j, k, nz
170  real :: x, zi, zmid, dist
171  real :: mld, S_ref, S_range, S_dense, T_ref, sill_height
172 
173  nz = gv%ke
174 
175  call get_param(param_file, mdl, "DENSE_WATER_WEST_SPONGE_TIME_SCALE", west_sponge_time_scale, &
176  "The time scale on the west (outflow) of the domain for restoring. If zero, the sponge is disabled.", &
177  units="s", default=0.)
178  call get_param(param_file, mdl, "DENSE_WATER_WEST_SPONGE_WIDTH", west_sponge_width, &
179  "The fraction of the domain in which the western (outflow) sponge is active.", &
180  units="nondim", default=0.1)
181  call get_param(param_file, mdl, "DENSE_WATER_EAST_SPONGE_TIME_SCALE", east_sponge_time_scale, &
182  "The time scale on the east (outflow) of the domain for restoring. If zero, the sponge is disabled.", &
183  units="s", default=0.)
184  call get_param(param_file, mdl, "DENSE_WATER_EAST_SPONGE_WIDTH", east_sponge_width, &
185  "The fraction of the domain in which the eastern (outflow) sponge is active.", &
186  units="nondim", default=0.1)
187 
188  call get_param(param_file, mdl, "DENSE_WATER_EAST_SPONGE_SALT", s_dense, &
189  "Salt anomaly of the dense water being formed in the overflow region.", &
190  units="1e-3", default=4.0)
191 
192  call get_param(param_file, mdl, "DENSE_WATER_MLD", mld, default=default_mld, do_not_log=.true.)
193  call get_param(param_file, mdl, "DENSE_WATER_SILL_HEIGHT", sill_height, default=default_sill, do_not_log=.true.)
194 
195  call get_param(param_file, mdl, "S_REF", s_ref, do_not_log=.true.)
196  call get_param(param_file, mdl, "S_RANGE", s_range, do_not_log=.true.)
197  call get_param(param_file, mdl, "T_REF", t_ref, do_not_log=.true.)
198 
199  ! no active sponges
200  if (west_sponge_time_scale <= 0. .and. east_sponge_time_scale <= 0.) return
201 
202  ! everywhere is initially unsponged
203  idamp(:,:) = 0.0
204 
205  do j = g%jsc, g%jec
206  do i = g%isc,g%iec
207  if (g%mask2dT(i,j) > 0.) then
208  ! nondimensional x position
209  x = (g%geoLonT(i,j) - g%west_lon) / g%len_lon
210 
211  if (west_sponge_time_scale > 0. .and. x < west_sponge_width) then
212  dist = 1. - x / west_sponge_width
213  ! scale restoring by depth into sponge
214  idamp(i,j) = 1. / west_sponge_time_scale * max(0., min(1., dist))
215  elseif (east_sponge_time_scale > 0. .and. x > (1. - east_sponge_width)) then
216  dist = 1. - (1. - x) / east_sponge_width
217  idamp(i,j) = 1. / east_sponge_time_scale * max(0., min(1., dist))
218  endif
219  endif
220  enddo
221  enddo
222 
223  if (use_ale) then
224  ! construct a uniform grid for the sponge
225  do k = 1,nz
226  e0(k) = -g%max_depth * (real(k - 1) / real(nz))
227  enddo
228  e0(nz+1) = -g%max_depth
229 
230  do j = g%jsc,g%jec
231  do i = g%isc,g%iec
232  eta1d(nz+1) = -g%bathyT(i,j)
233  do k = nz,1,-1
234  eta1d(k) = e0(k)
235 
236  if (eta1d(k) < (eta1d(k+1) + gv%Angstrom_Z)) then
237  ! is this layer vanished?
238  eta1d(k) = eta1d(k+1) + gv%Angstrom_Z
239  h(i,j,k) = gv%Angstrom_H
240  else
241  h(i,j,k) = gv%Z_to_H * (eta1d(k) - eta1d(k+1))
242  endif
243  enddo
244  enddo
245  enddo
246 
247  call initialize_ale_sponge(idamp, g, param_file, acsp, h, nz)
248 
249  ! construct temperature and salinity for the sponge
250  ! start with initial condition
251  t(:,:,:) = t_ref
252  s(:,:,:) = s_ref
253 
254  do j = g%jsc,g%jec
255  do i = g%isc,g%iec
256  zi = 0.
257  x = (g%geoLonT(i,j) - g%west_lon) / g%len_lon
258  do k = 1,nz
259  ! nondimensional middle of layer
260  zmid = zi + 0.5 * h(i,j,k) / (gv%Z_to_H * g%max_depth)
261 
262  if (x > (1. - east_sponge_width)) then
263  !if (zmid >= 0.9 * sill_height) &
264  s(i,j,k) = s_ref + s_dense
265  else
266  ! linear between bottom of mixed layer and bottom
267  if (zmid >= mld) &
268  s(i,j,k) = s_ref + s_range * (zmid - mld) / (1.0 - mld)
269  endif
270 
271  zi = zi + h(i,j,k) / (gv%Z_to_H * g%max_depth)
272  enddo
273  enddo
274  enddo
275 
276  if (associated(tv%T)) call set_up_ale_sponge_field(t, g, tv%T, acsp)
277  if (associated(tv%S)) call set_up_ale_sponge_field(s, g, tv%S, acsp)
278  else
279  call mom_error(fatal, "dense_water_initialize_sponges: trying to use non ALE sponge")
280  endif

References default_mld, default_sill, mdl, and mom_error_handler::mom_error().

Referenced by mom_state_initialization::mom_initialize_state().

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

◆ dense_water_initialize_topography()

subroutine, public dense_water_initialization::dense_water_initialize_topography ( real, dimension(g%isd:g%ied,g%jsd:g%jed), intent(out)  D,
type(dyn_horgrid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
real, intent(in)  max_depth 
)

Initialize the topography field for the dense water experiment.

Parameters
[in]gThe dynamic horizontal grid type
[out]dOcean bottom depth in the units of depth_max
[in]param_fileParameter file structure
[in]max_depthMaximum ocean depth in arbitrary units

Definition at line 36 of file dense_water_initialization.F90.

36  type(dyn_horgrid_type), intent(in) :: G !< The dynamic horizontal grid type
37  real, dimension(G%isd:G%ied,G%jsd:G%jed), &
38  intent(out) :: D !< Ocean bottom depth in the units of depth_max
39  type(param_file_type), intent(in) :: param_file !< Parameter file structure
40  real, intent(in) :: max_depth !< Maximum ocean depth in arbitrary units
41 
42  ! Local variables
43  real, dimension(5) :: domain_params ! nondimensional widths of all domain sections
44  real :: sill_frac, shelf_frac
45  integer :: i, j
46  real :: x
47 
48  call get_param(param_file, mdl, "DENSE_WATER_DOMAIN_PARAMS", domain_params, &
49  "Fractional widths of all the domain sections for the dense water experiment.\n"//&
50  "As a 5-element vector:\n"//&
51  " - open ocean, the section at maximum depth\n"//&
52  " - downslope, the downward overflow slope\n"//&
53  " - sill separating downslope from upslope\n"//&
54  " - upslope, the upward slope accumulating dense water\n"//&
55  " - the shelf in the dense formation region.", &
56  units="nondim", fail_if_missing=.true.)
57  call get_param(param_file, mdl, "DENSE_WATER_SILL_DEPTH", sill_frac, &
58  "Depth of the sill separating downslope from upslope, as fraction of basin depth.", &
59  units="nondim", default=default_sill)
60  call get_param(param_file, mdl, "DENSE_WATER_SHELF_DEPTH", shelf_frac, &
61  "Depth of the shelf region accumulating dense water for overflow, as fraction of basin depth.", &
62  units="nondim", default=default_shelf)
63 
64  do i = 2, 5
65  ! turn widths into positions
66  domain_params(i) = domain_params(i-1) + domain_params(i)
67  enddo
68 
69  do j = g%jsc,g%jec
70  do i = g%isc,g%iec
71  ! compute normalised zonal coordinate
72  x = (g%geoLonT(i,j) - g%west_lon) / g%len_lon
73 
74  if (x <= domain_params(1)) then
75  ! open ocean region
76  d(i,j) = max_depth
77  elseif (x <= domain_params(2)) then
78  ! downslope region, linear
79  d(i,j) = max_depth - (1.0 - sill_frac) * max_depth * &
80  (x - domain_params(1)) / (domain_params(2) - domain_params(1))
81  elseif (x <= domain_params(3)) then
82  ! sill region
83  d(i,j) = sill_frac * max_depth
84  elseif (x <= domain_params(4)) then
85  ! upslope region
86  d(i,j) = sill_frac * max_depth + (shelf_frac - sill_frac) * max_depth * &
87  (x - domain_params(3)) / (domain_params(4) - domain_params(3))
88  else
89  ! shelf region
90  d(i,j) = shelf_frac * max_depth
91  endif
92  enddo
93  enddo
94 

References default_shelf, default_sill, and mdl.

Referenced by mom_fixed_initialization::mom_initialize_topography().

Here is the caller graph for this function:

◆ dense_water_initialize_ts()

subroutine, public dense_water_initialization::dense_water_initialize_ts ( type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(param_file_type), intent(in)  param_file,
type(eos_type), pointer  eqn_of_state,
real, dimension( g %isd: g %ied, g %jsd: g %jed, gv %ke), intent(out)  T,
real, dimension( g %isd: g %ied, g %jsd: g %jed, gv %ke), intent(out)  S,
real, dimension( g %isd: g %ied, g %jsd: g %jed, gv %ke), intent(in)  h,
logical, intent(in), optional  just_read_params 
)

Initialize the temperature and salinity for the dense water experiment.

Parameters
[in]gHorizontal grid control structure
[in]gvVertical grid control structure
[in]param_fileParameter file structure
eqn_of_stateEOS structure
[out]tOutput temperature [degC]
[out]sOutput salinity [ppt]
[in]hLayer thicknesses [H ~> m or kg m-2]
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 99 of file dense_water_initialization.F90.

99  type(ocean_grid_type), intent(in) :: G !< Horizontal grid control structure
100  type(verticalGrid_type), intent(in) :: GV !< Vertical grid control structure
101  type(param_file_type), intent(in) :: param_file !< Parameter file structure
102  type(EOS_type), pointer :: eqn_of_state !< EOS structure
103  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Output temperature [degC]
104  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Output salinity [ppt]
105  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
106  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
107  !! only read parameters without changing h.
108  ! Local variables
109  real :: mld, S_ref, S_range, T_ref
110  real :: zi, zmid
111  logical :: just_read ! If true, just read parameters but set nothing.
112  integer :: i, j, k, nz
113 
114  nz = gv%ke
115 
116  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
117 
118  call get_param(param_file, mdl, "DENSE_WATER_MLD", mld, &
119  "Depth of unstratified mixed layer as a fraction of the water column.", &
120  units="nondim", default=default_mld, do_not_log=just_read)
121 
122  call get_param(param_file, mdl, "S_REF", s_ref, do_not_log=.true.)
123  call get_param(param_file, mdl, "S_RANGE", s_range, do_not_log=.true.)
124  call get_param(param_file, mdl, "T_REF", t_ref, do_not_log=.true.)
125 
126  if (just_read) return ! All run-time parameters have been read, so return.
127 
128  ! uniform temperature everywhere
129  t(:,:,:) = t_ref
130 
131  do j = g%jsc,g%jec
132  do i = g%isc,g%iec
133  zi = 0.
134  do k = 1,nz
135  ! nondimensional middle of layer
136  zmid = zi + 0.5 * h(i,j,k) / (gv%Z_to_H * g%max_depth)
137 
138  if (zmid < mld) then
139  ! use reference salinity in the mixed layer
140  s(i,j,k) = s_ref
141  else
142  ! linear between bottom of mixed layer and bottom
143  s(i,j,k) = s_ref + s_range * (zmid - mld) / (1.0 - mld)
144  endif
145 
146  zi = zi + h(i,j,k) / (gv%Z_to_H * g%max_depth)
147  enddo
148  enddo
149  enddo

References default_mld, and mdl.

Variable Documentation

◆ default_mld

real, parameter dense_water_initialization::default_mld = 0.25
private

Default depth of the mixed layer [nondim].

Definition at line 30 of file dense_water_initialization.F90.

30 real, parameter :: default_mld = 0.25 !< Default depth of the mixed layer [nondim]

Referenced by dense_water_initialize_sponges(), and dense_water_initialize_ts().

◆ default_shelf

real, parameter dense_water_initialization::default_shelf = 0.4
private

Default depth of the shelf [nondim].

Definition at line 29 of file dense_water_initialization.F90.

29 real, parameter :: default_shelf = 0.4 !< Default depth of the shelf [nondim]

Referenced by dense_water_initialize_topography().

◆ default_sill

real, parameter dense_water_initialization::default_sill = 0.2
private

Default depth of the sill [nondim].

Definition at line 28 of file dense_water_initialization.F90.

28 real, parameter :: default_sill = 0.2 !< Default depth of the sill [nondim]

Referenced by dense_water_initialize_sponges(), and dense_water_initialize_topography().

◆ mdl

character(len=40) dense_water_initialization::mdl = "dense_water_initialization"
private

Module name.

Definition at line 26 of file dense_water_initialization.F90.

26 character(len=40) :: mdl = "dense_water_initialization" !< Module name

Referenced by dense_water_initialize_sponges(), dense_water_initialize_topography(), and dense_water_initialize_ts().