Bake the nodal/astronomical correction into one edge’s per-constituent
tidal_fnodal / tidal_arg. For each of face%n_tidal_constituents,
resolve the constituent by frequency (obc_match_constituent) and set
tidal_fnodal(nc) = f_all(ic), tidal_arg(nc) = v_all(ic) + u_all(ic).
f_all / u_all come from nodal_fu, v_all from
equilibrium_arguments, all sized TIDES_CATALOG_SIZE. On an
unmatched constituent it leaves that entry untouched and returns
ierr = nc (the 1-based edge slot that failed) so the caller can fail
loud; ierr = 0 on success. pure — no logging / no error stop.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_bc_face_tag_t), | intent(inout) | :: | face | |||
| real(kind=wp), | intent(in) | :: | f_all(TIDES_CATALOG_SIZE) | |||
| real(kind=wp), | intent(in) | :: | u_all(TIDES_CATALOG_SIZE) | |||
| real(kind=wp), | intent(in) | :: | v_all(TIDES_CATALOG_SIZE) | |||
| integer, | intent(out) | :: | ierr |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | ic | ||||
| integer, | private | :: | nc |
pure subroutine obc_tide_nodal_fill(face, f_all, u_all, v_all, ierr) !! Bake the nodal/astronomical correction into one edge's per-constituent !! `tidal_fnodal` / `tidal_arg`. For each of `face%n_tidal_constituents`, !! resolve the constituent by frequency (`obc_match_constituent`) and set !! `tidal_fnodal(nc) = f_all(ic)`, `tidal_arg(nc) = v_all(ic) + u_all(ic)`. !! `f_all` / `u_all` come from `nodal_fu`, `v_all` from !! `equilibrium_arguments`, all sized `TIDES_CATALOG_SIZE`. On an !! unmatched constituent it leaves that entry untouched and returns !! `ierr = nc` (the 1-based edge slot that failed) so the caller can fail !! loud; `ierr = 0` on success. `pure` — no logging / no `error stop`. type(ocean_bc_face_tag_t), intent(inout) :: face real(wp), intent(in) :: f_all(TIDES_CATALOG_SIZE) real(wp), intent(in) :: u_all(TIDES_CATALOG_SIZE) real(wp), intent(in) :: v_all(TIDES_CATALOG_SIZE) integer, intent(out) :: ierr integer :: nc, ic ierr = 0 do nc = 1, face%n_tidal_constituents ic = obc_match_constituent(face%tidal_omega(nc)) if (ic == 0) then ierr = nc return end if face%tidal_fnodal(nc) = f_all(ic) face%tidal_arg(nc) = v_all(ic) + u_all(ic) end do end subroutine obc_tide_nodal_fill