/* Frou_ren.sas-- a program to compute and graph Froude and Reynolds     */
/* numbers based upon stream  velocity and depth. All length units in cm. */
/* Graphed after Chow (1959) Open-Channel Hydraulics, McGraw Hill.        */
/* Data values were computed at axis intersections for lines of equal     */
/*  Froude and Reynold's values. Then the data values were reproduced     */
/* below. This program was developed using version 6.11 of the SAS System */
/*  however, it should run with earlier versions. This program is in the  */
/*  public domain. Authored by T. C. Folsom, 1996.                        */
/* SAS is a registered trademark of the SAS Institute, Inc.               */


Data Sasuser.Frou_ren;
  input velocity depth froude reynold;

 /* dots represent missing values and are essential for this style of Input stmt */
cards;
12.4  10  .125 .
24.7  10  .25  .
49.5   10  .5  .
99.0  10   1   .
198.1   10   2  .
396.2  10   4   .
792.4  10   8   .
1   0.065  .125 .
1   0.016  .25  .
1.57   .01 .5   .
3.13   .01  1   .
6.24   .01 2    .
12.54   .01 4   .
25.06  .01  8   .
50.11  .01 16   .
100.23  .01 32  .
200.45  .01 64  .
1000 3.98  16  .
1000 .99  32  .
1000 .25  64  .
1  0.34   .  31.25
1  0.69   .  62.5
1  1.37   .  125
1  2.75   .  250
1  5.5   .  500
1.1  10  .  1000
1000 0.022 .  2000
1000  0.044 .  4000
1000  0.088 .  8000
1000  0.176 . 16000
1000 0.352 .  32000
1000 0.704 .  64000
1000 1.408 .  128000
34.38 .01 .  31.25
68.75 .01 .  62.5
137.5  .01 . 125
275 0.01 .  250
550 0.01 .  500
1000 0.011 . 1000
2.2  10 .  2000
4.4  10 .  4000
8.8  10 .  8000
17.6  10 . 16000
35.2   10 . 32000
70.4  10 .  64000
140.8  10 . 128000
run;

 /*------------------------------------------------------------------*
  | Summary:                                                         |
  |    Creating a simple plot by category using the data set         |
  |    SASUSER.FROU_REN and plotting                                    |
  |    DEPTH against VELOCITY by FROUDE.                             |
  | Generated: 31MAR96 14:04:09                                      |
  *------------------------------------------------------------------*/

 /*------------------------------------------------------------------*
  | The GOPTIONS statement allows you to have more control over the  |
  | final appearance of your output such as fonts, colors, text      |
  | height and so on.  The output device and destination is also     |
  | specified in the goptions statement.                             |
  *------------------------------------------------------------------*/

goptions reset=(axis, legend, pattern, symbol, title, footnote) norotate
         hpos=0 vpos=0 htext= ftext= ctext= target= gaccess= gsfmode= ;
goptions device=WIN  ctext=blue
         graphrc interpol=join goutmode=replace;
 /*------------------------------------------------------------------*
  | AXIS statements allow you to supply information on how your      |
  | vertical and horizontal axes will appear on the graph.           |
  *------------------------------------------------------------------*/
axis1

   logbase=10 logstyle=EXPAND
    Label=('Velocity' ' cm/sec')
     color=blue
   width=2.0
   style=1
   length=4.5 in
   ;
axis2

   logbase=10 logstyle=EXPAND
   Label=('Depth' ' cm')
     color=blue
   width=2.0
   style=1
   length=4 in
   ;

symbol1 i=none c=white; /* prevent values where froude is missing from plotting  */
symbol2 i=join c=black;
symbol3 i=join c=black;
symbol4 i=join c=black;
symbol5 i=join c=black;
symbol6 i=join c=black;
symbol7 i=join c=black;
symbol8 i=join c=black;
symbol9 i=join c=black;
symbol10 i=join c=black;
symbol11 i=join c=black;
symbol12 i=none c=white;  /* prevent values where reynold is missing from plotting  */
symbol13 i=join c=blue l=22;
symbol14 i=join c=blue l=22;
symbol15 i=join c=blue l=22;
symbol16 i=join c=blue l=22;
symbol17 i=join c=blue l=22;
symbol18 i=join c=blue l=22;
symbol19 i=join c=blue l=22;
symbol20 i=join c=blue l=22;
symbol21 i=join c=blue l=22;
symbol22 i=join c=blue l=22;
symbol23 i=join c=blue l=22;
symbol24 i=join c=blue l=22;
symbol25 i=join c=blue l=22;

/* Define the Title */

title1 h=1 c=blue j=l f=swiss '          The relationship between Froude';
title2 h=1 c=blue j=l f=swiss '          number (F) and Reynolds number (Re)';
 /*------- -----------------------------------------------------------*
  | This section produces the actual plot and any options that       |
  | directly relate to the data and the axis area.                   |
  *------------------------------------------------------------------*/

/* the output will be stored in the Sasuser.gseg catalog.            */

proc gplot data=sasuser.FROU_REN gout=sasuser.gseg;
   plot DEPTH * VELOCITY  = FROUDE /
      haxis=axis1
      vaxis=axis2
      frame
      nolegend;

 /*------------------------------------------------------------------*
  | Plotting DEPTH against VELOCITY by REYNOLD                       |
  | on the second vertical axis.                                     |
  *------------------------------------------------------------------*/
    plot2 DEPTH * VELOCITY  = REYNOLD /
         vaxis=axis2
        nolegend
      ;
run; quit;

/* Labels were placed on the stored graphic by using the graph editor.  */
/* Imaginative programmers could use the Annotate option of Proc Gplot  */
/* to automatically generate the labels.                                */