SUBROUTINE CREATE_NONUNIFORM_GRID ( XL, X_BEGIN, X_LENGTH, N) c C WHAT This routine will create a non-uniform computation grid c of N zones beginning at location X_BEGIN and which has a c total length X_LENGTH. 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 A sinusoid is used to vary the zone interface locations c from those of a uniform grid of the same size and c dimensions. 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, SINFAC, SINAMP SINFAC = 6.28318530717958 / FLOAT(N) SINAMP = 0.75 DX = X_LENGTH / FLOAT(N) XL(1) = X_BEGIN DO I = 2,N+1 XL(I) = XL(I-1) + DX * (1.0 + SINAMP * SIN(SINFAC * FLOAT(I-1))) ENDDO RETURN END ! SUBROUTINE CREATE_NONUNIFORM_GRID