76 implicit none ;
private 88 logical :: use_temperature
90 logical :: restorebuoy
106 type(
forcing),
intent(inout) :: fluxes
107 type(time_type),
intent(in) :: day
126 integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq
127 integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
131 call mom_error(fatal,
"User_wind_surface_forcing: " // &
132 "User forcing routine called without modification." )
134 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
135 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
136 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
137 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
147 do j=js,je ;
do i=is-1,ieq
148 fluxes%taux(i,j) = g%mask2dCu(i,j) * 0.0
150 do j=js-1,jeq ;
do i=is,ie
151 fluxes%tauy(i,j) = g%mask2dCv(i,j) * 0.0
156 if (
associated(fluxes%ustar))
then ;
do j=js,je ;
do i=is,ie
158 fluxes%ustar(i,j) = g%mask2dT(i,j) * sqrt(cs%gust_const/cs%Rho0 + &
159 sqrt(0.5*(fluxes%taux(i-1,j)**2 + fluxes%taux(i,j)**2) + &
160 0.5*(fluxes%tauy(i,j-1)**2 + fluxes%tauy(i,j)**2))/cs%Rho0)
161 enddo ;
enddo ;
endif 167 type(
forcing),
intent(inout) :: fluxes
168 type(time_type),
intent(in) :: day
169 real,
intent(in) :: dt
200 real :: Salin_restore
201 real :: density_restore
204 real :: buoy_rest_const
207 integer :: i, j, is, ie, js, je
208 integer :: isd, ied, jsd, jed
210 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
211 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
215 call mom_error(fatal,
"User_buoyancy_surface_forcing: " // &
216 "User forcing routine called without modification." )
220 if (cs%use_temperature)
then 239 if ( cs%use_temperature )
then 242 do j=js,je ;
do i=is,ie
245 fluxes%evap(i,j) = -0.0 * g%mask2dT(i,j)
246 fluxes%lprec(i,j) = 0.0 * g%mask2dT(i,j)
249 fluxes%vprec(i,j) = 0.0
252 fluxes%lw(i,j) = 0.0 * g%mask2dT(i,j)
253 fluxes%latent(i,j) = 0.0 * g%mask2dT(i,j)
254 fluxes%sens(i,j) = 0.0 * g%mask2dT(i,j)
255 fluxes%sw(i,j) = 0.0 * g%mask2dT(i,j)
258 do j=js,je ;
do i=is,ie
261 fluxes%buoy(i,j) = 0.0 * g%mask2dT(i,j)
265 if (cs%restorebuoy)
then 266 if (cs%use_temperature)
then 270 call mom_error(fatal,
"User_buoyancy_surface_forcing: " // &
271 "Temperature and salinity restoring used without modification." )
273 rhoxcp = cs%Rho0 * fluxes%C_p
274 do j=js,je ;
do i=is,ie
280 fluxes%heat_added(i,j) = (g%mask2dT(i,j) * (rhoxcp * cs%Flux_const)) * &
281 (temp_restore - state%SST(i,j))
282 fluxes%vprec(i,j) = - (g%mask2dT(i,j) * (cs%Rho0*cs%Flux_const)) * &
283 ((salin_restore - state%SSS(i,j)) / &
284 (0.5 * (salin_restore + state%SSS(i,j))))
289 call mom_error(fatal,
"User_buoyancy_surface_forcing: " // &
290 "Buoyancy restoring used without modification." )
293 buoy_rest_const = -1.0 * (cs%G_Earth * cs%Flux_const) / cs%Rho0
294 do j=js,je ;
do i=is,ie
297 density_restore = 1030.0
299 fluxes%buoy(i,j) = g%mask2dT(i,j) * buoy_rest_const * &
300 (density_restore - state%sfc_density(i,j))
311 real,
pointer :: ptr(:,:)
312 integer :: isd, ied, jsd, jed
313 if (.not.
ASSOCIATED(ptr))
then 314 allocate(ptr(isd:ied,jsd:jed))
320 type(time_type),
intent(in) :: Time
323 type(
diag_ctrl),
target,
intent(in) :: diag
334 #include "version_variable.h" 335 character(len=40) :: mdl =
"user_surface_forcing" 337 if (
associated(cs))
then 338 call mom_error(warning,
"USER_surface_forcing_init called with an associated "// &
339 "control structure.")
347 call get_param(param_file, mdl,
"ENABLE_THERMODYNAMICS", cs%use_temperature, &
348 "If true, Temperature and salinity are used as state \n"//&
349 "variables.", default=.true.)
351 call get_param(param_file, mdl,
"G_EARTH", cs%G_Earth, &
352 "The gravitational acceleration of the Earth.", &
353 units=
"m s-2", default = 9.80)
354 call get_param(param_file, mdl,
"RHO_0", cs%Rho0, &
355 "The mean ocean density used with BOUSSINESQ true to \n"//&
356 "calculate accelerations and the mass for conservation \n"//&
357 "properties, or with BOUSSINSEQ false to convert some \n"//&
358 "parameters from vertical units of m to kg m-2.", &
359 units=
"kg m-3", default=1035.0)
360 call get_param(param_file, mdl,
"GUST_CONST", cs%gust_const, &
361 "The background gustiness in the winds.", units=
"Pa", &
364 call get_param(param_file, mdl,
"RESTOREBUOY", cs%restorebuoy, &
365 "If true, the buoyancy fluxes drive the model back \n"//&
366 "toward some specified surface state with a rate \n"//&
367 "given by FLUXCONST.", default= .false.)
368 if (cs%restorebuoy)
then 369 call get_param(param_file, mdl,
"FLUXCONST", cs%Flux_const, &
370 "The constant that relates the restoring surface fluxes \n"//&
371 "to the relative surface anomalies (akin to a piston \n"//&
372 "velocity). Note the non-MKS units.", units=
"m day-1", &
373 fail_if_missing=.true.)
375 cs%Flux_const = cs%Flux_const / 86400.0
The following structure contains pointers to various fields which may be used describe the surface st...
This module implements boundary forcing for MOM6.
Ocean grid type. See mom_grid for details.
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.
This module contains I/O framework code.
subroutine alloc_if_needed(ptr, isd, ied, jsd, jed)
subroutine, public call_tracer_set_forcing(state, fluxes, day_start, day_interval, G, CS)
This subroutine calls the individual tracer modules' subroutines to specify or read quantities relate...
logical function, public is_root_pe()
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
subroutine, public user_surface_forcing_init(Time, G, param_file, diag, CS)
subroutine, public user_buoyancy_forcing(state, fluxes, day, dt, G, CS)
subroutine, public user_wind_forcing(state, fluxes, day, G, CS)
subroutine, public mom_error(level, message, all_print)