#%Module#####################################################################
# TACC local environment module file 		$Date: 2003/09/24 21:27:11 $
#
# This module file appends the relevant paths in /usr/local to the end
# of $PATH and $MANPATH. If you want the local software suite to be searched
# before the Cray-supplied paths, unload the `TACC' module and load the
# `local' module in your .login_user file.
#
# Do not edit this file directly as it is under RCS control.
#
#############################################################################
proc ModulesHelp { } {
puts stderr "The TACC modulefile defines the default paths and environment"
puts stderr "variables needed to use the local software and utilities"
puts stderr "available in /usr/local, placing them after the vendor-supplied"
puts stderr "paths in PATH and MANPATH.:"
}

###if { [ expr [is-loaded TACC] && ![module-info mode remove] ] } {
###	puts stderr "TACC module already loaded"
###	break	
###}

set sys        [uname sysname]
set node       [uname node]

#
# Let node and sys everide the definition
#
#setenv  ARCHIVER  ranch.tacc.utexas.edu

# SGE Job Wrapper

append-path     PATH        /share/sge/default/pe_scripts


#
# NPACI stuff
#
if { [file exists /usr/local/apps] } {
   setenv APPS   /usr/local/apps
   setenv PURGE  96
}


#
# Location of local modules
#
set MODULEPATH_ROOT  env("MODULEPATH_ROOT")
set modulehome       "$MODULEPATH_ROOT/TACC"



if { "$sys" == "AIX" } {
    append-path MANPATH     /usr/local/virtman/AIX
}

append-path     PATH        ~/bin
append-path     PATH        .

append-path     MANPATH     /usr/local/man

# 9/4/2006 - Addition for lonestar login nodes - intercept of passwd/chcsh to do
#            the right thing with 411.

prepend-path    PATH 	/usr/local/first

#
# Load system specific modules or cluster module
#
if [ expr [ module-info mode load ] || [module-info mode display ] ] {

	if { [file exists $moduleshome/$sys] } {
        	 module load $sys
	}	

	if { [file exists $moduleshome/$node] } {
        	 module load $node
	} elseif { [file exists $moduleshome/cluster ] } {
        	 module load cluster
	}	
}

if [ module-info mode remove ] {

	if { [file exists $moduleshome/$sys] } {
        	 module del $sys
	}	

	if { [file exists $moduleshome/$node] } {
        	 module del $node
	} elseif { [file exists $moduleshome/cluster ] } {
        	 module del cluster
	}	
}
# ;;; Local Variables: ***
# ;;; mode:tcl ***
# ;;; End: ***
