30 use mom_io, only : write_field, slasher
37 implicit none ;
private 39 #include <MOM_memory.h> 48 character(len=40) ::
mdl =
"sloshing_initialization" 58 real,
dimension(G%isd:G%ied,G%jsd:G%jed), &
61 real,
intent(in) :: max_depth
88 real,
dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
92 logical,
optional,
intent(in) :: just_read_params
95 real :: displ(szk_(g)+1)
96 real :: z_unif(szk_(g)+1)
97 real :: z_inter(szk_(g)+1)
103 real :: x1, y1, x2, y2
108 integer :: i, j, k, is, ie, js, je, nx, nz
110 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
112 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
114 if (just_read)
return 116 deltah = g%max_depth / nz
119 do j=g%jsc,g%jec ;
do i=g%isc,g%iec
123 z_unif(k+1) = -
real(k)/
real(nz)
134 x1 = 0.30; y1 = 0.48; x2 = 0.70; y2 = 0.52
138 if ( x .le. x1 )
then 140 else if ( (x .gt. x1 ) .and. ( x .lt. x2 ))
then 141 t = y1 + (y2-y1) * (x-x1) / (x2-x1)
143 t = y2 + (1.0-y2) * (x-x2) / (1.0-x2)
148 z_inter(k) = -t * g%max_depth
156 weight_z = - 4.0 * ( z_unif(k) + 0.5 )**2 + 1
158 x = g%geoLonT(i,j) / g%len_lon
159 displ(k) = a0 * cos(acos(-1.0)*x) + weight_z;
165 if ( k .EQ. nz+1 )
then 169 z_inter(k) = z_inter(k) + displ(k)
174 z_inter(nz+1) = -g%bathyT(i,j)
180 if ( z_inter(k) .LT. (z_inter(k+1) + gv%Angstrom) )
then 181 z_inter(k) = z_inter(k+1) + gv%Angstrom
189 h(i,j,k) = z_inter(k) - z_inter(k+1)
191 total_height = total_height + h(i,j,k)
207 eqn_of_state, just_read_params)
209 real,
dimension(SZI_(G),SZJ_(G), SZK_(G)),
intent(out) :: T
210 real,
dimension(SZI_(G),SZJ_(G), SZK_(G)),
intent(out) :: S
211 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
219 integer :: i, j, k, is, ie, js, je, nz
220 real :: delta_S, delta_T
221 real :: S_ref, T_ref;
223 real :: S_range, T_range;
229 character(len=40) :: mdl =
"initialize_temp_salt_linear" 232 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
234 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
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)
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)
248 if (just_read)
return 258 deltah = g%max_depth / nz;
259 do j=js,je ;
do i=is,ie
262 xi1 = xi0 + deltah / g%max_depth
263 s(i,j,k) = 34.0 + 0.5 * s_range * (xi0 + xi1)
269 delta_t = t_range / ( g%ke - 1.0 )
273 t(:,:,k) = t(:,:,k-1) + delta_t
276 t(:,:,g%ke/2 - (kdelta-1):g%ke/2 + kdelta) = 1.0
subroutine, public read_axis_data(filename, axis_name, var)
Ocean grid type. See mom_grid for details.
Calculates density of sea water from T, S and P.
Provides the ocean grid type.
This module contains I/O framework code.
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'...
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 sloshing_initialize_temperature_salinity(T, S, h, G, param_file, eqn_of_state, just_read_params)
Initialization of temperature and salinity.
subroutine, public set_up_sponge_field(sp_val, f_ptr, G, nlay, CS, sp_val_i_mean)
Type to carry basic tracer information.
logical function, public is_root_pe()
The module configures the model for the non-rotating sloshing test case.
subroutine, public mom_mesg(message, verb, all_print)
Provides subroutines for quantities specific to the equation of state.
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
subroutine, public mom_error(level, message, all_print)
subroutine, public sloshing_initialize_topography(D, G, param_file, max_depth)
Initialization of topography.
A control structure for the equation of state.