getCL Function

public function getCL(this, alphaQuery, machQuery)

Returns value of 2-d linear interpolated CL for a given alphaQuery and machQuery values

Arguments

Type IntentOptional AttributesName
class(C81_class) :: this
real, intent(in) :: alphaQuery
real, intent(in) :: machQuery

Return Value real


Calls

proc~~getcl~~CallsGraph proc~getcl getCL proc~getinterval getInterval proc~getcl->proc~getinterval proc~getbilinearinterp getBilinearInterp proc~getcl->proc~getbilinearinterp

Contents

Source Code


Source Code

  function getCL(this,alphaQuery,machQuery)
  !! Returns value of 2-d linear interpolated CL
  !! for a given alphaQuery and machQuery values
  class(C81_class) :: this
    real, intent(in) :: alphaQuery, machQuery
    real :: getCL
    integer, dimension(2) :: alphaIndx, machIndx

    alphaIndx = getInterval(this%AL,alphaQuery)
    machIndx = getInterval(this%MaL,machQuery)

    if (alphaIndx(1) .eq. alphaIndx(2)) then
      if (machIndx(1) .eq. machIndx(2)) then
        getCL = this%CL(alphaIndx(1),machIndx(1))
      else
        getCL = this%CL(alphaIndx(1),machIndx(1))+ &
          (machQuery-this%MaL(machIndx(1))) * &
          (this%CL(alphaIndx(1),machIndx(2))-this%CL(alphaIndx(1),machIndx(1)))/ &
          (this%MaL(machIndx(2))-this%MaL(machIndx(1)))
      endif
    elseif (machIndx(1) .eq. machIndx(2)) then
      getCL = this%CL(alphaIndx(1),machIndx(1))+ &
        (alphaQuery-this%AL(alphaIndx(1))) * &
        (this%CL(alphaIndx(2),machIndx(1))-this%CL(alphaIndx(1),machIndx(1)))/ &
        (this%AL(alphaIndx(2))-this%AL(alphaIndx(1)))
    else
      getCL = getBilinearInterp(alphaQuery,machQuery, &
        (/this%AL(alphaIndx(1)),this%AL(alphaIndx(2))/), &
        (/this%MaL(machIndx(1)),this%MaL(machIndx(2))/), &
        this%CL(alphaIndx(1),machIndx(1)), &
        this%CL(alphaIndx(1),machIndx(2)), &
        this%CL(alphaIndx(2),machIndx(1)), &
        this%CL(alphaIndx(2),machIndx(2)))
    endif
  end function getCL