% $Header$ -*-LaTeX-*-

% Purpose: Using GreenPlanet

% Copyright (c) 1998--2008, Charles S. Zender
% Permission is granted to copy, distribute and/or modify this document
% under the terms of the GNU Free Documentation License (GFDL), Version 1.2
% or any later version published by the Free Software Foundation;
% with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
% GFDL: http://www.gnu.ai.mit.edu/copyleft/fdl.html

% The original author of this software, Charlie Zender, wants to improve it
% with the help of your suggestions, improvements, bug-reports, and patches.
% Charlie Zender <zender at uci dot edu>
% Department of Earth System Science
% University of California at Irvine
% Irvine, CA 92697-3100

% URL: http://dust.ess.uci.edu/doc/greenplanet/greenplanet.pdf

% Usage (see also end of file):
% cd ${HOME}/esmf;make -W greenplanet.tex greenplanet.pdf;cd -

\documentclass[12pt,twoside]{article}

% Standard packages
\usepackage{ifpdf} % Define \ifpdf
\ifpdf % We are running PDFLaTeX
\usepackage[pdftex]{graphicx} % Defines \includegraphics*
\pdfcompresslevel=9
\usepackage{thumbpdf} % Generate thumbnails
\else % We are not running PDFLaTeX
\usepackage{graphicx} % Defines \includegraphics*
\fi % endif PDFLaTeX
\usepackage{array} % Table and array extensions, e.g., column formatting
\usepackage{natbib} % \cite commands from aguplus
\usepackage{mdwlist} % Compact list formats \itemize*, \enumerate*
\usepackage{url} % Typeset URLs and e-mail addresses
% fxm: 20001028 /usr/share/texmf/tex/latex/base/showidx.sty breaks hyperref
%\usepackage{showidx} % Print index entries as marginal notes
\usepackage{makeidx} % Index keyword processor: \printindex and \see

% hyperref is last package since it redefines other packages' commands
% hyperref options, assumed true unless =false is specified:
% backref       List citing sections after bibliography entries
% baseurl       Make all URLs in document relative to this
% bookmarksopen Unknown
% breaklinks    Wrap links onto newlines
% colorlinks    Use colored text for links, not boxes
% hyperindex    Link index to text
% plainpages=false Suppress warnings caused by duplicate page numbers
% pdftex        Conform to pdftex conventions
% Colors used when colorlinks=true:
% linkcolor     Color for normal internal links
% anchorcolor   Color for anchor text
% citecolor     Color for bibliographic citations in text
% filecolor     Color for URLs which open local files
% menucolor     Color for Acrobat menu items
% pagecolor     Color for links to other pages
% urlcolor      Color for linked URLs
\ifpdf % We are running PDFLaTeX
\usepackage[colorlinks,linkcolor=blue,urlcolor=blue,pdftex]{hyperref}
%\usepackage[backref,breaklinks,colorlinks,hyperindex,linkcolor=blue,urlcolor=blue,plainpages=false,pdftex]{hyperref} % Hyper-references
\pdfcompresslevel=9
\else % We are not running PDFLaTeX
\usepackage[colorlinks,linkcolor=blue,urlcolor=blue]{hyperref}
%\usepackage[backref,breaklinks,colorlinks,hyperindex,linkcolor=blue,urlcolor=blue,plainpages=false]{hyperref} % Hyper-references
\fi % endif PDFLaTeX

% Personal packages
\usepackage{csz} % Library of personal definitions
\usepackage{abc} % Alphabet as three letter macros
\usepackage{dmn} % Dimensional units

% Commands which must be executed in preamble
\makeglossary % Glossary described on KoD95 p. 221
\makeindex % Index described on KoD95 p. 220

% Commands specific to this file

% Margins
\topmargin -24pt \headheight 12pt \headsep 12pt
\textheight 9in \textwidth 6.5in
\oddsidemargin 0in \evensidemargin 0in
\marginparwidth 0pt \marginparsep 0pt
\footskip 24pt
\footnotesep=0pt

\begin{document}

\begin{center}
Online version: \url{http://sand.ess.uci.edu/doc/greenplanet} \hfill \today\\
\bigskip
\bigskip
{\Large \textbf{GreenPlanet Cheat Sheet}}\\
\bigskip
by Charlie Zender\\
University of California at Irvine\\
\end{center}
Department of Earth System Science \hfill zender@uci.edu\\
University of California \hfill Voice: (949)\thinspace 824-2987\\
Irvine, CA~~92697-3100 \hfill Fax: (949)\thinspace 824-3256

\pagenumbering{roman}
\setcounter{page}{1}
\pagestyle{headings}
\thispagestyle{empty}
%\onecolumn
\tableofcontents
\listoftables
\pagenumbering{arabic}
\setcounter{page}{1}
%\markleft{GreenPlanet Cheat Sheet}
%\markright{}
\thispagestyle{empty}

\section{Introduction}\label{sxn:ntr}
The \href{http://www.ess.uci.edu/greenplanet}{Earth System Modeling Facility} 
(\trmidx{GreenPlanet}) is designed to run large climate simulation codes.
This document describes some general usage pointers for GreenPlanet,
then demonstrates how to install and run certain codes
(Section~\ref{sxn:mdl}). 

\section{Environment}\label{sxn:nvr}
Users must have and maintain standard shell environment files.
Essentially these files provide path information and helpful shortcuts
to the users and any batch scripts that invoke them.
These files need not be overly complex.
Most importantly, they must set the \verb'${PATH}' environment
variable and pass control on to CCSM scripts without errors.

Shell environment files must work in batch (i.e., non-interactive) mode.
In particular, they must not cause any output to \cmdidx{stdout} in
batch mode---or the batch environment will be incorrect and cause
unpredictable results.
Minimal shell environment files for GreenPlanet are located in your
home directory.
Following are some suggested additions.

\subsection{Bash}\label{sxn:bsh}
The default login shell on GreenPlanet is \trmidx{Bash}.
Add these lines to your default standard shell file \flidx{.bashrc},
or \flidx{.profile}:
\begin{verbatim}
alias bsrc="source ${HOME}/.bashrc"
alias cp='cp -i' # -i = inquire
alias cvc='cvs commit -m ""'
alias cvu='cvs update -kk'
alias env='env | sort | more'
alias h='history'
alias ls='ls -F' # -F = mark directories with /, links with @, etc.
alias m='less'
alias make='gmake'
alias mv='mv -i' # -i = inquire
alias rm='rm -i' # -i = inquire
alias scp='scp -C' # -p = preserve mode, time, -C = enable compression
alias tar='gtar'
export CVS_RSH='ssh'
export CVSUMASK='002' # Default file permissions for CVS
export HOST=`/bin/hostname`
export NETCDF_INC='/usr/local/include'
export NETCDF_LIB='/usr/local/lib'
export PS1='\u@\h:\w\$ ' # Prompt user@host:cwd$ NeR98 p. 71 NB: single quotes
\end{verbatim}

Many GreenPlanet users will want to run models, such as CCSM, which use
\trmidx{C~Shell} scripts. 
For these scripts to work in batch mode, users must have a valid 
\flidx{.cshrc} file as well.
\begin{verbatim}
alias csrc "source ${HOME}/.cshrc"
alias cp 'cp -i' # -i = inquire
alias cvc 'cvs commit -m ""'
alias cvu 'cvs update -kk'
alias env 'env | sort | more'
alias h 'history'
alias ls 'ls -F' # -F = mark directories with /, links with @, etc.
alias m 'less'
alias make 'gmake'
alias mv 'mv -i' # -i = inquire
alias rm 'rm -i' # -i = inquire
alias scp 'scp -p -C' # -p = preserve mode, time, -C = enable compression
alias tar 'gtar'
setenv CVS_RSH 'ssh'
setenv CVSUMASK '002'
setenv HOST `/bin/hostname`
setenv NETCDF_INC '/usr/local/include'
setenv NETCDF_LIB '/usr/local/lib'
set prompt=${USER}@${HOST}:${cwd}\$" "
\end{verbatim}
Users with a \flidx{.login} file in their home directory should
ensure that it executes error free.

Alternatively, users can change their login shell to \cmdidx{csh}
or \cmdidx{tcsh} vis the standard GreenPlanet procedure
\begin{verbatim}
ssh greenplanetcws
passwd -s
\end{verbatim}

\section{Models}\label{sxn:mdl}

This section describes how to install and run some of the various
climate, chemical, and biogeochemical models for which GreenPlanet is
designed. 

\subsection{CCSM Component Models}\label{sxn:ccsm_cmp}
This section documents how to install and run the component models
which compose the fully coupled NCAR \trmidx{CCSM}
(\trmidx{Community Climate System Model}).
Running the fully coupled CCSM itself is described in
Section~\ref{sxn:ccsm_cpl}.  
First we describe the preliminary system modifications common to all  
CCSM component models. 

CCSM component models may run in \trmidx{Symmetric Multi-Processor}
(\trmidx{SMP}), 
\trmidx{Single Program Multiple Data} (\trmidx{SPMD}), and
\trmidx{hybrid} (i.e., combined SMP and SPMD) modes. 
To take avantage of the SPMD capabilities, make sure you have
the \trmidx{Message Passing Interface} (\trmidx{MPI}) installed. 
MPI is already installed on GreenPlanet.
To install it on a \trmidx{Debian} \trmidx{GNU/Linux} machine use:
\begin{verbatim}
apt-get install mpich # Debian GNU/Linux
\end{verbatim}

CCSM build scripts may require the GNU \trmidx{Make} executable to be
named \cmdidx{gmake} rather than \cmdidx{make}.
\cmdprn{gmake} is installed in \flidx{/usr/local/bin} on GreenPlanet.
To point the GNU \cmdprn{make} executable on a \trmidx{Debian}
\trmidx{GNU/Linux} machine to \cmdprn{gmake} use, e.g., 
\begin{verbatim}
sudo ln -s /usr/bin/make /usr/bin/gmake
\end{verbatim}

All CCSM input-output (\trmidx{I/O}) is performed with the 
\href{http://www.unidata.ucar.edu/packages/netcdf}{netCDF}
data model.
netCDF is already installed on GreenPlanet.
To install netCDF on a Debian GNU/Linux machine use:
\begin{verbatim}
apt-get install netcdf # Debian GNU/Linux
\end{verbatim}

\subsubsection{CAM: Community Atmosphere Model}\label{sxn:cam}
No documentation yet. 
Please contribute!

\subsubsection{CLM: Community Land Model}\label{sxn:clm}
The \trmidx{Community Land Model} (\trmidx{CLM}) is described by 
\cite{DZD03}.
Other important references are \cite{Bon02}, \cite{Bon96},
and \cite{Bon98}. 

The most frequently used WWW sites pertinent to CLM are
\begin{enumerate*}
\item \href{http://www.ess.uci.edu/greenplanet}{GreenPlanet Homepage}
\item \href{http://www.cgd.ucar.edu/tss/clm}{CLM Homepage}
\item \href{http://www.cgd.ucar.edu/tss/lsm}{LSM (CLM's predecessor) Homepage}
\item \href{http://www.cgd.ucar.edu/tss/clm/distribution/clm2.1/index.html}{CLM~2.1 Source Code}
\item \href{http://www.ccsm.ucar.edu/csm/models/lnd-clm2.1/UsersGuide_clm2.1/UsersGuide.pdf}{CLM~2.1 User's Guide (CLMUG)}
\item \href{http://www.ccsm.ucar.edu/support/CSM_Graphics/index_bycat.shtml}{NCL CCSM Graphics}
\item \href{http://nco.sf.net}{NCO netCDF Operators}
\end{enumerate*}

Make GreenPlanet account capable of running \trmidx{CLM} offline:
\begin{verbatim}
# Download and unpack CLM 2.1 source code into your home directory
cd ~
http://www.cgd.ucar.edu:8080/accept/license?action=fillOut&file_id=7
gtar xvzf CLM2.1_code.tar.gz

# Create model run space
if [ -n "${LOGNAME}" ]; then export LOGNAME=${USER}; fi
mkdir /ptmp/${LOGNAME}

# Create local script directory
mkdir ~/clm; cd ~/clm;
cp ~zender/ess_lsp/clm.sh .
cp ~zender/ess_lsp/clm.txt .

# Modify default CLM Makefile with GreenPlanet paths
cp ~zender/ess_lsp/clm_Makefile.mk ${HOME}/clm2/bld/offline/Makefile

# Build and run model
cd ~/clm;./clm.sh

\end{verbatim}

\subsection{CCSM: Community Climate System Model}\label{sxn:ccsm_cpl}

In modifying the CCSM to run on GreenPlanet, it is helpful to know that
GreenPlanet and the NCAR-supported machine \mchidx{bluesky} have
nearly identical hardware and software configurations.
First, \mchprn{greenplanet} and \mchprn{bluesky} are both clusters of
p655 (8-way) and p690 (32-way) nodes connected by Federation switches.  
Each 8-way \mchprn{greenplanet} node in the compute queues has 16\,\GB\ RAM
(the interactive 8-way node \mchidx{greenplanet04m}, which is on the internet
as \mchprn{greenplanet.ess.uci.edu}, has twice as much RAM, 32\,\GB).
The 32-way p690 node has 64~\GB\ RAM.
Hence, each computational CPU on GreenPlanet has 2\,\GB\ RAM available.
\mchprn{bluesky} has about twenty times as many nodes as \mchprn{greenplanet}.
Finally, \mchprn{greenplanet} has faster CPUs than \mchprn{bluesky} 
(1.5\,\GHz\ rather than 1.3\,\GHz). 

\subsubsection{GreenPlanet-specific CCSM modifications}\label{sxn:mods}
With this knowledge, we created machine files which describe the
\mchprn{greenplanet} cluster and queueing architecture to the CCSM.
These files are based on the corresponding \mchprn{bluesky} machine
files distributed with the CCSM. 
Five machine-specific files are required to make the \mchprn{greenplanet} a
valid CCSM machine-type.
These files are 
\begin{enumerate*}
\item \flprn{Macros.AIX} (\verb'ccsm3_0/models/bld/Macros.AIX')
\item \flprn{check\_machine} (\verb'ccsm3_0/scripts/ccsm_utils/Tools/check_machine')
\item \flprn{batch.ibm.greenplanet} (\verb'ccsm3_0/scripts/ccsm_utils/Machines/batch.ibm.greenplanet')
\item \flprn{env.ibm.greenplanet} (\verb'ccsm3_0/scripts/ccsm_utils/Machines/env.ibm.greenplanet')
\item \flprn{run.ibm.greenplanet} (\verb'ccsm3_0/scripts/ccsm_utils/Machines/run.ibm.greenplanet')
\end{enumerate*}
First, read the purpose of GreenPlanet customizations.
This will be helpful to those attempting to port the CCSM to other
machines (e.g., Linux clusters) at UCI.
Then, copy GreenPlanet-customized files to your local CCSM source tree.

The file \flidx{Macros.AIX} controls the options the compiler uses to
build the CCSM source code (both C and Fortran).
The first change replaces the default NCAR netCDF library path,
\texttt{/usr/local/lib64/r4i4}, with its GreenPlanet equivalent, 
\texttt{/usr/local/lib}:
\begin{verbatim}
mv ~/ccsm3_0/models/bld/Macros.AIX ~/ccsm3_0/models/bld/Macros.AIX.orig
cp ~zender/ccsm3_0/models/bld/Macros.AIX ~/ccsm3_0/models/bld/Macros.AIX
\end{verbatim}
All GreenPlanet system libraries use the 64-bit ABI where possible. 
Hence NCAR's \texttt{lib64} is simply GreenPlanet's \texttt{lib}.
Second, the default size for Fortran variables of type \texttt{real}
is four bytes, i.e., single precision.
The default size for Fortran variables of type \texttt{integer} is
also four bytes. 
Newer scientific computing codes, such as CCSM, explicitly specify the
sizes of integers and reals so the default sizes are never used.
However, many old codes rely on compiler-defaults to specify the sizes
of \texttt{integer} and \texttt{real}.
Some applications expect other defaults, e.g., eight-byte
\texttt{real} and four-byte integer or \texttt{r8i4} in NCAR
parlance. 
The GreenPlanet uses the \texttt{r4i4} standard for all libraries in
\flidx{/usr/local}. 
This obsoletes the need to explicitly specify an equivalent to NCAR's
\texttt{r4i4} subdirectory.

The file \flidx{check\_machine} is used by the \flidx{create\_newcase}
script to customize the script.
If \flprn{greenplanet} is not included in \flprn{check\_machine}, then 
\flprn{create\_newcase} will exit with the error \texttt{check\_machine
  ERROR, greenplanet not supported}.

The file \flidx{batch.ibm.greenplanet} contains most of the default header
that will be used by the CCSM \trmidx{run script} when the script is
run in batch mode.
Here is where the default \trmidx{LoadLeveler} commands are set.
The GreenPlanet uses the default CCSM settings for the IBM AIX machine
\mchidx{bluesky} except for the following changes: 
\begin{enumerate}
\item Default \trmidx{class} (i.e., \trmidx{queue}) is \verb'com_rg8'
  rather than \verb'csl_rg${max_tasks_per_node}'
\item Default \trmidx{wall\_clock\_limit} is 21600\,s (6\,\hr), rather
  than 7200\,s. 
\item Job accounting is disabled by commenting out the line containing
  \cmdidx{jareport}.
\end{enumerate}

The file \flidx{env.ibm.greenplanet} contains environment variables which
determine how the CCSM is built and where it looks for input data 
and stores output data.
\flidx{env.ibm.greenplanet} is the same as \flidx{env.ibm.bluesky} with the
following exceptions
\begin{enumerate}
\item \verb'GMAKE_J' determines how many jobs (in effect, processors)
  the parallelization of the compilation process will request.
  This is set to eight but should be set to four if you are often
  compiling interactively (rather than in the compute queues).
\item \verb'DIN_LOC_ROOT' is \flidx{/datashare/inputdata/csm} 
  instead of \flidx{/fs/cgd/csm/inputdata}
\item \verb'DIN_LOC_ROOT_USER' is \flidx{/datashare/inputdata\_user}
  instead of \flidx{/fs/cgd/csm/inputdata\_user}
\item \verb'DIN_LOC_MSROOT' is \flidx{/datashare/inputdata/csm}
  instead of \flidx{/CCSM/inputdata}
\end{enumerate}
Finally, the CCSM versions of \flprn{env.ibm.*} contain a subtle bug
in the task geometry clauses.
Essentially, C~Shell syntax splits the two \verb'set' statements that
look like the body of many \verb'if-endif' clauses into two.
The first statement is inside the condition and the second is outside
and thus always executed.
This bug causes geometry statements to overwrite eachother.
We re-coded \flprn{env.ibm.greenplanet} to avoid this confusion.

The file \flidx{run.ibm.greenplanet} is the template \trmidx{run script}.
The fully resolved run script will be created from this template.
This template handles all the details of building, executing the
model, as well as storing the output data and possibly continually
re-submitting the job until completion.
\flidx{run.ibm.greenplanet} is identical to \flidx{run.ibm.bluesky}.

Copy these three files to your local source tree:
\begin{verbatim}
for fl in batch.ibm.greenplanet env.ibm.greenplanet run.ibm.greenplanet ; do
  mv ~zender/ccsm3_0/scripts/ccsm_utils/Machines/${fl} \
           ~/ccsm3_0/scripts/ccsm_utils/Machines/${fl}.orig
  cp -f ~zender/ccsm3_0/scripts/ccsm_utils/Machines/${fl} \
              ~/ccsm3_0/scripts/ccsm_utils/Machines
done
\end{verbatim}
Normally, no further customization is necessary.
These \mchprn{greenplanet}-customized defaults are sufficient to get started
running the CCSM.
However, advanced CCSM users will often need to further modify these
\mchprn{greenplanet}-customized defaults.  

\subsubsection{Creating a new CCSM case}\label{sxn:case}
We are now ready to create the new CCSM case, i.e., experiment.
First, store the case name the \nvridx{CASEID} environment variable. 
This name should be clueful about the experiments' purpose.
Next, use the \cmdidx{create\_newcase} script which will create
environment variable files and generate the \flidx{configure} 
script for this experiment.
\begin{verbatim}
cd ~/ccsm3_0/scripts
export CASEID='T31x3'
export CASEID='T42x1_40'
export CASEID='T85x1_64'
export CASEROOT="/ptmp/${USER}/${CASEID}"
./create_newcase -case ${CASEROOT} -mach greenplanet -res T31_gx3v5 -compset B
./create_newcase -case ${CASEROOT} -mach greenplanet -res T42_gx1v3 -compset B
./create_newcase -case ${CASEROOT} -mach greenplanet -res T85_gx1v3 -compset B
\end{verbatim}
This will create the \nvridx{CASEROOT} directory.
Before the model may be run, however, it is necessary to populate the
\nvrprn{CASEROOT} directory with the \trmidx{resolved scripts}.

\subsubsection{Resolved Scripts}\label{sxn:rsl}
Each \nvrprn{CASEID} may have multiple resolved-scripts generated for it.
The resolved scripts are customized for particular initialization
sequences (e.g., restart runs), resolution, machine, and component sets.
The \cmdidx{configure} command generates the resolved scripts:
\begin{verbatim}
cd ${CASEROOT}
./configure -cleanmach greenplanet # Cleanup any old builds for greenplanet
./configure -mach greenplanet
\end{verbatim}

\subsubsection{Run Geometry}\label{sxn:geo}

\subsubsection{Testing CCSM}\label{sxn:tst}
CCSM supports a sohphisticated test suite.
\begin{verbatim}
./create_test -testname TER.01a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
./create_test -testname TDB.01a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
./create_test -testname TBR.01a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
./create_test -testname TBR.02a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
./create_test -testname THY.01a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
./create_test -testname THY.02a.T31_gx3v5.B.greenplanet -testroot /ptmp/zender/tstinstall
\end{verbatim}
Passing a single test is a good indication that your CCSM environment
and installation are correct.
Passing all tests means 

\subsubsection{Submitting Run Scripts}\label{sxn:run}
Submit the job to GreenPlanet \trmidx{LoadLeveler} queues with
\cmdidx{llsubmit}:
\begin{verbatim}
cd ${CASEROOT}
llsubmit T31x3x.greenplanet.run
\end{verbatim}
Check the status of the job in the queue with \cmdidx{llq}.

All CCSM component models create log files during execution.
Examine these log files to ensure your job is proceeding smoothly. 
The \trmidx{coupler} log is most informative about the overall
progress of the simulation.
\begin{verbatim}
cd ${CASEROOT}/cpl
more cpl.log.041229-190833
\end{verbatim}
Log files are stamped with the job-submission time.
The time-stamp has the format \texttt{YYMMDD-HHMMSS}.
Hence each simulation has a unique identifer, such as
\texttt{041229-190833} above.
The time-stamp is consistent among all the model components in the
same simulation. 
After the simulation completes, the model compresses the log files 
and stores them, along with the history tapes (i.e., output data) in
\verb'/ptmp/${USER}/archive/${CASEID}'.

\subsubsection{Archiving Data}\label{sxn:data}
CCSM, by default, stores short term output files in 
\begin{verbatim}
/ptmp/${USER}/archive/${CASEID}
\end{verbatim}
CCSM also has automated long term archiving capability.
This can be customized to copy data and logs to any computer on the 
Internet.
Once GreenPlanet disk farm is working, we will activate automatic
long-term archiving to 
\begin{verbatim}
/data/${USER}/archive/${CASEID}
\end{verbatim}

% Bibliography
%\renewcommand\refname{\normalsize Publications}
%\nocite{ZeK972}
\bibliographystyle{agu}
\bibliography{bib}
\printindex % Requires makeidx KoD95 p. 221
\addcontentsline{toc}{section}{Index}

% $: rebalance syntax highlighting

\csznote{ 
% Usage: Place usage here at end of file so comment character % not needed
cd ${HOME}/esmf;make -W greenplanet.tex greenplanet.txt greenplanet.dvi greenplanet.ps greenplanet.pdf;cd -

scp ${HOME}/esmf/greenplanet.tex ${HOME}/esmf/greenplanet.txt ${DATA}/ps/greenplanet.ps ${DATA}/ps/greenplanet.pdf ${HOME}/esmf/greenplanet.dvi dust.ess.uci.edu:/var/www/html/doc/greenplanet

# NB: latex2html chokes on greenplanet.tex
# latex2html -dir /var/www/html/doc/greenplanet greenplanet.tex
# NB: tth chokes on greenplanet.tex
# cd ${HOME}/esmf;tth -a -Lgreenplanet -p./:${TEXINPUTS}:${BIBINPUTS} < ${HOME}/esmf/greenplanet.tex > greenplanet.html
# scp greenplanet.html dust.ess.uci.edu:/var/www/html/doc/greenplanet
# NB: tex4ht works well on greenplanet.tex
cd ${HOME}/esmf;htlatex greenplanet.tex
scp greenplanet*.css greenplanet*.html dust.ess.uci.edu:/var/www/html/doc/greenplanet
# NB: tex4moz works well on greenplanet.tex
cd ${HOME}/esmf;/usr/share/tex4ht/mzlatex greenplanet.tex
scp greenplanet*.css greenplanet*.html greenplanet*.xml dust.ess.uci.edu:/var/www/html/doc/greenplanet
} % end csznote on usage

\end{document}
