shelf_kappa_vector Function

private function shelf_kappa_vector(this) result(kappa_vector)

Returns the a vector representing the current state of the internal reflectors in the ice shelf. This takes the form of a 1D array. The routien is only used for debugging purposes.

Arguments

Type IntentOptional AttributesName
class(ice_shelf), intent(in) :: this

Return Value real(kind=r8), dimension(:),allocatable

The state vector describing the ice shelf.


Contents

Source Code


Source Code

  function shelf_kappa_vector(this) result(kappa_vector) 
    !* Author: Christopher MacMackin
    !  Date: April 2016
    !
    ! Returns the a vector representing the current state of the
    ! internal reflectors in the ice shelf.  This takes the form of a
    ! 1D array. The routien is only used for debugging purposes.
    !
    class(ice_shelf), intent(in)        :: this
    real(r8), dimension(:), allocatable :: kappa_vector
      !! The state vector describing the ice shelf.
    integer :: i
    if (allocated(this%kappa)) then
      allocate(kappa_vector(this%thickness_size*size(this%kappa)))
      do i = 1, size(this%kappa)
        kappa_vector((i-1)*this%thickness_size + 1:this%thickness_size*i) = this%kappa(i)%raw()
      end do
    end if
#ifdef DEBUG
    call logger%debug('ice_shelf%state_vector','Returning state vector '// &
                      'for ice shelf.')
#endif
  end function shelf_kappa_vector