! copyright 2005,  J. E. Akin, all rights reserved.
MODULE UPWIND_CONSTANTS
! DEFINE CONSTANTS FOR BACKWARD DIFFERENCES OF ORDER 1, 2, OR 3
! GRADIENT: DH/DS = (1*H_1 - 1*H_2)/(1*DS),         IF ORDER = 1
! DH/DS = (3*H_1 - 4*H_2 + H_3)/(2*DS),             IF ORDER = 2
! DH/DS = (11*H_1 - 18*H_2 + 9*H_3 - 2*H_4)/(6*DS), IF ORDER = 3
!       = ( SUM_J_1:ORDER+1  CONST(J)*H_J )/(CONST(ORDER+2)*DS)
USE PRECISION_MODULE
  INTEGER,  PARAMETER :: MAX_ORDER = 3
  REAL(DP), PARAMETER :: CONST (MAX_ORDER+2, MAX_ORDER) =    &
    RESHAPE ( (/ 1.0_DP, -1.0_DP,  1.0_DP,  0.0_DP, 0.0_DP,  &
                 3.0_DP, -4.0_DP,  1.0_DP,  2.0_DP, 0.0_DP,  &
                11.0_DP, -18.0_DP, 9.0_DP, -2.0_DP, 6.0_DP/),&
                (/ MAX_ORDER+2, MAX_ORDER /) )
END MODULE UPWIND_CONSTANTS
