convert_to_poly Subroutine

subroutine convert_to_poly(long1, long2, deg1, deg2, tab_coef, tab_out)

Génération d’une surface polynômiale pour vérification des procédures d’approximation

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: long1

taille x

integer(kind=I4), intent(in) :: long2

taille y

integer(kind=I4), intent(in) :: deg1

degré selon x

integer(kind=I4), intent(in) :: deg2

degré selon y

real(kind=R8), intent(in), dimension(1:(deg1+1) * (deg2+1)) :: tab_coef

tableau des coefficients

real(kind=R8), intent(out), dimension(1:long1, 1:long2) :: tab_out

tableau résultant : surface


Called by

proc~~convert_to_poly~~CalledByGraph proc~convert_to_poly convert_to_poly program~test_tchebychev test_tchebychev program~test_tchebychev->proc~convert_to_poly

Source Code

   subroutine convert_to_poly(long1, long2, deg1, deg2, tab_coef, tab_out)
   !! Génération d'une surface polynômiale pour vérification des procédures d'approximation
   implicit none
   integer(kind=I4), intent(in )                                     :: long1    !! *taille x*
   integer(kind=I4), intent(in )                                     :: long2    !! *taille y*
   integer(kind=I4), intent(in )                                     :: deg1     !! *degré selon x*
   integer(kind=I4), intent(in )                                     :: deg2     !! *degré selon y*
   real   (kind=R8), intent(in ), dimension(1:(deg1+1) * (deg2+1))   :: tab_coef !! *tableau des coefficients*
   real   (kind=R8), intent(out), dimension(1:long1, 1:long2)        :: tab_out  !! *tableau résultant : surface*

      real(kind=R8)    :: xi, xj
      integer(kind=I4) :: i, j, k1, k2, k1k2

      tab_out = 0._R8
      do j = 1, long2
         xj = -1. + (j - 1) * 2. / (long2 - 1)

         do i = 1, long1
            xi = -1. + (i - 1) * 2. / (long1 - 1)

            k1k2 = 0
            do k2 = 0, deg2
            do k1 = 0, deg1

               k1k2 = k1k2 + 1
               tab_out(i, j) = tab_out(i, j) + tab_coef(k1k2) * (xi ** k1) * (xj ** k2)

            enddo
            enddo
         enddo

      enddo

   return
   endsubroutine convert_to_poly