MOM6
sloshing_initialization Module Reference

Detailed Description

The module configures the model for the non-rotating sloshing test case.

Functions/Subroutines

subroutine, public sloshing_initialize_topography (D, G, param_file, max_depth)
 Initialization of topography. More...
 
subroutine, public sloshing_initialize_thickness (h, G, GV, param_file, just_read_params)
 Initialization of thicknesses This routine is called when THICKNESS_CONFIG is set to 'sloshing'. More...
 
subroutine, public sloshing_initialize_temperature_salinity (T, S, h, G, param_file, eqn_of_state, just_read_params)
 Initialization of temperature and salinity. More...
 

Variables

character(len=40) mdl = "sloshing_initialization"
 

Function/Subroutine Documentation

◆ sloshing_initialize_temperature_salinity()

subroutine, public sloshing_initialization::sloshing_initialize_temperature_salinity ( real, dimension(szi_(g),szj_(g), szk_(g)), intent(out)  T,
real, dimension(szi_(g),szj_(g), szk_(g)), intent(out)  S,
real, dimension(szi_(g),szj_(g), szk_(g)), intent(in)  h,
type(ocean_grid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
type(eos_type), pointer  eqn_of_state,
logical, intent(in), optional  just_read_params 
)

Initialization of temperature and salinity.

This subroutine initializes linear profiles for T and S according to reference surface layer salinity and temperature and a specified range. Note that the linear distribution is set up with respect to the layer number, not the physical position).

Parameters
[in]gOcean grid structure.
[out]tPotential temperature (degC).
[out]sSalinity (ppt).
[in]hLayer thickness (m or Pa).
[in]param_fileA structure indicating the open file to parse for model parameter values.
eqn_of_stateEquation of state structure.
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 208 of file sloshing_initialization.F90.

Referenced by mom_state_initialization::mom_initialize_state().

208  type(ocean_grid_type), intent(in) :: g !< Ocean grid structure.
209  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: t !< Potential temperature (degC).
210  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: s !< Salinity (ppt).
211  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Layer thickness (m or Pa).
212  type(param_file_type), intent(in) :: param_file !< A structure indicating the
213  !! open file to parse for model
214  !! parameter values.
215  type(eos_type), pointer :: eqn_of_state !< Equation of state structure.
216  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
217  !! only read parameters without changing h.
218 
219  integer :: i, j, k, is, ie, js, je, nz
220  real :: delta_s, delta_t
221  real :: s_ref, t_ref; ! Reference salinity and temerature within
222  ! surface layer
223  real :: s_range, t_range; ! Range of salinities and temperatures over the
224  ! vertical
225  integer :: kdelta
226  real :: deltah
227  real :: xi0, xi1
228  logical :: just_read ! If true, just read parameters but set nothing.
229  character(len=40) :: mdl = "initialize_temp_salt_linear" ! This subroutine's
230  ! name.
231 
232  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
233 
234  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
235 
236  call get_param(param_file, mdl,"S_REF",s_ref,'Reference value for salinity', &
237  units='1e-3', fail_if_missing=.not.just_read, do_not_log=just_read)
238  call get_param(param_file, mdl,"T_REF",t_ref,'Refernce value for temperature', &
239  units='C', fail_if_missing=.not.just_read, do_not_log=just_read)
240 
241  ! The default is to assume an increase by 2 for the salinity and a uniform
242  ! temperature
243  call get_param(param_file, mdl,"S_RANGE",s_range,'Initial salinity range.', &
244  units='1e-3', default=2.0, do_not_log=just_read)
245  call get_param(param_file, mdl,"T_RANGE",t_range,'Initial temperature range', &
246  units='C', default=0.0, do_not_log=just_read)
247 
248  if (just_read) return ! All run-time parameters have been read, so return.
249 
250  ! Prescribe salinity
251  !delta_S = S_range / ( G%ke - 1.0 )
252 
253  !S(:,:,1) = S_ref
254  !do k = 2,G%ke
255  ! S(:,:,k) = S(:,:,k-1) + delta_S
256  !end do
257 
258  deltah = g%max_depth / nz;
259  do j=js,je ; do i=is,ie
260  xi0 = 0.0
261  do k = 1,nz
262  xi1 = xi0 + deltah / g%max_depth
263  s(i,j,k) = 34.0 + 0.5 * s_range * (xi0 + xi1)
264  xi0 = xi1
265  enddo
266  enddo ; enddo
267 
268  ! Prescribe temperature
269  delta_t = t_range / ( g%ke - 1.0 )
270 
271  t(:,:,1) = t_ref
272  do k = 2,g%ke
273  t(:,:,k) = t(:,:,k-1) + delta_t
274  end do
275  kdelta = 2
276  t(:,:,g%ke/2 - (kdelta-1):g%ke/2 + kdelta) = 1.0
277 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the caller graph for this function:

◆ sloshing_initialize_thickness()

subroutine, public sloshing_initialization::sloshing_initialize_thickness ( real, dimension(szi_(g),szj_(g),szk_(gv)), 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 
)

Initialization of thicknesses This routine is called when THICKNESS_CONFIG is set to 'sloshing'.

This routine initializes layer positions to set off a sloshing motion in the zonal direction in a rectangular basin. All layers have initially the same thickness but all interfaces (except bottom and sea surface) are displaced according to a half-period cosine, with maximum value on the left and minimum value on the right. This sets off a regular sloshing motion.

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 86 of file sloshing_initialization.F90.

86  type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
87  type(verticalgrid_type), intent(in) :: gv !< The ocean's vertical grid structure.
88  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
89  intent(out) :: h !< The thickness that is being initialized, in m.
90  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
91  !! to parse for model parameter values.
92  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
93  !! only read parameters without changing h.
94 
95  real :: displ(szk_(g)+1)
96  real :: z_unif(szk_(g)+1)
97  real :: z_inter(szk_(g)+1)
98  real :: x
99  real :: a0
100  real :: deltah
101  real :: total_height
102  real :: weight_z
103  real :: x1, y1, x2, y2
104  real :: t
105  logical :: just_read ! If true, just read parameters but set nothing.
106  integer :: n
107 
108  integer :: i, j, k, is, ie, js, je, nx, nz
109 
110  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
111 
112  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
113 
114  if (just_read) return ! This subroutine has no run-time parameters.
115 
116  deltah = g%max_depth / nz
117 
118  ! Define thicknesses
119  do j=g%jsc,g%jec ; do i=g%isc,g%iec
120 
121  ! Define uniform interfaces
122  do k = 0,nz
123  z_unif(k+1) = -real(k)/real(nz)
124  end do
125 
126  ! 1. Define stratification
127  n = 3
128  do k = 1,nz+1
129 
130  ! Thin pycnocline in the middle
131  !z_inter(k) = (2.0**(n-1)) * (z_unif(k) + 0.5)**n - 0.5
132 
133  ! Thin pycnocline in the middle (piecewise linear profile)
134  x1 = 0.30; y1 = 0.48; x2 = 0.70; y2 = 0.52
135 
136  x = -z_unif(k)
137 
138  if ( x .le. x1 ) then
139  t = y1*x/x1;
140  else if ( (x .gt. x1 ) .and. ( x .lt. x2 )) then
141  t = y1 + (y2-y1) * (x-x1) / (x2-x1)
142  else
143  t = y2 + (1.0-y2) * (x-x2) / (1.0-x2)
144  end if
145 
146  t = - z_unif(k)
147 
148  z_inter(k) = -t * g%max_depth
149 
150  end do
151 
152  ! 2. Define displacement
153  a0 = 75.0; ! Displacement amplitude (meters)
154  do k = 1,nz+1
155 
156  weight_z = - 4.0 * ( z_unif(k) + 0.5 )**2 + 1
157 
158  x = g%geoLonT(i,j) / g%len_lon
159  displ(k) = a0 * cos(acos(-1.0)*x) + weight_z;
160 
161  if ( k .EQ. 1 ) then
162  displ(k) = 0.0
163  end if
164 
165  if ( k .EQ. nz+1 ) then
166  displ(k) = 0.0
167  end if
168 
169  z_inter(k) = z_inter(k) + displ(k)
170 
171  end do
172 
173  ! 3. The last interface must coincide with the seabed
174  z_inter(nz+1) = -g%bathyT(i,j)
175 
176  ! Modify interface heights to make sure all thicknesses
177  ! are strictly positive
178  do k = nz,1,-1
179 
180  if ( z_inter(k) .LT. (z_inter(k+1) + gv%Angstrom) ) then
181  z_inter(k) = z_inter(k+1) + gv%Angstrom
182  end if
183 
184  end do
185 
186  ! 4. Define layers
187  total_height = 0.0
188  do k = 1,nz
189  h(i,j,k) = z_inter(k) - z_inter(k+1)
190 
191  total_height = total_height + h(i,j,k)
192  end do
193 
194  enddo ; enddo
195 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19

◆ sloshing_initialize_topography()

subroutine, public sloshing_initialization::sloshing_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 
)

Initialization of topography.

Parameters
[in]gThe dynamic horizontal grid type
[out]dOcean bottom depth in m
[in]param_fileParameter file structure
[in]max_depthMaximum depth of model in m

Definition at line 57 of file sloshing_initialization.F90.

Referenced by mom_fixed_initialization::mom_initialize_topography().

57  type(dyn_horgrid_type), intent(in) :: g !< The dynamic horizontal grid type
58  real, dimension(G%isd:G%ied,G%jsd:G%jed), &
59  intent(out) :: d !< Ocean bottom depth in m
60  type(param_file_type), intent(in) :: param_file !< Parameter file structure
61  real, intent(in) :: max_depth !< Maximum depth of model in m
62 
63  ! Local variables
64  integer :: i, j
65 
66  do i=g%isc,g%iec
67  do j=g%jsc,g%jec
68 
69  d(i,j) = max_depth
70 
71  enddo
72  enddo
73 
Here is the caller graph for this function:

Variable Documentation

◆ mdl

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

Definition at line 48 of file sloshing_initialization.F90.

48 character(len=40) :: mdl = "sloshing_initialization" ! This module's name.