Blend every active tag’s current bracket into its slot. t must
be the same model time ocean_data_input_update_all was just
called with — the reader enforces this and aborts otherwise.
Only PHYSICAL cells are written here. Stress ghosts are filled
afterwards by ocean_seam_refresh_surface_stress (exchange /
periodic wrap / fold), which also re-derives stress_mag. The
flux tags get no ghost treatment at all — see the module
docstring for why that is correct rather than an omission.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_data_forcing_t), | intent(in) | :: | this | |||
| type(ocean_data_input_t), | intent(in) | :: | reader | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_surface_stress_t), | intent(inout) | :: | ss | |||
| type(ocean_surface_flux_t), | intent(inout) | :: | sf | |||
| type(ocean_bc_state_t), | intent(in) | :: | bc |
Supplies the periodic / north-fold topology to the seam refresh. |
||
| real(kind=wp), | intent(in) | :: | t |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny |
subroutine ocean_data_forcing_apply(this, reader, grid, ss, sf, bc, t) !! Blend every active tag's current bracket into its slot. `t` must !! be the same model time `ocean_data_input_update_all` was just !! called with — the reader enforces this and aborts otherwise. !! !! Only PHYSICAL cells are written here. Stress ghosts are filled !! afterwards by `ocean_seam_refresh_surface_stress` (exchange / !! periodic wrap / fold), which also re-derives `stress_mag`. The !! flux tags get no ghost treatment at all — see the module !! docstring for why that is correct rather than an omission. type(ocean_data_forcing_t), intent(in) :: this type(ocean_data_input_t), intent(in) :: reader type(hgrid_t), intent(in) :: grid type(ocean_surface_stress_t), intent(inout) :: ss type(ocean_surface_flux_t), intent(inout) :: sf type(ocean_bc_state_t), intent(in) :: bc !! Supplies the periodic / north-fold topology to the seam refresh. real(wp), intent(in) :: t integer :: nx, ny if (.not. this%active) return nx = grid%nx_total ny = grid%ny_total ! --- wind stress --- if (this%id_tau_x > 0) then call ocean_data_input_update_2d(reader, this%id_tau_x, t, nx + 1, ny, ss%tau_x) end if if (this%id_tau_y > 0) then call ocean_data_input_update_2d(reader, this%id_tau_y, t, nx, ny + 1, ss%tau_y) end if if (this%id_tau_x > 0 .or. this%id_tau_y > 0) then ! Mandatory, both halves: the ghosts because neighbour-reading ! kernels consume them, and `stress_mag` because KPP/EPBL would ! otherwise keep mixing on the configure-time wind. call ocean_seam_refresh_surface_stress(ss, grid, bc) end if ! --- surface fluxes (column-local; no ghost fill by design) --- if (this%id_heat > 0) then if (this%heat_to_component) then call ocean_data_input_update_2d(reader, this%id_heat, t, nx, ny, sf%heat_added) else call ocean_data_input_update_2d(reader, this%id_heat, t, nx, ny, sf%Q_heat) end if end if if (this%id_salt > 0) then if (this%salt_to_component) then call ocean_data_input_update_2d(reader, this%id_salt, t, nx, ny, sf%salt_flux) else call ocean_data_input_update_2d(reader, this%id_salt, t, nx, ny, sf%Q_salt) end if end if if (this%id_evap > 0) then call ocean_data_input_update_2d(reader, this%id_evap, t, nx, ny, sf%evap) end if if (this%id_lprec > 0) then call ocean_data_input_update_2d(reader, this%id_lprec, t, nx, ny, sf%lprec) end if end subroutine ocean_data_forcing_apply