diag_mask_v_section Function

public function diag_mask_v_section(grid, i_col, j0, j1, name) result(m)

Vertical section (test-only): one cell column at i = i_col, spanning j ∈ [j0,j1]. Mirror of h_section for zonal throughflow.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: i_col
integer, intent(in) :: j0
integer, intent(in) :: j1
character(len=*), intent(in), optional :: name

Return Value type(diag_mask_t)


Calls

proc~~diag_mask_v_section~~CallsGraph proc~diag_mask_v_section diag_mask_v_section proc~recompute_total_area recompute_total_area proc~diag_mask_v_section->proc~recompute_total_area

Variables

Type Visibility Attributes Name Initial
integer, private :: j

Source Code

   function diag_mask_v_section(grid, i_col, j0, j1, name) result(m)
      !! Vertical section (test-only): one cell column at `i = i_col`,
      !! spanning `j ∈ [j0,j1]`. Mirror of `h_section` for zonal throughflow.
      type(hgrid_t), intent(in) :: grid
      integer, intent(in) :: i_col, j0, j1
      character(len=*), intent(in), optional :: name
      type(diag_mask_t) :: m
      integer :: j
      m%name = "v_section"
      if (present(name)) m%name = name
      m%nx = grid%nx_total
      m%ny = grid%ny_total
      allocate (m%weight(m%nx, m%ny), source=0.0_wp)
      if (i_col >= 1 .and. i_col <= m%nx) then
         do j = max(1, j0), min(m%ny, j1)
            m%weight(i_col, j) = 1.0_wp
         end do
      end if
      call recompute_total_area(m, grid%dx, grid%dy)
   end function diag_mask_v_section