Linear-in-x draft z_draft = draft0 + slope*(x - x0) inside the
shelf box, clipped at 0 from below (a formula that would lift the
ice base above the sea surface is open water, not negative ice),
and zero outside the box.
slope is in draft-metres per GRID unit; the dispatch converts
the dimensionless namelist slope. Ghost rule as set_draft_flat.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | z_draft(:,:) | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| real(kind=wp), | intent(in) | :: | draft0 |
Draft at |
||
| real(kind=wp), | intent(in) | :: | slope |
d(draft)/dx in draft-metres per grid unit. |
||
| real(kind=wp), | intent(in) | :: | x0 | |||
| real(kind=wp), | intent(in) | :: | x1 | |||
| real(kind=wp), | intent(in) | :: | y0 | |||
| real(kind=wp), | intent(in) | :: | y1 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | d_local | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | ioff | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | joff | ||||
| integer, | private | :: | ng | ||||
| integer, | private | :: | nxt | ||||
| integer, | private | :: | nyt | ||||
| real(kind=wp), | private | :: | x_phys | ||||
| real(kind=wp), | private | :: | y_phys |
pure subroutine set_draft_linear(z_draft, grid, draft0, slope, x0, x1, y0, y1) !! Linear-in-x draft `z_draft = draft0 + slope*(x - x0)` inside the !! shelf box, clipped at 0 from below (a formula that would lift the !! ice base above the sea surface is open water, not negative ice), !! and zero outside the box. !! !! `slope` is in draft-metres per GRID unit; the dispatch converts !! the dimensionless namelist slope. Ghost rule as `set_draft_flat`. real(wp), intent(inout) :: z_draft(:, :) type(hgrid_t), intent(in) :: grid real(wp), intent(in) :: draft0 !! Draft at `x = x0` (m, positive down). real(wp), intent(in) :: slope !! d(draft)/dx in draft-metres per grid unit. real(wp), intent(in) :: x0, x1, y0, y1 integer :: i, j, ng, nxt, nyt, ioff, joff real(wp) :: x_phys, y_phys, d_local ng = grid%nghost ioff = grid%i_offset_global joff = grid%j_offset_global nxt = size(z_draft, 1) nyt = size(z_draft, 2) do j = 1, nyt y_phys = (real(j - ng + joff, wp) - 0.5_wp)*grid%dy do i = 1, nxt x_phys = (real(i - ng + ioff, wp) - 0.5_wp)*grid%dx if (in_shelf_box(x_phys, y_phys, x0, x1, y0, y1)) then d_local = draft0 + slope*(x_phys - x0) if (d_local < 0.0_wp) d_local = 0.0_wp z_draft(i, j) = d_local else z_draft(i, j) = 0.0_wp end if end do end do end subroutine set_draft_linear