ocean_budgets_set_area Subroutine

private subroutine ocean_budgets_set_area(this, areaT)

Cache the per-cell T-area (m²) from the metrics slot. After this, physical integrals weight by mask%weight·areaT; before it they fall back to grid%dx·grid%dy (= areaT on uniform Cartesian).

Type Bound

ocean_budgets_t

Arguments

Type IntentOptional Attributes Name
class(ocean_budgets_t), intent(inout) :: this
real(kind=wp), intent(in) :: areaT(:,:)

Source Code

   subroutine ocean_budgets_set_area(this, areaT)
      !! Cache the per-cell T-area (m²) from the metrics slot.  After this,
      !! physical integrals weight by `mask%weight·areaT`; before it they
      !! fall back to `grid%dx·grid%dy` (= areaT on uniform Cartesian).
      class(ocean_budgets_t), intent(inout) :: this
      real(wp), intent(in) :: areaT(:, :)
      if (allocated(this%areaT)) deallocate (this%areaT)
      allocate (this%areaT, source=areaT)
   end subroutine ocean_budgets_set_area