
C LAST UPDATE:
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C*****************************
C**     LSM_ABSCRANGE       **
C*****************************
C
C **** LSM SERVICE ROUTINE ONLY ****
C
C
      SUBROUTINE  LSM_ABSCRANGE (ABSCOR_NU, PSI_LOC, PSI_GLOB,
     +                           IPACK, IERR)
C
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Check that reflection is within absorption surface limits
C          if defined (global and/or local)
C
C Author:  Steffi Arzt, John Campbell, July 1997
C
C Arguments:
C
      REAL ABSCOR_NU
      REAL PSI_LOC
      REAL PSI_GLOB
      INTEGER IPACK
      INTEGER IERR
C
C Parameters:
C 
C  ABSCOR_NU        (R)   'nu' value
C  PSI_LOC          (R)   'psi' value (local)
C  PSI_GLOB         (R)   'psi' value (global)
C  IPACK            (R)   Pack no.
C  IERR             (W)   Error flag =0 OK
C                                    =1 Out of range
C
C====== PARAMETERS:
C
      INCLUDE 'limits.finc'
C
C====== GLOBALS:
C
      INCLUDE 'scp.finc'
      INCLUDE 'other_scale.finc'
C
C====== LOCALS:
C

C          
C-------------------------------------------------------------------------------
C
      IERR = 0
      IF (NABSG-1.NE.0.OR.MABSG-1.NE.0) THEN
         IF (((ABSCOR_NU-GLOBMINNU)*(ABSCOR_NU-GLOBMAXNU)).GT.0.0) THEN
            IERR = 1
            RETURN
         END IF
         IF (((PSI_GLOB-GLOBMINPSI)*(PSI_GLOB-GLOBMAXPSI)).GT.0.0) THEN
            IERR = 1
            RETURN
         END IF
      END IF

      IF (NABSL(IPACK)-1.NE.0.OR.MABSL(IPACK)-1.NE.0) THEN
         IF (((ABSCOR_NU-LOCMINNU(IPACK))*(ABSCOR_NU-LOCMAXNU(IPACK)))
     +       .GT.0.0) THEN
            IERR = 1
            RETURN
         END IF
         IF (((PSI_LOC-LOCMINPSI(IPACK))*(PSI_LOC-LOCMAXPSI(IPACK)))
     +       .GT.0.0) THEN
            IERR = 1
            RETURN
         END IF
      END IF

      RETURN

      END
