coord_at Function

public pure function coord_at(i, ic) result(c)

Return cgs mass or radius at coordinate index ic of model i.

ic is 1-based KEPLER coordinate index, clamped to 1..ncoord.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: i

Model index; coordinate index.

integer(kind=int32), intent(in) :: ic

Model index; coordinate index.

Return Value real(kind=real64)


Source Code

   pure function coord_at(i, ic) result(c)
      !! Return cgs mass or radius at coordinate index `ic` of model `i`.
      !!
      !! `ic` is 1-based KEPLER coordinate index, clamped to `1..ncoord`.
      ! Arguments
      integer(int32), intent(in) :: i, ic
         !! Model index; coordinate index.
      real(real64) :: c
      integer(int32) :: j
      j = max(1_int32, min(ic, data(i)%ncoord))
      if (st%yaxis == "radius") then
         c = data(i)%rncoord(j)
      else
         c = data(i)%xmcoord(j)
      end if
   end function coord_at