16 implicit none ;
private 18 #include <MOM_memory.h> 29 logical :: usewindstress
30 logical :: useheatflux
31 logical :: useevaporation
32 logical :: usediurnalsw
42 #include "version_variable.h" 44 character(len=40) ::
mdl =
"SCM_CVmix_tests" 50 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(out) :: T
51 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(out) :: S
52 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(in) :: h
56 logical,
optional,
intent(in) :: just_read_params
59 real :: eta(szk_(g)+1)
60 real :: UpperLayerTempMLD
61 real :: UpperLayerSaltMLD
62 real :: UpperLayerTemp
63 real :: UpperLayerSalt
64 real :: LowerLayerTemp
65 real :: LowerLayerSalt
66 real :: LowerLayerdTdz
67 real :: LowerLayerdSdz
70 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
72 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
73 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
76 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
79 call get_param(param_file,
mdl,
"SCM_TEMP_MLD",upperlayertempmld, &
80 'Initial temp mixed layer depth', units=
'm',default=0.0, do_not_log=just_read)
81 call get_param(param_file,
mdl,
"SCM_SALT_MLD",upperlayersaltmld, &
82 'Initial salt mixed layer depth', units=
'm',default=0.0, do_not_log=just_read)
83 call get_param(param_file,
mdl,
"SCM_L1_SALT",upperlayersalt, &
84 'Layer 2 surface salinity', units=
'1e-3',default=35.0, do_not_log=just_read)
85 call get_param(param_file,
mdl,
"SCM_L1_TEMP",upperlayertemp, &
86 'Layer 1 surface temperature', units=
'C', default=20.0, do_not_log=just_read)
87 call get_param(param_file,
mdl,
"SCM_L2_SALT",lowerlayersalt, &
88 'Layer 2 surface salinity', units=
'1e-3',default=35.0, do_not_log=just_read)
89 call get_param(param_file,
mdl,
"SCM_L2_TEMP",lowerlayertemp, &
90 'Layer 2 surface temperature', units=
'C', default=20.0, do_not_log=just_read)
91 call get_param(param_file,
mdl,
"SCM_L2_DTDZ",lowerlayerdtdz, &
92 'Initial temperature stratification in layer 2', &
93 units=
'C/m', default=0.00, do_not_log=just_read)
94 call get_param(param_file,
mdl,
"SCM_L2_DSDZ",lowerlayerdsdz, &
95 'Initial salinity stratification in layer 2', &
96 units=
'PPT/m', default=0.00, do_not_log=just_read)
100 do j=js,je ;
do i=is,ie
103 eta(k+1) = eta(k) - h(i,j,k)*gv%H_to_m
104 zc = 0.5*( eta(k) + eta(k+1) )
105 dz = min(0., zc+upperlayertempmld)
107 t(i,j,k) = upperlayertemp
109 t(i,j,k) = lowerlayertemp + lowerlayerdtdz * dz
111 dz = min(0., zc+upperlayersaltmld)
113 s(i,j,k) = upperlayersalt
115 s(i,j,k) = lowerlayersalt + lowerlayerdsdz * dz
124 type(time_type),
intent(in) :: Time
130 #include "version_variable.h" 132 if (
associated(cs))
then 133 call mom_error(fatal,
"SCM_CVmix_tests_surface_forcing_init called with an associated "// &
134 "control structure.")
141 call get_param(param_file,
mdl,
"SCM_USE_WIND_STRESS", &
142 cs%UseWindStress,
"Wind Stress switch "// &
143 "used in the SCM CVmix surface forcing.", &
144 units=
'', default=.false.)
146 cs%UseHeatFlux,
"Heat flux switch "// &
147 "used in the SCM CVmix test surface forcing.", &
148 units=
'', default=.false.)
149 call get_param(param_file,
mdl,
"SCM_USE_EVAPORATION", &
150 cs%UseEvaporation,
"Evaporation switch "// &
151 "used in the SCM CVmix test surface forcing.", &
152 units=
'', default=.false.)
154 cs%UseDiurnalSW,
"Diurnal sw radation switch "// &
155 "used in the SCM CVmix test surface forcing.", &
156 units=
'', default=.false.)
157 if (cs%UseWindStress)
then 159 cs%tau_x,
"Constant X-dir wind stress "// &
160 "used in the SCM CVmix test surface forcing.", &
161 units=
'N/m2', fail_if_missing=.true.)
163 cs%tau_y,
"Constant y-dir wind stress "// &
164 "used in the SCM CVmix test surface forcing.", &
165 units=
'N/m2', fail_if_missing=.true.)
167 if (cs%UseHeatFlux)
then 169 cs%surf_HF,
"Constant surface heat flux "// &
170 "used in the SCM CVmix test surface forcing.", &
171 units=
'm K/s', fail_if_missing=.true.)
173 if (cs%UseEvaporation)
then 175 cs%surf_evap,
"Constant surface evaporation "// &
176 "used in the SCM CVmix test surface forcing.", &
177 units=
'm/s', fail_if_missing=.true.)
179 if (cs%UseDiurnalSW)
then 181 cs%Max_sw,
"Maximum diurnal sw radiation "// &
182 "used in the SCM CVmix test surface forcing.", &
183 units=
'm K/s', fail_if_missing=.true.)
190 type(
forcing),
intent(inout) :: fluxes
191 type(time_type),
intent(in) :: day
195 integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq
196 integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
199 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
200 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
201 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
202 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
207 do j=js,je ;
do i=isq,ieq
208 fluxes%taux(i,j) = cs%tau_x
210 do j=jsq,jeq ;
do i=is,ie
211 fluxes%tauy(i,j) = cs%tau_y
213 mag_tau = sqrt(cs%tau_x*cs%tau_x + cs%tau_y*cs%tau_y)
214 if (
associated(fluxes%ustar))
then ;
do j=js,je ;
do i=is,ie
215 fluxes%ustar(i,j) = sqrt( mag_tau / cs%Rho0 )
216 enddo ;
enddo ;
endif 223 type(
forcing),
intent(inout) :: fluxes
224 type(time_type),
intent(in) :: day
229 integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq
230 integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
236 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
237 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
238 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
239 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
244 if (cs%UseHeatFlux)
then 248 do j=jsq,jeq ;
do i=is,ie
249 fluxes%sens(i,j) = cs%surf_HF * cs%Rho0 * fluxes%C_p
253 if (cs%UseEvaporation)
then 254 do j=jsq,jeq ;
do i=is,ie
258 fluxes%evap(i,j) = cs%surf_evap * cs%Rho0
262 if (cs%UseDiurnalSW)
then 263 do j=jsq,jeq ;
do i=is,ie
268 fluxes%sw(i,j) = cs%Max_sw * max(0.0,cos(2*pi* &
269 (time_type_to_real(day)/86400.-0.5))) * cs%RHO0 * fluxes%C_p
The following structure contains pointers to various fields which may be used describe the surface st...
This module implements boundary forcing for MOM6.
subroutine, public scm_cvmix_tests_ts_init(T, S, h, G, GV, param_file, just_read_params)
Initializes temperature and salinity for the SCM CVmix test example.
Ocean grid type. See mom_grid for details.
subroutine, public scm_cvmix_tests_wind_forcing(state, fluxes, day, G, CS)
Provides the ocean grid type.
subroutine, public allocate_forcing_type(G, fluxes, stress, ustar, water, heat, shelf, press, iceberg)
Conditionally allocate fields within the forcing type.
subroutine, public scm_cvmix_tests_surface_forcing_init(Time, G, param_file, CS)
Initializes surface forcing for the CVmix test case suite.
subroutine, public scm_cvmix_tests_buoyancy_forcing(state, fluxes, day, G, CS)
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
Initial conditions and forcing for the single column model (SCM) CVmix test set.
subroutine, public mom_error(level, message, all_print)
Container for surface forcing parameters.