!*******************************************************************************
!$RCSfile$
!$Revision$
!$Date$
!*******************************************************************************
MODULE SCIPversion_fd
  INTEGER,       PARAMETER :: SCIP_API_VERSION = 5000
  CHARACTER(16), PARAMETER :: SCIPTOOL_TAG = '.225'
  CHARACTER(16), PARAMETER :: SCIPUFF_TAG  = ' SCICHEM 3.0(B2)'
END MODULE SCIPversion_fd

!*******************************************************************************
!            Get scipuff version number
!*******************************************************************************
INTEGER FUNCTION GetScipuffVersion()

USE SCIMgr_fd
USE SCIMgrState

IMPLICIT NONE

IF( SCIMgrCheckState(HS_ANYSTATE) )THEN !Always available
  CALL set_version( GetScipuffVersion )
END IF

RETURN
END
!*******************************************************************************
!            Get Tool API version number
!*******************************************************************************
INTEGER FUNCTION GetAPIVersion()

USE SCIPversion_fd
USE SCIMgr_fd
USE SCIMgrState

IMPLICIT NONE

IF( SCIMgrCheckState(HS_ANYSTATE) )THEN !Always available
  GetAPIVersion = SCIP_API_VERSION
END IF

RETURN
END
!*******************************************************************************
!            Get SCIP Tool version number
!*******************************************************************************
INTEGER FUNCTION GetVersionValue()

USE SCIPversion_fd
USE SCIMgr_fd
USE SCIMgrState

IMPLICIT NONE

INTEGER ishift

IF( SCIMgrCheckState(HS_ANYSTATE) )THEN !Always available

  CALL set_version( GetVersionValue )

  ishift = 4*4 !Bytes * 8(Bits/Byte) / 2

  GetVersionValue = ISHFT(SCIP_API_VERSION,ishift) + GetVersionValue

END IF

RETURN
END
!*******************************************************************************
!            Get SCIP Tool version string
!*******************************************************************************
INTEGER FUNCTION GetVersionString( iflag,charString )

USE SCIPversion_fd
USE SCIMgr_fd
USE SCIMgrState

IMPLICIT NONE

INTEGER, PARAMETER :: HV_API     = 1
INTEGER, PARAMETER :: HV_SCIPUFF = 2

INTEGER iflag
TYPE( char128T )charString

CHARACTER(128) String

CHARACTER(32)  APIstring
CHARACTER(32)  SCIstring

INTEGER        APIversion
INTEGER        SCIPUFFversion

IF( SCIMgrCheckState(HS_ANYSTATE) )THEN !Always available

!==== SCIPtool API version

  APIversion = SCIP_API_VERSION

  CALL WriteVersionString( APIversion,APIstring )

!==== SCIPUFF version

  CALL set_version( SCIPUFFversion )
  CALL WriteVersionString( SCIPUFFversion,SCIstring )

  IF( iflag == HV_API )THEN
    String = TRIM(APIstring)//TRIM(SCIPTOOL_TAG)
  ELSE IF( iflag == HV_SCIPUFF )THEN
    String = TRIM(SCIstring)//TRIM(SCIPUFF_TAG)
  ELSE
    String ='T:'//TRIM(APIstring)//TRIM(SCIPTOOL_TAG) &
                  //'-S:'//TRIM(SCIstring)//TRIM(SCIPUFF_TAG)
  END IF

  charString%string = String
  GetVersionString  = SCIPsuccess

END IF

RETURN
END
!*******************************************************************************
!            Get maximum length of filenames
!*******************************************************************************
INTEGER FUNCTION GetPathMaxLength()

USE DefSize_fd

IMPLICIT NONE

GetPathMaxLength = PATH_MAXLENGTH

RETURN
END
