40 implicit none ;
private 42 #include <MOM_memory.h> 44 character(len=40) ::
mdl =
"seamount_initialization" 62 real,
dimension(G%isd:G%ied,G%jsd:G%jed), &
65 real,
intent(in) :: max_depth
69 real :: x, y, delta, Lx, rLx, Ly, rLy
72 "Non-dimensional height of seamount.", &
73 units=
"non-dim", default=0.5)
74 call get_param(param_file,
mdl,
"SEAMOUNT_X_LENGTH_SCALE",lx, &
75 "Length scale of seamount in x-direction.\n"//&
76 "Set to zero make topography uniform in the x-direction.", &
77 units=
"Same as x,y", default=20.)
78 call get_param(param_file,
mdl,
"SEAMOUNT_Y_LENGTH_SCALE",ly, &
79 "Length scale of seamount in y-direction.\n"//&
80 "Set to zero make topography uniform in the y-direction.", &
81 units=
"Same as x,y", default=0.)
85 rlx = 0. ;
if (lx>0.) rlx = 1. / lx
86 rly = 0. ;
if (ly>0.) rly = 1. / ly
90 x = ( g%geoLonT(i,j) - g%west_lon ) / g%len_lon - 0.5
91 y = ( g%geoLatT(i,j) - g%south_lat ) / g%len_lat - 0.5
92 d(i,j) = g%max_depth * ( 1.0 - delta * exp(-(rlx*x)**2 -(rly*y)**2) )
103 real,
dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
107 logical,
optional,
intent(in) :: just_read_params
110 real :: e0(szk_(g)+1)
112 real :: eta1D(szk_(g)+1)
114 integer :: i, j, k, is, ie, js, je, nz
117 real :: min_thickness, S_surf, S_range, S_ref, S_light, S_dense
118 character(len=20) :: verticalCoordinate
121 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
123 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
125 if (.not.just_read) &
126 call mom_mesg(
"MOM_initialization.F90, initialize_thickness_uniform: setting thickness")
128 call get_param(param_file,
mdl,
"MIN_THICKNESS",min_thickness, &
129 'Minimum thickness for layer',&
130 units=
'm', default=1.0e-3, do_not_log=just_read)
131 call get_param(param_file,
mdl,
"REGRIDDING_COORDINATE_MODE",verticalcoordinate, &
132 default=default_coordinate_mode, do_not_log=just_read)
145 select case ( coordinatemode(verticalcoordinate) )
148 call get_param(param_file,
mdl,
"INITIAL_SSS", s_surf, default=34., do_not_log=.true.)
149 call get_param(param_file,
mdl,
"INITIAL_S_RANGE", s_range, default=2., do_not_log=.true.)
150 call get_param(param_file,
mdl,
"S_REF", s_ref, default=35.0, do_not_log=.true.)
151 call get_param(param_file,
mdl,
"TS_RANGE_S_LIGHT", s_light, default = s_ref, do_not_log=.true.)
152 call get_param(param_file,
mdl,
"TS_RANGE_S_DENSE", s_dense, default = s_ref, do_not_log=.true.)
153 if (just_read)
return 162 e0(k) = - g%max_depth * ( ( s_light - s_surf ) + ( s_dense - s_light ) * ( (
real(k)-1.5) /
real(nz-1) ) ) / s_range
163 e0(k) = nint(2048.*e0(k))/2048.
164 e0(k) = min(
real(1-k)*GV%Angstrom_z, e0(k))
165 e0(k) = max(-g%max_depth, e0(k))
167 do j=js,je ;
do i=is,ie
168 eta1d(nz+1) = -1.0*g%bathyT(i,j)
171 if (eta1d(k) < (eta1d(k+1) + gv%Angstrom_z))
then 172 eta1d(k) = eta1d(k+1) + gv%Angstrom_z
173 h(i,j,k) = gv%Angstrom_z
175 h(i,j,k) = eta1d(k) - eta1d(k+1)
180 case ( regridding_zstar )
181 if (just_read)
return 182 do j=js,je ;
do i=is,ie
183 eta1d(nz+1) = -1.0*g%bathyT(i,j)
185 eta1d(k) = -g%max_depth *
real(k-1) /
real(nz)
186 if (eta1d(k) < (eta1d(k+1) + min_thickness))
then 187 eta1d(k) = eta1d(k+1) + min_thickness
188 h(i,j,k) = min_thickness
190 h(i,j,k) = eta1d(k) - eta1d(k+1)
196 if (just_read)
return 197 do j=js,je ;
do i=is,ie
198 delta_h = g%bathyT(i,j) / dfloat(nz)
208 eqn_of_state, just_read_params)
211 real,
dimension(SZI_(G),SZJ_(G), SZK_(G)),
intent(out) :: T
212 real,
dimension(SZI_(G),SZJ_(G), SZK_(G)),
intent(out) :: S
213 real,
dimension(SZI_(G),SZJ_(G), SZK_(G)),
intent(in) :: h
215 type(
eos_type),
pointer :: eqn_of_state
216 logical,
optional,
intent(in) :: just_read_params
220 integer :: i, j, k, is, ie, js, je, nz, k_light
221 real :: xi0, xi1, dxi, r, S_surf, T_surf, S_range, T_range
222 real :: T_ref, T_Light, T_Dense, S_ref, S_Light, S_Dense, a1, frac_dense, k_frac, res_rat
224 character(len=20) :: verticalCoordinate, density_profile
226 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
228 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
230 call get_param(param_file,
mdl,
"REGRIDDING_COORDINATE_MODE", verticalcoordinate, &
231 default=default_coordinate_mode, do_not_log=just_read)
232 call get_param(param_file,
mdl,
"INITIAL_DENSITY_PROFILE", density_profile, &
233 'Initial profile shape. Valid values are "linear", "parabolic"\n'// &
234 'and "exponential".', default=
'linear', do_not_log=just_read)
236 'Initial surface salinity', units=
'1e-3', default=34., do_not_log=just_read)
238 'Initial surface temperature', units=
'C', default=0., do_not_log=just_read)
239 call get_param(param_file,
mdl,
"INITIAL_S_RANGE", s_range, &
240 'Initial salinity range (bottom - surface)', units=
'1e-3', &
241 default=2., do_not_log=just_read)
242 call get_param(param_file,
mdl,
"INITIAL_T_RANGE", t_range, &
243 'Initial temperature range (bottom - surface)', units=
'C', &
244 default=0., do_not_log=just_read)
246 select case ( coordinatemode(verticalcoordinate) )
247 case ( regridding_layer )
249 call get_param(param_file,
mdl,
"T_REF", t_ref, default=10.0, do_not_log=.true.)
250 call get_param(param_file,
mdl,
"TS_RANGE_T_LIGHT", t_light, default=t_ref, do_not_log=.true.)
251 call get_param(param_file,
mdl,
"TS_RANGE_T_DENSE", t_dense, default=t_ref, do_not_log=.true.)
252 call get_param(param_file,
mdl,
"S_REF", s_ref, default=35.0, do_not_log=.true.)
253 call get_param(param_file,
mdl,
"TS_RANGE_S_LIGHT", s_light, default = s_ref, do_not_log=.true.)
254 call get_param(param_file,
mdl,
"TS_RANGE_S_DENSE", s_dense, default = s_ref, do_not_log=.true.)
255 call get_param(param_file,
mdl,
"TS_RANGE_RESOLN_RATIO", res_rat, default=1.0, do_not_log=.true.)
256 if (just_read)
return 259 k_light = gv%nk_rho_varies + 1
260 do j=js,je ;
do i=is,ie
261 t(i,j,k_light) = t_light ; s(i,j,k_light) = s_light
263 a1 = 2.0 * res_rat / (1.0 + res_rat)
265 k_frac =
real(k-k_light)/
real(nz-k_light)
266 frac_dense = a1 * k_frac + (1.0 - a1) * k_frac**2
267 do j=js,je ;
do i=is,ie
268 t(i,j,k) = frac_dense * (t_dense - t_light) + t_light
269 s(i,j,k) = frac_dense * (s_dense - s_light) + s_light
273 if (just_read)
return 274 do j=js,je ;
do i=is,ie
277 xi1 = xi0 + h(i,j,k) / g%max_depth
278 select case ( trim(density_profile) )
281 s(i,j,k) = s_surf + ( 0.5 * s_range ) * (xi0 + xi1)
282 t(i,j,k) = t_surf + t_range * 0.5 * (xi0 + xi1)
284 s(i,j,k) = s_surf + s_range * (2.0 / 3.0) * (xi1**3 - xi0**3) / (xi1 - xi0)
285 t(i,j,k) = t_surf + t_range * (2.0 / 3.0) * (xi1**3 - xi0**3) / (xi1 - xi0)
287 s(i,j,k) = s_surf + s_range * (exp(xi1/r)-exp(xi0/r)) / (xi1 - xi0)
288 t(i,j,k) = t_surf + t_range * (exp(xi1/r)-exp(xi0/r)) / (xi1 - xi0)
290 call mom_error(fatal,
'Unknown value for "INITIAL_DENSITY_PROFILE"')
integer, parameter regridding_layer
Layer mode.
subroutine, public read_axis_data(filename, axis_name, var)
integer function coordinatemode(string)
Parse a string parameter specifying the coordinate mode and return the appropriate enumerated integer...
integer, parameter regridding_sigma
Sigma coordinates.
subroutine, public seamount_initialize_topography(D, G, param_file, max_depth)
Initialization of topography.
Ocean grid type. See mom_grid for details.
Calculates density of sea water from T, S and P.
Provides the ocean grid type.
character(len= *), parameter default_coordinate_mode
Default coordinate mode.
This module contains I/O framework code.
This module contains the tracer_registry_type and the subroutines that handle registration of tracers...
subroutine, public calculate_density_derivs(T, S, pressure, drho_dT, drho_dS, start, npts, EOS)
Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.
subroutine, public initialize_sponge(Iresttime, int_height, G, param_file, CS, Iresttime_i_mean, int_height_i_mean)
subroutine, public set_up_sponge_field(sp_val, f_ptr, G, nlay, CS, sp_val_i_mean)
Type to carry basic tracer information.
subroutine, public seamount_initialize_thickness(h, G, GV, param_file, just_read_params)
Initialization of thicknesses. This subroutine initializes the layer thicknesses to be uniform...
logical function, public is_root_pe()
subroutine, public mom_mesg(message, verb, all_print)
Provides subroutines for quantities specific to the equation of state.
Type for describing a variable, typically a tracer.
integer, parameter regridding_zstar
z* coordinates
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
Contains constants for interpreting input parameters that control regridding.
subroutine, public mom_error(level, message, all_print)
integer, parameter regridding_rho
Target interface densities.
subroutine, public seamount_initialize_temperature_salinity(T, S, h, G, GV, param_file, eqn_of_state, just_read_params)
Initial values for temperature and salinity.
The module configures the model for the idealized seamount test case.
A control structure for the equation of state.