Bouyancy forcing for the boundary-forced-basin (BFB) configuration.
51 type(surface),
intent(inout) :: sfc_state
53 type(forcing),
intent(inout) :: fluxes
56 type(time_type),
intent(in) :: day
57 real,
intent(in) :: dt
59 type(ocean_grid_type),
intent(in) :: G
60 type(unit_scale_type),
intent(in) :: US
61 type(BFB_surface_forcing_CS),
pointer :: CS
67 real :: density_restore
71 real :: buoy_rest_const
73 integer :: i, j, is, ie, js, je
74 integer :: isd, ied, jsd, jed
76 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
77 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
81 if (cs%use_temperature)
then 82 call safe_alloc_ptr(fluxes%evap, isd, ied, jsd, jed)
83 call safe_alloc_ptr(fluxes%lprec, isd, ied, jsd, jed)
84 call safe_alloc_ptr(fluxes%fprec, isd, ied, jsd, jed)
85 call safe_alloc_ptr(fluxes%lrunoff, isd, ied, jsd, jed)
86 call safe_alloc_ptr(fluxes%frunoff, isd, ied, jsd, jed)
87 call safe_alloc_ptr(fluxes%vprec, isd, ied, jsd, jed)
89 call safe_alloc_ptr(fluxes%sw, isd, ied, jsd, jed)
90 call safe_alloc_ptr(fluxes%lw, isd, ied, jsd, jed)
91 call safe_alloc_ptr(fluxes%latent, isd, ied, jsd, jed)
92 call safe_alloc_ptr(fluxes%sens, isd, ied, jsd, jed)
94 call safe_alloc_ptr(fluxes%buoy, isd, ied, jsd, jed)
97 if ( cs%use_temperature )
then 100 do j=js,je ;
do i=is,ie
103 fluxes%evap(i,j) = -0.0 * g%mask2dT(i,j)
104 fluxes%lprec(i,j) = 0.0 * g%mask2dT(i,j)
107 fluxes%vprec(i,j) = 0.0
110 fluxes%lw(i,j) = 0.0 * g%mask2dT(i,j)
111 fluxes%latent(i,j) = 0.0 * g%mask2dT(i,j)
112 fluxes%sens(i,j) = 0.0 * g%mask2dT(i,j)
113 fluxes%sw(i,j) = 0.0 * g%mask2dT(i,j)
116 do j=js,je ;
do i=is,ie
119 fluxes%buoy(i,j) = 0.0 * g%mask2dT(i,j)
123 if (cs%restorebuoy)
then 124 if (cs%use_temperature)
then 125 call safe_alloc_ptr(fluxes%heat_added, isd, ied, jsd, jed)
128 call mom_error(fatal,
"User_buoyancy_surface_forcing: " // &
129 "Temperature and salinity restoring used without modification." )
131 rhoxcp = cs%Rho0 * fluxes%C_p
132 do j=js,je ;
do i=is,ie
138 fluxes%heat_added(i,j) = (g%mask2dT(i,j) * (rhoxcp * cs%Flux_const)) * &
139 (temp_restore - sfc_state%SST(i,j))
140 fluxes%vprec(i,j) = - (g%mask2dT(i,j) * (cs%Rho0*cs%Flux_const)) * &
141 ((salin_restore - sfc_state%SSS(i,j)) / (0.5 * (salin_restore + sfc_state%SSS(i,j))))
150 buoy_rest_const = -1.0 * (cs%G_Earth * cs%Flux_const) / cs%Rho0
152 do j=js,je ;
do i=is,ie
155 if (g%geoLatT(i,j) < cs%lfrslat)
then 156 temp_restore = cs%SST_s
157 elseif (g%geoLatT(i,j) > cs%lfrnlat)
then 158 temp_restore = cs%SST_n
160 temp_restore = (cs%SST_s - cs%SST_n)/(cs%lfrslat - cs%lfrnlat) * &
161 (g%geoLatT(i,j) - cs%lfrslat) + cs%SST_s
164 density_restore = temp_restore*cs%drho_dt + cs%Rho0
166 fluxes%buoy(i,j) = g%mask2dT(i,j) * buoy_rest_const * &
167 (density_restore - sfc_state%sfc_density(i,j))