      PROGRAM FLOW
********************************************************************
* Program that reads the density, average forward velocity, and    *
* viscosity of a  fluid and the diameter of the pipe through which *
* it is flowing.  The Reynold's number is calculated and the type  *
* of flow Q laminar, turbulent, unstable Q is then determined      *
* according to whether the Reynold's number is less than a lower   *
* cutoff value, is between two cutoff values, or is greater than   *
* the larger cutoff value. Identifiers used are:                   *
*     DENS, VISC    : density and viscosity of the fluid           *
*     VELOC         : average forward flow of the fluid            *
*     DIAM          : diameter of the pipe                         *
*     LOWCUT, HICUT : cutoff values that distinguish between       *
*                     turbulent/laminar and laminar/unstable types *
*                     of flow                                      *
*     NR            : yhe Reynold's number                         *
*                                                                  *
* Input:     DENS, VELOC, VISC, and DIAM                           *
* Constants: LOWCUT and HICUT                                      *
* Output:    NR and a message indicating the type of flow          *
********************************************************************

      REAL DENS, VELOC, VISC, DIAM, LOWCUT, HICUT, NR
      PARAMETER (LOWCUT = 2000.0, HICUT = 3000.0)

* Get the density, velocity, viscosity, and diameter
      PRINT *, 'ENTER THE DENSITY OF THE FLUID:'
      READ *, DENS
      PRINT *, 'ENTER THE VISCOSITY OF THE FLUID:'
      READ *, VISC
      PRINT *, 'ENTER THE AVERAGE FORWARD VELOCITY OF THE FLUID:'
      READ *, VELOC
      PRINT *, 'ENTER THE DIAMETER OF THE PIPE:'
      READ *, DIAM

* Calculate the Reynold's number
      NR = (DENS * VELOC * DIAM) / VISC

* Display the input data, the Reynold's number, and a message
* indicating the type of flow
      PRINT *, 'FOR A FLUID WITH DENSITY ', DENS, ', VISCOSITY ', VISC
      PRINT *, 'AND AVERAGE FORWARD VELOCITY ', VELOC
      PRINT *, 'FLOWING THROUGH A PIPE OF DIAMETER ', DIAM
      PRINT *, 'THE REYNOLD''S NUMBER IS ', NR
      PRINT *

      IF (NR .LT. LOWCUT) THEN
         PRINT *, 'FLOW IS LAMINAR'
      ELSE IF (NR .LT. HICUT) THEN
         PRINT *, 'FLOW IS TURBULENT'
      ELSE
         PRINT *, 'FLOW IS UNSTABLE'
      END IF

      END
