Wet/dry variant of apply_surface_src_2d_impl: the DYNAMIC cell
wet mask composes multiplicatively with the static one, so a
dynamically dry column (total depth below &ocean_wetdry_nml
dry_depth) receives NO surface flux — heating a mm-scale
residual sliver would blow its temperature up
(docs/ocean_wetdry_plan.md §4.4). Separate _impl (not an
in-loop optional test): the knob-off path keeps the original
kernel untouched, byte-identical.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | hTr(nx,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | budget(nx,ny,nz) | |||
| real(kind=wp), | intent(in) | :: | wet_mask(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | wet_dyn(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | Q_field(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | inv_scale | |||
| integer, | intent(in) | :: | k_top(nx,ny) |
See |
||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | cell | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine apply_surface_src_2d_dyn_impl(hTr, budget, wet_mask, wet_dyn, & Q_field, inv_scale, k_top, nz, nx, ny) !! Wet/dry variant of `apply_surface_src_2d_impl`: the DYNAMIC cell !! wet mask composes multiplicatively with the static one, so a !! dynamically dry column (total depth below `&ocean_wetdry_nml !! dry_depth`) receives NO surface flux — heating a mm-scale !! residual sliver would blow its temperature up !! (docs/ocean_wetdry_plan.md §4.4). Separate _impl (not an !! in-loop optional test): the knob-off path keeps the original !! kernel untouched, byte-identical. integer, intent(in) :: nz, nx, ny real(wp), intent(inout) :: hTr(nx, ny, nz) real(wp), intent(inout) :: budget(nx, ny, nz) real(wp), intent(in) :: wet_mask(nx, ny) real(wp), intent(in) :: wet_dyn(nx, ny) real(wp), intent(in) :: Q_field(nx, ny) real(wp), intent(in) :: inv_scale integer, intent(in) :: k_top(nx, ny) !! See `apply_surface_src_2d_impl`. integer :: i, j real(wp) :: cell do concurrent(j=1:ny, i=1:nx) local(cell) cell = inv_scale*Q_field(i, j)*wet_mask(i, j)*wet_dyn(i, j) hTr(i, j, k_top(i, j)) = hTr(i, j, k_top(i, j)) + cell budget(i, j, k_top(i, j)) = budget(i, j, k_top(i, j)) + cell end do end subroutine apply_surface_src_2d_dyn_impl