SUBROUTINE CREATE_DISCONTINUOUS_GRID ( XL, X_BEGIN, X_LENGTH, N) c c C WHAT This routine will create a non-uniform computation grid c of N zones has a discontinuity in zone width at c zone N/2. The grid starts at location X_BEGIN and has c total length X_LENGTH Thus the width of each zone c a is X_LENGTH / N. Grid zones to the left of the c discontinuity are half the size of zones to the right c of the discontinuity. c c The grid is defined by the locations of the lefthand c zone interfaces XL. Thus zone I would have its left c edge at XL(I) and its right edge at XL(I+1). Therefore c a grid of N zones requires N+1 XL values. c c DIMENSIONS c output It will be assumed that the dimension of the array XL c is [1:N+1]. c C DATA C input Input scalers are: c X_BEGIN: the starting value of the left edge of the c grid. That is XL(1) = X_BEGIN c X_LENGTH: the total length of the grid. c That is XL(N+1) = X_BEGIN + X_LENGTH c N: the number of zone in the grid. C output Output arrays are: c XL: the locations of the lefthand zone interfaces c c c c c c REAL XL(1), X_BEGIN, X_LENGTH, DX_LEFT, DX_RIGHT, SINFAC, SINAMP c DX_RIGHT = 4.0 * X_LENGTH / FLOAT(3*N) DX_LEFT = 2.0 * X_LENGTH / FLOAT(3*N) N_BREAK = N/2 c XL(1) = X_BEGIN DO I = 2,N_BREAK XL(I) = XL(I-1) + DX_LEFT ENDDO c DO I = N_BREAK+1,N+1 XL(I) = XL(I-1) + DX_RIGHT ENDDO c RETURN END ! SUBROUTINE CREATE_DISCONTINUOUS_GRID