16 implicit none ;
private
18 #include <MOM_memory.h>
38 subroutine bfb_set_coord(Rlay, g_prime, GV, US, param_file, eqn_of_state)
39 real,
dimension(NKMEM_),
intent(out) :: rlay
40 real,
dimension(NKMEM_),
intent(out) :: g_prime
45 type(
eos_type),
pointer :: eqn_of_state
48 real :: drho_dt, sst_s, t_bot, rho_top, rho_bot
50 character(len=40) :: mdl =
"BFB_set_coord"
52 call get_param(param_file, mdl,
"DRHO_DT", drho_dt, &
53 "Rate of change of density with temperature.", &
54 units=
"kg m-3 K-1", default=-0.2, scale=us%kg_m3_to_R)
55 call get_param(param_file, mdl,
"SST_S", sst_s, &
56 "SST at the suothern edge of the domain.", units=
"C", default=20.0)
57 call get_param(param_file, mdl,
"T_BOT", t_bot, &
58 "Bottom Temp", units=
"C", default=5.0)
59 rho_top = gv%Rho0 + drho_dt*sst_s
60 rho_bot = gv%Rho0 + drho_dt*t_bot
64 rlay(k) = (rho_bot - rho_top)/(nz-1)*real(k-1) + rho_top
66 g_prime(k) = (rlay(k) - rlay(k-1)) * gv%g_Earth / (gv%Rho0)
68 g_prime(k) = gv%g_Earth
84 logical,
intent(in) :: use_temperature
89 real,
dimension(NIMEM_, NJMEM_, NKMEM_), &
93 real :: eta(szi_(g),szj_(g),szk_(g)+1)
94 real :: idamp(szi_(g),szj_(g))
97 real :: damp, e_dense, damp_new, slat, wlon, lenlat, lenlon, nlat
98 character(len=40) :: mdl =
"BFB_initialize_sponges_southonly"
99 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
101 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
102 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
104 eta(:,:,:) = 0.0 ; idamp(:,:) = 0.0
112 call get_param(param_file, mdl,
"MINIMUM_DEPTH", min_depth, &
113 "The minimum depth of the ocean.", units=
"m", default=0.0, scale=us%m_to_Z)
115 call get_param(param_file, mdl,
"SOUTHLAT", slat, &
116 "The southern latitude of the domain.", units=
"degrees")
117 call get_param(param_file, mdl,
"LENLAT", lenlat, &
118 "The latitudinal length of the domain.", units=
"degrees")
119 call get_param(param_file, mdl,
"WESTLON", wlon, &
120 "The western longitude of the domain.", units=
"degrees", default=0.0)
121 call get_param(param_file, mdl,
"LENLON", lenlon, &
122 "The longitudinal length of the domain.", units=
"degrees")
124 do k=1,nz ; h0(k) = -g%max_depth * real(k-1) / real(nz) ;
enddo
129 do i=is,ie;
do j=js,je
130 if (g%geoLatT(i,j) < slat+2.0)
then ; damp = 1.0
131 elseif (g%geoLatT(i,j) < slat+4.0)
then
132 damp_new = 1.0*(slat+4.0-g%geoLatT(i,j))/2.0
140 do k = 1,nz; eta(i,j,k) = h0(k);
enddo
154 eta(i,j,nz+1) = -g%max_depth
156 if (g%bathyT(i,j) > min_depth)
then
157 idamp(i,j) = damp/86400.0
158 else ; idamp(i,j) = 0.0 ;
endif
180 #include "version_variable.h"
181 character(len=40) :: mdl =
"BFB_initialization"