      PROGRAM DILUTE
************************************************************************
* Program to determine the acidity of a diluted mixture in an acid     *
* bath after a given number of castings are immersed in it, and to     *
* determine how often the mixture can be used before its acidity falls *
* below some specified lower limit.  Variables used are:               *
*     ACID    :  amount of acid in the mixture                         *
*     WATER   :  amount of water added with each casting immersion     *
*     CONCEN  :  proportion of acid in the mixture                     *
*     NCASTS  :  number of castings                                    *
*     LIMIT   :  lower limit on acidity                                *
*                                                                      *
* Input:   ACID, WATER, NCASTS                                         *
* Output:  NCASTS                                                      *
************************************************************************

      INTEGER NCASTS
      REAL ACID, WATER, CONCEN, LIMIT

      PRINT *, 'ENTER ORIGINAL AMOUNT OF ACID, AMOUNT OF WATER ADDED'
      PRINT *, 'AND THE NUMBER OF CASTINGS'
      READ *, ACID, WATER, NCASTS
      CONCEN = (ACID / (ACID + WATER)) ** NCASTS
      PRINT *, 'THE PROPORTION OF ACID IN THE MIXTURE AFTER'
      PRINT *, NCASTS, ' IMMERSIONS IS ', CONCEN
      PRINT *, 'NOW ENTER THE LOWER LIMIT ON THE ACIDITY'
      READ *, LIMIT
      NCASTS = 1 + LOG(LIMIT) / (LOG(ACID) - LOG(ACID + WATER))
      PRINT *, NCASTS, ' CASTINGS CAN BE IMMERSED BEFORE THE ACIDITY'
      PRINT *, 'FALLS BELOW THIS LIMIT'
      END

