#!/bin/csh -f
#
# Ludi_Find_Library
#    Script for setting environment variables to the Ludi library files
#
# Product: ludi
#
# Author:  Ann Giammona
#
#$Log:	Ludi_Find_Library,v $
#	Revision 1.1  1999/02/01  15:28:46  qbuild
#	Initial revision
#	
#	Revision 1.1  1999/01/28  14:49:43  agiammon
#	Initial revision
#	
#
# Molecular Simulations, Inc. 1998
#-------------------------------------------------------------------------

set giveup = 0

set str_name = $prefix.str
if (! -e $str_name) then
  set str_name = $prefix.struct
  if (! -e $str_name) then
    set giveup = 1
  endif
endif

if ($giveup == 0) then
  set trg_name = $prefix.inp
  if (! -e $trg_name) then
    set trg_name = $prefix.trg
    if (! -e $trg_name) then
      set trg_name = $prefix.targ
      if (! -e $trg_name) then
        set giveup = 1
      endif
    endif
  endif
endif

if ($giveup == 0) then
  setenv lib_struct $str_name
  setenv lib_inp $trg_name
else
  echo 'Library not found.' >> fort.49 
endif

exit ($giveup)
