35 implicit none ;
private 37 #include <MOM_memory.h> 50 real,
dimension(G%isd:G%ied,G%jsd:G%jed), &
53 real,
intent(in) :: max_depth
57 #include "version_variable.h" 58 character(len=40) :: mdl =
"DOME_initialize_topography" 59 integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
60 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
61 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
63 call mom_mesg(
" DOME_initialization.F90, DOME_initialize_topography: setting topography", 5)
66 call get_param(param_file, mdl,
"MINIMUM_DEPTH", min_depth, &
67 "The minimum depth of the ocean.", units=
"m", default=0.0)
69 do j=js,je ;
do i=is,ie
70 if (g%geoLatT(i,j) < 600.0)
then 71 if (g%geoLatT(i,j) < 300.0)
then 74 d(i,j)=max_depth-10.0*(g%geoLatT(i,j)-300.0)
77 if ((g%geoLonT(i,j) > 1000.0).AND.(g%geoLonT(i,j) < 1100.0))
then 84 if (d(i,j) > max_depth) d(i,j) = max_depth
85 if (d(i,j) < min_depth) d(i,j) = 0.5*min_depth
96 real,
dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
100 logical,
optional,
intent(in) :: just_read_params
103 real :: e0(szk_(gv)+1)
105 real :: eta1D(szk_(gv)+1)
108 character(len=40) :: mdl =
"DOME_initialize_thickness" 109 integer :: i, j, k, is, ie, js, je, nz
111 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
113 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
115 if (just_read)
return 117 call mom_mesg(
" DOME_initialization.F90, DOME_initialize_thickness: setting thickness", 5)
121 e0(k) = -g%max_depth * (
real(k-1)-0.5)/
real(nz-1)
124 do j=g%jsc,g%jec ;
do i=g%isc,g%iec
130 eta1d(nz+1) = -1.0*g%bathyT(i,j)
133 if (eta1d(k) < (eta1d(k+1) + gv%Angstrom_z))
then 134 eta1d(k) = eta1d(k+1) + gv%Angstrom_z
135 h(i,j,k) = gv%Angstrom_z
137 h(i,j,k) = eta1d(k) - eta1d(k+1)
162 real :: eta(szi_(g),szj_(g),szk_(g)+1)
163 real :: temp(szi_(g),szj_(g),szk_(g))
164 real :: Idamp(szi_(g),szj_(g))
168 real :: damp, e_dense, damp_new
169 character(len=40) :: mdl =
"DOME_initialize_sponges" 170 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
172 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
173 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
175 eta(:,:,:) = 0.0 ; temp(:,:,:) = 0.0 ; idamp(:,:) = 0.0
183 call get_param(pf, mdl,
"MINIMUM_DEPTH", min_depth, &
184 "The minimum depth of the ocean.", units=
"m", default=0.0)
187 do k=2,nz ; h0(k) = -(
real(k-1)-0.5)*g%max_depth/
real(nz-1) ; enddo
188 do i=is,ie;
do j=js,je
189 if (g%geoLonT(i,j) < 100.0)
then ; damp = 10.0
190 elseif (g%geoLonT(i,j) < 200.0)
then 191 damp = 10.0*(200.0-g%geoLonT(i,j))/100.0
195 if (g%geoLonT(i,j) > 1400.0)
then ; damp_new = 10.0
196 elseif (g%geoLonT(i,j) > 1300.0)
then 197 damp_new = 10.0*(g%geoLonT(i,j)-1300.0)/100.0
198 else ; damp_new = 0.0
201 if (damp <= damp_new) damp=damp_new
208 e_dense = -g%bathyT(i,j)
209 if (e_dense >= h0(k))
then ; eta(i,j,k) = e_dense
210 else ; eta(i,j,k) = h0(k) ;
endif 211 if (eta(i,j,k) < gv%Angstrom_z*(nz-k+1)-g%bathyT(i,j)) &
212 eta(i,j,k) = gv%Angstrom_z*(nz-k+1)-g%bathyT(i,j)
214 eta(i,j,nz+1) = -g%bathyT(i,j)
216 if (g%bathyT(i,j) > min_depth)
then 217 idamp(i,j) = damp/86400.0
218 else ; idamp(i,j) = 0.0 ;
endif 233 if (
associated(tv%T) )
then 234 call mom_error(fatal,
"DOME_initialize_sponges is not set up for use with"//&
235 " a temperatures defined.")
260 real,
pointer,
dimension(:,:,:) :: &
264 real :: T0(szk_(g)), S0(szk_(g))
265 real :: pres(szk_(g))
266 real :: drho_dT(szk_(g))
267 real :: drho_dS(szk_(g))
268 real :: rho_guess(szk_(g))
270 real :: tr_0, y1, y2, tr_k, rst, rsb, rc, v_k, lon_im1
278 character(len=40) :: mdl =
"DOME_set_OBC_data" 279 integer :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, nz
280 integer :: IsdB, IedB, JsdB, JedB
283 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
284 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
285 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
292 if (.not.
associated(obc))
return 294 g_prime_tot = (gv%g_Earth/gv%Rho0)*2.0
295 def_rad = sqrt(d_edge*g_prime_tot) / (1.0e-4*1000.0)
296 tr_0 = (-d_edge*sqrt(d_edge*g_prime_tot)*0.5e3*def_rad) * gv%m_to_H
298 if (obc%number_of_segments .ne. 1)
then 299 print *,
'Error in DOME OBC segment setup' 302 segment => obc%segment(1)
303 if (.not. segment%on_pe)
return 307 if (k>1) rst = -1.0 + (
real(k-1)-0.5)/
real(nz-1)
310 if (k<nz) rsb = -1.0 + (
real(k-1)+0.5)/
real(nz-1)
311 rc = -1.0 +
real(k-1)/
real(nz-1)
314 y1 = (2.0*ri_trans*rst + ri_trans + 2.0)/(2.0 - ri_trans)
315 y2 = (2.0*ri_trans*rsb + ri_trans + 2.0)/(2.0 - ri_trans)
316 tr_k = tr_0 * (2.0/(ri_trans*(2.0-ri_trans))) * &
317 ((log(y1)+1.0)/y1 - (log(y2)+1.0)/y2)
318 v_k = -sqrt(d_edge*g_prime_tot)*log((2.0 + ri_trans*(1.0 + 2.0*rc)) / &
320 if (k == nz) tr_k = tr_k + tr_0 * (2.0/(ri_trans*(2.0+ri_trans))) * &
321 log((2.0+ri_trans)/(2.0-ri_trans))
323 isd = segment%HI%isd ; ied = segment%HI%ied
324 jsdb = segment%HI%JsdB ; jedb = segment%HI%JedB
325 do j=jsdb,jedb ;
do i=isd,ied
326 lon_im1 = 2.0*g%geoLonCv(i,j) - g%geoLonBu(i,j)
327 segment%normal_trans(i,j,k) = tr_k * (exp(-2.0*(lon_im1 - 1000.0)/def_rad) -&
328 exp(-2.0*(g%geoLonBu(i,j) - 1000.0)/def_rad))
329 segment%normal_vel(i,j,k) = v_k * exp(-2.0*(g%geoLonCv(i,j) - 1000.0)/def_rad)
335 if (
associated(tv%S))
then 339 if (
associated(tv%T))
then 343 pres(:) = tv%P_Ref ; s0(:) = 35.0 ; t0(1) = 25.0
347 do k=1,nz ; t0(k) = t0(1) + (gv%Rlay(k)-rho_guess(1)) / drho_dt(1) ;
enddo 351 do k=1,nz ; t0(k) = t0(k) + (gv%Rlay(k)-rho_guess(k)) / drho_dt(k) ;
enddo 354 allocate(obc_t_v(isd:ied,jsdb:jedb,nz))
355 do k=1,nz ;
do j=jsdb,jedb ;
do i=isd,ied
356 obc_t_v(i,j,k) = t0(k)
357 enddo ;
enddo ;
enddo
Ocean grid type. See mom_grid for details.
Calculates density of sea water from T, S and P.
Provides the ocean grid type.
Open boundary segment data structure.
subroutine, public dome_initialize_thickness(h, G, GV, param_file, just_read_params)
This subroutine initializes layer thicknesses for the DOME experiment.
integer, parameter, public obc_simple
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.
logical function, public is_root_pe()
subroutine, public add_tracer_obc_values(name, Reg, OBC_inflow, OBC_in_u, OBC_in_v)
This subroutine adds open boundary condition concentrations for a tracer that has previously been reg...
subroutine, public dome_initialize_topography(D, G, param_file, max_depth)
This subroutine sets up the DOME topography.
subroutine, public dome_initialize_sponges(G, GV, tv, PF, CSp)
This subroutine sets the inverse restoration time (Idamp), and ! the values towards which the interfa...
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 ...
integer, parameter, public obc_none
Controls where open boundary conditions are applied.
subroutine, public dome_set_obc_data(OBC, tv, G, GV, param_file, tr_Reg)
This subroutine sets the properties of flow at open boundary conditions. This particular example is f...
The module configures the model for the "DOME" experiment. DOME = Dynamics of Overflows and Mixing Ex...
subroutine, public mom_error(level, message, all_print)
A control structure for the equation of state.