#!/bin/csh
#########################################################################
#
# .cshrc
#
#  The .cshrc script is executed each time a new 'csh' shell is started.
#
##
# Log:
# S. Jacobs/NCEP	 4/01	Started log
# S. Jacobs/NCEP	 4/01	Removed flags from IRIX5 compile
# D. Kidwell/NCEP	 1/02	Added -DNO_MSG_IPC to BUFRFLAGS for Linux
# T. Piper/SAIC		 7/02	Removed CFLAGS
# S. Jacobs/NCEP	 9/02	Added check for Linux release number
# T. Piper/SAIC		 7/03	Removed NAWIPS_INC
# T. Piper/SAIC		11/03	Removed references to NSAT
# T. Piper/SAIC		11/03	Removed NAWIPS_EXE and NAWIPS_LIB
# T. Piper/SAIC		11/03	Added -L$GEMOLB to LDFLAGS
# T. Piper/SAIC		12/03	Added NCOLOR, NFAX, NSHARP
# T. Piper/SAIC		12/03	Modified NTL, NTRANS, NWX
# T. Piper/SAIC		01/04	Removed CC, NAWIPS_HELP, & NAWIPS_TABLES
# S. Jacobs/NCEP	 3/04	Removed references to old OS's
# T. Piper/SAIC		05/04	Added -I$GEMPAK/source/aodtlib
# T. Piper/SAIC		09/04	Added LPAODT and LPAODTFLAG
# T. Piper/SAIC		10/04	Added support for elsmp processor type
# T. Piper/SAIC		10/04	Removed '-o32' IRIX compiler flags
# B. Yin/SAIC		01/05	Added xml2 and xslt into linux XLIBS
# T. Piper/SAIC		01/05	Added Motif 2.1 reference to IRIX
# T. Piper/SAIC		02/05	Added XML switch
# T. Piper/SAIC		06/05	Changed GEMEXE, GEMOLB; added CC & CFLAGS
# T. Piper/SAIC		06/05	Added OS_ROOT, OS_BIN, OS_INC, and OS_LIB
# T. Piper/SAIC		06/05	Removed $GEMPAK/source/aodtlib from INCLUDES
# T. Piper/SAIC		09/05	Add support for 64-bit architectures
# H. Zeng/SAIC		03/06	Set new CFLAGS when $MACHTYPE == "x86_64"
# T. Piper/SAIC		09/06	Removed AC, ANSI_CFLAGS, and GEM_OS
# T. Piper/SAIC		10/07	Moved root NAWIPS variables to the top 
# T. Piper/SAIC		10/07	AIX only:  Changed 'C' compiler to
#				cc -qlanglvl=extc99; defined OBJECT_MODE=32;
#				and added MANPATH definition
# T. Piper/SAIC		10/07	SunOS only:  Added $OS_ROOT man
#				directories to MANPATH definition
# T. Piper/SAIC		10/07	All:  Cleaned up path variable definition
# T. Piper/SAIC		01/08	Removed NAWIPS environment specific items
# F. Achorn/OPC               01/19   Changed location of export3
#############################################################################
#
#  IMPORTANT:  path must be set BEFORE setting up the N-AWIPS environment,
#		because gemenv.csh adds items relative to $path.
#
#  Set the path.
#
set path = ( ~/bin /usr/local/bin  /usr/bin  /bin /usr/bin/X11 )
set path = ( $path /usr/local/etc  /usr/etc  /etc )
set path = ( $path /usr/local/sbin /usr/sbin /sbin )

######################################################################
#
#  CRITICAL:  The next three (3) commands are REQUIRED to
#		establish the N-AWIPS environment.
#
#  Set the site-specific N-AWIPS NAWIPS system environment variable.
#
if  ( `hostname | cut -c-13` == "vm-lnx-ncosrv" || `hostname | cut -c-6` == "ncosrv" )  then
    setenv NAWIPS               /ops/ws/nawips3
    setenv NADATA1              /home/ftp/mntfil1v1/data
    setenv NADATA2              $NADATA1/ldm
else
    setenv NAWIPS               /export-5/ncosrvnfs-cp/nawips3
    #setenv NADATA1              /export-3/ncosrvnfs-cp
    setenv NADATA1              /mnt/ncosrv_vol1
    setenv NADATA2              $NADATA1/ldm
endif

#
#  Setup the N-AWIPS environment.
#
source $NAWIPS/environ/gemenv.csh

#
#  NOTE:  Any file name may be used for the site-specific data file.
#
#  Set the site-specific N-AWIPS data system envirnoment variables.
#
source $NAWIPS/site/nco_gemdat.csh

######################################################################


######################################################################
#							|
#  NOTE:  The remainder of this script is OPTIONAL.	|
#							V
#  Set convenience aliases for N-AWIPS developers.
#
alias a		"alias"
alias addwrite	'find . ! -perm -200 -exec chmod u+w {} \;'
alias ccompile	'$CC $CFLAGS'
alias cd	'cd \!*;echo $cwd'
alias fcompile	'$FC $FFLAGS'
alias fd	'find . -type d -print | more'
alias ff	'find . -type f -print | more'
alias fk	'find . -type f -print | grep gempak | more'
alias fl	'find . -newer LINKED -type f -print'
alias fn	'find . -newer \!* -type f -print'
alias fp	'find . -newer PRINT -type f -print'
alias fr	'find . -type f -print | grep extlibs | more'
alias gb	'cd $GEMPAK/build'
alias ge	'cd $GEMERR'
alias gf	'cd $GEMPDF'
alias gh	'cd $GEMHLP'
alias gi	'cd $GEMINC'
alias gm	'cd $GEMMAPS'
alias go	'cd "$@";pwd'
alias gp	'cd $GEMPARM'
alias gt	'cd $GEMTBL'
alias h		"history -h"
alias la	"ls -a"
alias lb	'll -rt $OS_BIN'
alias library	'$AR $ARFLAGS'
alias ls	"ls -CF"
alias ll	"ls -l"
alias mkdir	"mkdir -p"
alias na	'cd $NAWIPS'
alias nawopr	'ssh -l nawopr \!$\'
if ( $OS == "HPUX" ) then
    alias ntl	"ntl -xrm '*workspaceList:  One Two Three Four Five Six'"
endif
if  ( $NPRINTER != "" )  then
    alias print	$LP $LPFLAG$NPRINTER
else
    alias print	$LP
endif
alias protect	'chmod -R o-rwx *'
alias sd	'setenv DISPLAY \!$\:0'
alias st	'setenv TERM xterm'
alias ua	"unalias"
alias unprotect	'find . -perm -700 -exec chmod o+rx {} \; ; find . -perm -400 -exec chmod o+r {} \;'
alias x		"chmod +x"

#
#  Set convenience environmental variables for N-AWIPS developers.
#
setenv NCOLOR   $GEMPAK/source/programs/gui/ncolor
setenv NFAX     $GEMPAK/source/programs/gui/nfax
setenv NMAP     $GEMPAK/source/programs/gui/nmap2
setenv NSHARP   $GEMPAK/source/programs/gui/nsharp
setenv NTL      $GEMPAK/source/programs/gui/ntl
setenv NTRANS   $GEMPAK/source/programs/gui/ntrans
setenv NWX      $GEMPAK/source/programs/gui/nwx
setenv NXM      $GEMPAK/source/nxmlib

#
#  Do not create core dump files when a program blows up.
#
limit coredumpsize 0

#
#  Set default permissions for newly created files.
#
umask 022

#
#========================================================================
#  Skip remaining setup if not an interactive shell.

if ($?prompt == 0) exit
if ($?USER == 0) exit
#  Set the interrupt character to Ctrl-c and do clean backspacing.
switch ( $OS )
    case "AIX":
#  IBM
	stty echoe erase "^?" intr "^C"
	breaksw
    case "HPUX":
#  Hewlett-Packard
	stty echoe erase "^?" intr "^C"
	stty kill "^U" eof "^D" susp "^Z" hupcl ixon ixoff tostop
	breaksw
    case "IRIX":
#  Silicon Graphics
	stty echoe erase "^?" intr "^C"
	breaksw
    case "Linux":
#  Linux - PC
	stty echoe erase "^?" intr "^C"
	breaksw
    case "SunOS":
#  Sun Micro Systems
	stty echoe erase "^H" intr "^C"
	breaksw
    default:
	echo
	echo "WARNING..."
	echo
	echo "The erase command has not been set properly."
	echo
	breaksw
endsw

#
#  Set the prompt.
#
set prompt="`whoami`@`hostname|cut -d. -f1`> "

#
#  Tells the shell to ignore .o files when trying to complete filenames
#  when filec is set.  (This does not hold if the .o file is the only
#  one that could be completed.)
set fignore=.o
#  Tells "filec" not to cry if it cannot complete a file.
set nobeep
#  Notify me when the status of background jobs change
set notify
#  Substitute the filename to be completed when
#  an <ESC> is typed at the command line.
set filec
#  Remember xxx most recent events.
set history=150
#  Save the most recent xxx events after log out.
set savehist=150
set ignoreeof
