diff --git a/src/Models/HydrostaticFreeSurfaceModels/compute_hydrostatic_free_surface_tendencies.jl b/src/Models/HydrostaticFreeSurfaceModels/compute_hydrostatic_free_surface_tendencies.jl index 9e21089913..29303f6581 100644 --- a/src/Models/HydrostaticFreeSurfaceModels/compute_hydrostatic_free_surface_tendencies.jl +++ b/src/Models/HydrostaticFreeSurfaceModels/compute_hydrostatic_free_surface_tendencies.jl @@ -126,6 +126,9 @@ function compute_hydrostatic_momentum_tendencies!(model, velocities, kernel_para u_immersed_bc = immersed_boundary_condition(velocities.u) v_immersed_bc = immersed_boundary_condition(velocities.v) + u_forcing = model.forcing.u + v_forcing = model.forcing.v + start_momentum_kernel_args = (model.advection.momentum, model.coriolis, model.closure) @@ -139,17 +142,17 @@ function compute_hydrostatic_momentum_tendencies!(model, velocities, kernel_para model.auxiliary_fields, model.clock) - u_kernel_args = tuple(start_momentum_kernel_args..., u_immersed_bc, end_momentum_kernel_args...) - v_kernel_args = tuple(start_momentum_kernel_args..., v_immersed_bc, end_momentum_kernel_args...) + u_kernel_args = tuple(start_momentum_kernel_args..., u_immersed_bc, end_momentum_kernel_args..., u_forcing) + v_kernel_args = tuple(start_momentum_kernel_args..., v_immersed_bc, end_momentum_kernel_args..., v_forcing) launch!(arch, grid, kernel_parameters, compute_hydrostatic_free_surface_Gu!, model.timestepper.Gⁿ.u, grid, - active_cells_map, u_kernel_args, model.forcing.u; + active_cells_map, u_kernel_args; active_cells_map) launch!(arch, grid, kernel_parameters, compute_hydrostatic_free_surface_Gv!, model.timestepper.Gⁿ.v, grid, - active_cells_map, v_kernel_args, model.forcing.v; + active_cells_map, v_kernel_args; active_cells_map) return nothing @@ -179,27 +182,27 @@ end ##### """ Calculate the right-hand-side of the u-velocity equation. """ -@kernel function compute_hydrostatic_free_surface_Gu!(Gu, grid, ::Nothing, args, forcing) +@kernel function compute_hydrostatic_free_surface_Gu!(Gu, grid, ::Nothing, args) i, j, k = @index(Global, NTuple) - @inbounds Gu[i, j, k] = hydrostatic_free_surface_u_velocity_tendency(i, j, k, grid, args..., forcing) + @inbounds Gu[i, j, k] = hydrostatic_free_surface_u_velocity_tendency(i, j, k, grid, args...) end -@kernel function compute_hydrostatic_free_surface_Gu!(Gu, grid, active_cells_map, args, forcing) +@kernel function compute_hydrostatic_free_surface_Gu!(Gu, grid, active_cells_map, args) idx = @index(Global, Linear) i, j, k = active_linear_index_to_tuple(idx, active_cells_map) - @inbounds Gu[i, j, k] = hydrostatic_free_surface_u_velocity_tendency(i, j, k, grid, args..., forcing) + @inbounds Gu[i, j, k] = hydrostatic_free_surface_u_velocity_tendency(i, j, k, grid, args...) end """ Calculate the right-hand-side of the v-velocity equation. """ -@kernel function compute_hydrostatic_free_surface_Gv!(Gv, grid, ::Nothing, args, forcing) +@kernel function compute_hydrostatic_free_surface_Gv!(Gv, grid, ::Nothing, args) i, j, k = @index(Global, NTuple) - @inbounds Gv[i, j, k] = hydrostatic_free_surface_v_velocity_tendency(i, j, k, grid, args..., forcing) + @inbounds Gv[i, j, k] = hydrostatic_free_surface_v_velocity_tendency(i, j, k, grid, args...) end -@kernel function compute_hydrostatic_free_surface_Gv!(Gv, grid, active_cells_map, args, forcing) +@kernel function compute_hydrostatic_free_surface_Gv!(Gv, grid, active_cells_map, args) idx = @index(Global, Linear) i, j, k = active_linear_index_to_tuple(idx, active_cells_map) - @inbounds Gv[i, j, k] = hydrostatic_free_surface_v_velocity_tendency(i, j, k, grid, args..., forcing) + @inbounds Gv[i, j, k] = hydrostatic_free_surface_v_velocity_tendency(i, j, k, grid, args...) end ##### diff --git a/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl b/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl index c5e3e9c1ab..28cb289e58 100644 --- a/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl +++ b/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl @@ -38,7 +38,7 @@ implicitly during time-stepping. diffusivities, hydrostatic_pressure_anomaly, auxiliary_fields, - clock, + clock, forcing) model_fields = merge(hydrostatic_fields(velocities, free_surface, tracers), auxiliary_fields) @@ -49,7 +49,7 @@ implicitly during time-stepping. - ∂xᶠᶜᶜ(i, j, k, grid, hydrostatic_pressure_anomaly) - ∂ⱼ_τ₁ⱼ(i, j, k, grid, closure, diffusivities, clock, model_fields, buoyancy) - immersed_∂ⱼ_τ₁ⱼ(i, j, k, grid, velocities, u_immersed_bc, closure, diffusivities, clock, model_fields) - + forcing(i, j, k, grid, clock, hydrostatic_prognostic_fields(velocities, free_surface, tracers))) + + forcing(i, j, k, grid, clock, model_fields)) end """ @@ -82,7 +82,7 @@ implicitly during time-stepping. model_fields = merge(hydrostatic_fields(velocities, free_surface, tracers), auxiliary_fields) - return ( - U_dot_∇v(i, j, k, grid, advection, velocities) + return ( - U_dot_∇v(i, j, k, grid, advection, velocities) - explicit_barotropic_pressure_y_gradient(i, j, k, grid, free_surface) - y_f_cross_U(i, j, k, grid, coriolis, velocities) - ∂yᶜᶠᶜ(i, j, k, grid, hydrostatic_pressure_anomaly)