Setting up Environment for AGCM Sandbox

Revision as of 10:54, 29 November 2012 by Bmauer (talk | contribs) (Created page with "Given the large number of directories in the GEOS5 model it can be useful to set up your environment to make navigating your sandbox easier. This page will document one way of do...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Given the large number of directories in the GEOS5 model it can be useful to set up your environment to make navigating your sandbox easier. This page will document one way of doing this through two shell scripts that must be sourced. This is especially useful if you have multiple copies of the GEOS5 model that you might have checked out (a stable release and your development sandbox for example). This assumes you have checked out a copy of the model previously.

 
#!/bin/csh -f

set arch = `uname`

echo ARCH: $arch
# Aliases for GEOS GCM Directories
# --------------------------------
if( $?prompt ) then
echo " "
echo "Creating GEOSGCM aliases ..."
echo "         ESMADIR: $ESMADIR"
set sources =     `find $ESMADIR -name src                     | grep -v $arch`
alias src     "cd $sources[1]"
alias gcm     "cd `find $ESMADIR -name GEOSgcm_GridComp        | grep -v $arch`"
alias iau     "cd `find $ESMADIR -name GEOSmkiau_GridComp      | grep -v $arch`"
alias shared  "cd `find $ESMADIR -name GEOS_Shared             | grep -v $arch`"
alias gfio    "cd `find $ESMADIR -name GMAO_gfio               | grep -v $arch`"
alias cshared "cd `find $ESMADIR -name Chem_Shared             | grep -v $arch`"
alias hermes  "cd `find $ESMADIR -name GMAO_hermes             | grep -v $arch`"
alias base    "cd `find $ESMADIR -name GEOS_Base               | grep -v $arch`"
alias cbase   "cd `find $ESMADIR -name Chem_Base               | grep -v $arch`"
alias util    "cd `find $ESMADIR -name GEOS_Util               | grep -v $arch`"
alias post    "cd `find $ESMADIR -name post                    | grep -v $arch`"
alias plots   "cd `find $ESMADIR -name plots                   | grep -v $arch`"
alias pilgrim "cd `find $ESMADIR -name GMAO_pilgrim            | grep -v $arch`"
alias agcm    "cd `find $ESMADIR -name GEOSagcm_GridComp       | grep -v $arch`"
alias ogcm    "cd `find $ESMADIR -name GEOSogcm_GridComp       | grep -v $arch`"
alias phys    "cd `find $ESMADIR -name GEOSphysics_GridComp    | grep -v $arch`"
alias dyn     "cd `find $ESMADIR -name GEOSsuperdyn_GridComp   | grep -v $arch`"
alias sdyn    "cd `find $ESMADIR -name GEOSsuperdyn_GridComp   | grep -v $arch`"
alias fv      "cd `find $ESMADIR -name FVdycore_GridComp       | grep -v $arch`"
alias fv3     "cd `find $ESMADIR -name FVdycoreCubed_GridComp  | grep -v $arch`"
alias aries   "cd `find $ESMADIR -name ARIESg3_GridComp        | grep -v $arch`"
alias gwd     "cd `find $ESMADIR -name GEOSgwd_GridComp        | grep -v $arch`"
alias surf    "cd `find $ESMADIR -name GEOSsurface_GridComp    | grep -v $arch`"
alias turb    "cd `find $ESMADIR -name GEOSturbulence_GridComp | grep -v $arch`"
alias rad     "cd `find $ESMADIR -name GEOSradiation_GridComp  | grep -v $arch`"
alias satsim  "cd `find $ESMADIR -name GEOSsatsim_GridComp     | grep -v $arch`"
alias solar   "cd `find $ESMADIR -name GEOSsolar_GridComp      | grep -v $arch`"
alias irrad   "cd `find $ESMADIR -name GEOSirrad_GridComp      | grep -v $arch`"
alias moist   "cd `find $ESMADIR -name GEOSmoist_GridComp      | grep -v $arch`"
alias gmi     "cd `find $ESMADIR -name GMIchem_GridComp        | grep -v $arch`"
alias chem    "cd `find $ESMADIR -name GEOSchem_GridComp       | grep -v $arch`"
alias gaas    "cd `find $ESMADIR -name GAAS_GridComp           | grep -v $arch`"
alias pchem   "cd `find $ESMADIR -name GEOSpchem_GridComp      | grep -v $arch`"
alias gocart  "cd `find $ESMADIR -name GOCART_GridComp         | grep -v $arch`"
alias carma   "cd `find $ESMADIR -name CARMAchem_GridComp      | grep -v $arch`"
alias land    "cd `find $ESMADIR -name GEOSland_GridComp       | grep -v $arch`"
alias lake    "cd `find $ESMADIR -name GEOSlake_GridComp       | grep -v $arch`"
alias landice "cd `find $ESMADIR -name GEOSlandice_GridComp    | grep -v $arch`"
alias salt    "cd `find $ESMADIR -name GEOSsaltwater_GridComp  | grep -v $arch`"
alias catch   "cd `find $ESMADIR -name GEOScatch_GridComp      | grep -v $arch`"
alias mapl    "cd `find $ESMADIR -name MAPL_Base               | grep -v $arch`"

alias appl    "cd `find_dir GEOSgcm_App     Application`"
endif

# Set ESMADIR and Module Environment
# ----------------------------------
echo ""
source $ESMADIR/src/g5_modules

setenv         GEOSUTIL $ESMADIR/src/GMAO_Shared/GEOS_Util
setenv GASCRP $GEOSUTIL/plots/grads_util
setenv GAUDFT $GEOSUTIL/plots/grads_util/udft_$arch.tools
setenv GADDIR /discover/nobackup/projects/gmao/share/dao_ops/opengrads/dat/

# Set alias for hdfdump
# ---------------------
if( -e $BASEDIR/$arch/bin/hdfdump ) then
        alias hdfdump '$BASEDIR/$arch/bin/hdfdump'
else
        alias hdfdump '$BASEDIR/$arch/bin/ncdump'
endif

set path = (~/bin/$arch $BASEDIR/$arch/bin $path)
unsetenv LD_LIBRARY_PATH
  setenv LD_LIBRARY_PATH ${LIBRARY_PATH}:${BASEDIR}/${arch}/lib

# Echo Results
# ------------
echo ""
echo " BASEDIR: $BASEDIR"
echo ""
echo " ESMADIR: $ESMADIR"
echo "GEOSUTIL: $GEOSUTIL"
echo ""
module list
echo ""

This script sets aliases to the module directories in a GEOS5 sandbox. This script is of course assuming you have already set the ESMADIR environment variable.