diag_mask_h_section Function

public function diag_mask_h_section(grid, j_row, i0, i1, name) result(m)

Horizontal section (test-only): one cell row at j = j_row, spanning i ∈ [i0,i1]. Integrates transport across a constant-y line (v_face_y_layer at j_row = meridional throughflow).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: j_row
integer, intent(in) :: i0
integer, intent(in) :: i1
character(len=*), intent(in), optional :: name

Return Value type(diag_mask_t)


Calls

proc~~diag_mask_h_section~~CallsGraph proc~diag_mask_h_section diag_mask_h_section proc~recompute_total_area recompute_total_area proc~diag_mask_h_section->proc~recompute_total_area

Variables

Type Visibility Attributes Name Initial
integer, private :: i

Source Code

   function diag_mask_h_section(grid, j_row, i0, i1, name) result(m)
      !! Horizontal section (test-only): one cell row at `j = j_row`,
      !! spanning `i ∈ [i0,i1]`. Integrates transport across a constant-y
      !! line (`v_face_y_layer` at `j_row` = meridional throughflow).
      type(hgrid_t), intent(in) :: grid
      integer, intent(in) :: j_row, i0, i1
      character(len=*), intent(in), optional :: name
      type(diag_mask_t) :: m
      integer :: i
      m%name = "h_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 (j_row >= 1 .and. j_row <= m%ny) then
         do i = max(1, i0), min(m%nx, i1)
            m%weight(i, j_row) = 1.0_wp
         end do
      end if
      call recompute_total_area(m, grid%dx, grid%dy)
   end function diag_mask_h_section