
      function [ux]=dss020(xl,xu,n,u,v)
%...
%...  SUBROUTINE DSS020 IS AN APPLICATION OF FOURTH-ORDER DIRECTIONAL
%...  DIFFERENCING IN THE NUMERICAL METHOD OF LINES.  IT IS INTENDED
%...  SPECIFICALLY FOR THE ANALYSIS OF CONVECTIVE SYSTEMS MODELLED BY
%...  FIRST-ORDER HYPERBOLIC PARTIAL DIFFERENTIAL EQUATIONS AS DIS-
%...  CUSSED IN SUBROUTINE DSS012.  THE COEFFICIENTS OF THE FINITE
%...  DIFFERENCE APPROXIMATIONS USED HEREIN ARE TAKEN FROM BICKLEY, W.
%...  G., FORMULAE FOR NUMERICAL DIFFERENTIATION, THE MATHEMATICAL
%...  GAZETTE, PP. 19-27, 1941, N = 4, M = 1, P = 0, 1, 2, 3, 4.  THE
%...  IMPLEMENTATION IS THE **FIVE-POINT BIASED UPWIND FORMULA** OF
%...  M. B. CARVER AND H. W. HINDS, THE METHOD OF LINES AND THE
%...  ADVECTION EQUATION, SIMULATION, VOL. 31, NO. 2, PP. 59-69,
%...  AUGUST, 1978
%...
%...  COMPUTE THE COMMON FACTOR FOR EACH FINITE DIFFERENCE APPROXIMATION
%...  CONTAINING THE SPATIAL INCREMENT, THEN SELECT THE FINITE DIFFER-
%...  ENCE APPROXIMATION DEPENDING ON THE SIGN OF V (SIXTH ARGUMENT).
      dx=(xu-xl)/(n-1);
      r4fdx=1./(12.*dx);
%...
%...     (1)  FINITE DIFFERENCE APPROXIMATION FOR POSITIVE V
      if v > 0.
      ux(  1)=r4fdx*...
      ( -25.     *u(  1)...
        +48.     *u(  2)...
        -36.     *u(  3)...
        +16.     *u(  4)...
         -3.     *u(  5));
      ux(  2)=r4fdx*...
      (  -3.     *u(  1)...
        -10.     *u(  2)...
        +18.     *u(  3)...
         -6.     *u(  4)...
         +1.     *u(  5));
      ux(  3)=r4fdx*...
      (  +1.     *u(  1)...
         -8.     *u(  2)...
         +0.     *u(  3)...
         +8.     *u(  4)...
         -1.     *u(  5));
      nm1=n-1;
      for i=4:nm1
      ux(  i)=r4fdx*...
      (  -1.     *u(i-3)...
         +6.     *u(i-2)...
        -18.     *u(i-1)...
        +10.     *u(i  )...
         +3.     *u(i+1));
      end
      ux(  n)=r4fdx*...
      (  +3.     *u(n-4)...
        -16.     *u(n-3)...
        +36.     *u(n-2)...
        -48.     *u(n-1)...
        +25.     *u(n  ));
      end
%...
%...  (2)  FINITE DIFFERENCE APPROXIMATION FOR NEGATIVE V
      if v < 0.
      ux(  1)=r4fdx*...
      ( -25.     *u(  1)...
        +48.     *u(  2)...
        -36.     *u(  3)...
        +16.     *u(  4)...
         -3.     *u(  5));
      nm3=n-3;
      for i=2:nm3
      ux(  i)=r4fdx*...
      (  -3.     *u(i-1)...
        -10.     *u(i  )...
        +18.     *u(i+1)...
         -6.     *u(i+2)...
         +1.     *u(i+3));
      end
      ux(n-2)=r4fdx*...
      (  +1.     *u(n-4)...
         -8.     *u(n-3)...
         +0.     *u(n-2)...
         +8.     *u(n-1)...
         -1.     *u(n  ));
      ux(n-1)=r4fdx*...
      (  -1.     *u(n-4)...
         +6.     *u(n-3)...
        -18.     *u(n-2)...
        +10.     *u(n-1)...
         +3.     *u(n  ));
      ux(  n)=r4fdx*...
      (  +3.     *u(n-4)...
        -16.     *u(n-3)...
        +36.     *u(n-2)...
        -48.     *u(n-1)...
        +25.     *u(n  ));
      end
