C
C**************************
C**     LFN_SOFT_MON     **
C**************************

C
CD-Routine: Monitor Automatic Soft Limits Steps - LFN_SOFT_MON
C This routine is used to monitor the steps from the automatic soft 
C limit determining procedure of the routine LFN_AUTO_SOFT. If used, it 
C is passed as the user supplied MONITOR  subroutine which is one of 
C the LFN_AUTO_SOFT parameters and must be declared as external. 
C This version of the monitoring routine just outputs one message
C to the log file at the start of the soft limit determination for each 
C pack processed.
CD-end
CD-Fortran:
      SUBROUTINE LFN_SOFT_MON (IUN_LOG, IOPT, ISTAGE, IPACK, IPLATE)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: Log automatic soft limit determination errors
C
C Author:  John W. Campbell, November 1994
C
C Arguments:
C
      INTEGER IUN_LOG
      INTEGER IOPT
      INTEGER ISTAGE
      INTEGER IPACK
      INTEGER IPLATE
C
CD-Parameters:
C IUN_LOG     i  (R)  Unit number for log file 
C IOPT        i  (R)  Option flag =1dmin, =2 lambda-min
C ISTAGE      i  (R)  = 0  Start of new pack
C                     = 1  Starting to read image
C                     = 2  Finished image reading
C                     = 3  Starting actual soft limit 
C                          determination for the pack
C                     = 4  Finished soft limit 
C IPACK       i  (R)  Pack number
C IPLATE      i  (R)  Plate number
CD-end
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C

C
C====== FUNCTION TYPES:
C
      INTEGER LENSTR
C
C====== LOCALS:
C
      CHARACTER*80 STR
C
C-------------------------------------------------------------------------------
C
C====== Output information
C
      IF (ISTAGE.NE.0) RETURN
      IF (IOPT.EQ.1) THEN
         STR = '==Determining dmin for pack'
      ELSE
         STR = '==Determining lambda-min for pack'
      END IF
      CALL STR_ADDI (STR, IPACK, 1)
      CALL STR_ADDS (STR, 'using plate', 1)
      CALL STR_ADDI (STR, IPLATE, 1)
      CALL STR_ADDS (STR, '==', 0)
      WRITE (IUN_LOG, 1000) STR(1:LENSTR(STR))
      RETURN
C
C====== Format statements
C
 1000 FORMAT (A)
      END
