"< style type="text/css"> img {border: 15px solid white;} - use ccs code to give images borders around them

Latex: find a symbol by drawing it!

CMIP5 ESD: alter the url to pick your favourite model/variable
http://pcmdi3.llnl.gov/esgcet/dataset/cmip5.output1.MOHC.HadGEM2-ES.historical.mon.atmos.Amon.r4i1p1.html

NetCDF
nccopy -k 1 version4.nc version3.nc
Convert NetCDF v4 to v3 classic
ncatted -a missing_value,evap,c,s,-32768s tmp.nc
Add a new attribute "missing_value" with a "short" value -32768
ncatted -a _FillValue,evap,d,, tmp.nc
Delete an attribute "_FillValue" from variable "evap"
More information at jisao.washington.edu/data/nco/

cat .addressbook | awk '{print $NF}' | sed 's/[<>(),]/ /g' > tmp.txt - print out last record in file ".addressbook" and replace all <>(), with a space
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf file1.pdf file2.pdf...concatenate a series of PDF files
convert -loop 20 -delay 20 -crop 560x400+0+0 -density 140x100 -adjoin file*.gif /users/rpa/public_html/GERB/gifs/SIN_barg_olr_anim.gif....Convert series of image files to an animation
a2ps -r ZZZ_TOA_RESULTS.txt -o temp.ps --columns=1 -l 160 Convert test file to postscript using landscape format, 1 page per page of postscript and 160 characters per line
ls -l | grep 'Dec 15' | awk ' {print $9}' > list
for i in `cat list`
do
mv $i directory
done
move a whole bunch of files based on their date. tar -cvf my_project.TAR my_project      Tar up project directory for ftp transfer
tar -xvf my_project.TAR.gz      Untar up tar file to project directory
rename string string2 *.txt     change names of files containing "string", replacing "string" with "srting2"
can't run unix script? (e.g. "command not found" error message). Try copying contents of file to new file (e.g. in emacs) and then run.
lpr -P printer file.ps
cancel -a rpa...cancel all print jobs for user rpa.
convert file.ps file.gif
psnup -nup 2 file1.ps file2.ps - put 2 pages of postscript on 1 page
What is your ip address? Try telneting to the computer - it should print the ip address

ftping:
Set up .netrc file with the following:
machine FTP.SITE login USERNAME password PASSWORD
where USERNAME and PASSWORD are anonymous and your email address if anonymous login is allowed. Otherwise put in username and password required for the site.
ftp -i FTP_SITE << !
bin
get file
quit
!

IDL-Met Office code (to run and setup for printing colour)
setup new envi
~rpa/IDL_PP/wu_misc/iu
IDL> SET_PLOT,'PS'
IDL> pr,d='optranew'
IDL> @pcmdi
(read in dat and plot - e.g. PP_CONTOUR,pp,block=1,bstyle=style(/spectrum)
IDL> prend,/view

PP-FORMAT - see http://ugamp.nerc.ac.uk/um/UM_docs/misc/ppformat.txt

GRIB - format - see http://www.antarctica.ac.uk/met/wmc/ecmwf_grib_decode.html for help. Scripts here will output data to text or binary.
Alternatively, try GrADS.

HDF and NetCDF - can read this in IDL


Met Office Specific Stuff

lp -od file      print double sided
tek1a -t filename     print out transparency on the TEK1A printer
a2ps -1 -lland -cl 100 Cess_followomega.dat > temp.ps     Convert ascii text file (Cess_followomega.dat) to postscript with 1 page ascii per postscript page (-1), in landscape format (-lland) and with 100 characters per line (-cl 100)
stash -s | grep OUTGOING   stash code/field code
chmod 600      personal r/w only
chmod o-r file     remove reading permissions from 'others'
hostname      prints your hostname
ip hostname      prints the internet protocol number of host
rm -rf       remove directory and contents
rm ./-badfilename     remove bad filename (ie one beginning with "-", etc.)
doftp -host email -user outbound -get WVP_88.Z    get file off OUTBOUND"
touch `pg filename`    touch a list of files
ps2pdf      converts postscript to a pdf file (best if want to print pdf file)
convert file.ps file.pdf      converts postscript to a pdf file (best if want to view pdf file)

ln -s existing/directory/path/datadir datadir      creates and links directory "datadir" in existing directory to existing directory "existing/directory/path/datadir"

migrate ppdirectory archived_directory      archives pp files to IBM. use unmigrate to bring them back. CRONJOBS ######################################################

set up file 'cronfile' using emacs or vi in this format (ie DATE variables, commands):
01 14 23 04 * /data/hcmim1/hadri/gerb/gerb_data_transfer_new.src > /home/hc0900/hadri/cronlogfile 2>&1
which runs the script 'gerb_data_transfer_new.src' and outputs messages to /home/hc0900/hadri/cronlogfile. The script may be replaced by a single command (e.g. doftp -host typhoon.rdg.ac.uk get pub/file) but the command doftp must be preceeded by its exact path (ie /user/bin/doftp rathger than just doftp)
crontab cronfile
This sets up the command and runs it as specified at 01 minute past 14 hours on the 23rd day of the 04th month EVERY year (* used as wildcard).
crontab -l       ; this lists your cronjobs

STASHSPLIT ######################################################

makepph - updates your pp header (pph) file for directory.
ppc2h -r 4.3 /tmp/t20ri/abouca.pcj1dec abouc
puts 64 bit t3e pp file (/tmp/t20ri/abouca.pcj1dec) onto hps (change to $TEMPDIR on hp). Output to abouc.pp. THIS WORKS ON ANCIL FILES ALSO. Then run metasplit in wave. Also use stashlist abouac.pp to list details of pp file.
metasplit,'$TEMPDIR/ceres_d','daily/*.pp',/verbose
stashsplit all pp files in daily dir and put in $TEMP/ceres_d dir
man @header       description of pp headers
stash -s | grep OUTGOING       lists stash and field code for *OUTGOING* labels
ppfp path/filename       lists ppfile info (inc. date, etc)
ppasource=SS_ASSOC(directory of stashsplit pp files,expression)
pparray=PPA(ppasource,/all)       - READ IN FILES

TO READ OFF A CD-ROM ########################################
1) put CD-ROM in drive !
2) rlogin to host controlling drive
3) mt_cd -cdcase       - mounts cd drive
4) cd /cdrom       - change to the CD-ROM directory
5) ls, cp , etc...
6) mt_cd -u       - unmount cd
7) GO HOME.

EMAIL ######################################################

to read gif files, etc. Save email to file, then use:
munpack file

FTP ######################################################

doftp -anonpub -ascii -put file -ls       - put ascii (text) file on CR ftp site (inter.pub.cr) and list the files held here.
CR ftp directory: /home/hc0300/ftp/pub
documents: http://fr400/~frma/email_ftp/dap_to_anon_ftp.html

TELNET/FTP to external site:

telnet email.meto.gov.uk
Username: OUTBOUND
...Choose option (ie 2 for telnet)
open external.host.name
export TERM=vt100

WAVE ######################################################

outfield=PP_REGRID(infield,npt=72,row=36)       - regrid a pp field (5x5 degree)
get 256 colours in window:
DEVICE,/CLOSE
SET_PLOT,'x'
WINDOW,color=256
LOADCT,0 (greyscale)

netCDF

f77 -Wl,-L/opt/local/lib -ludunits -lnetcdf readolr.f links to .a files (e.g. /opt/local/lib/libudunits.a)
BUT STILL DON'T WORK!

HTML ######################################################

View document source to reveal html coding. Can learn to program in html from copying the basic ideas.

Wm<SUP>-2 </SUP> will give Wm-2 correctly with the -2 as a superscript (<SUB> gives a subscript)

file:/// - displays root directory on Linux. e.g. file:///users/rpa/tmp.html FAX ######################################################

To fax the US use 9 001 (code: ie Hampton Virginia= 757) + number
To fax, type in the number and place paper upside down with the text facing
away from you. When it is ready (it will let you know), press START.

UM ######################################################
To run your own job:
0) Load umui (just type umui)
1) Copy similar job
2) Redefine basics (email, tic code, directorys)
3) Copy over start dump (check availability using: lister -ce RUNID | more then use getarchive:)
getarchive -a re01z -v -p i cracg.na.aajwda.daj1710 aajwda.daj1710
- copies dump from IMB to t3e.
4) Change run specifics (run length, compile options, ancils, STASH diagnostics)
5) check for handedit script in copied job (e.g. may have to change NANCIL_LOOKUPSA in SIZES file in your umui_jobs/runid directory above value allowed in umui)
6) If you are using a start dump that differs (ie resolution, model version, diagnostics list) from your job, you will have to run a reconfiguration step to change the start dump into the correct format.
7) Save, Process, (hand edit), Submit

Debugging: compile -g overide method
1) Which routine did the model fail in? ie division by zero in routine SULPHUR, called by CHMCTL1A...
2) Create a file on the t3e containing names of routines you want debug info on (ie SULPH1A.dk and CHMCTL1A.dk):
SULPH1A    FCOM_OPTIM=-g
CHMCTL1A    FCOM_OPTIM=-g
3) Copy failed job to new job.
4) Point to new file in Compile overides section
5) Compile only
6) Point original job to new executable (ie file at $DATADIR/copiedjobid/copiedjobid)... may be best to copy executable to original job dir in $DATADIR?
7) Re-run original job (ie set up as continuation run (CRUN in handedit to $HOME/umui_jobs/jobid/SUBMIT on your workstation account) if easiest).
8) If job falls over, look at the core file (may be in /tmp/jobid**** dir) by typing totalview -c CORE_FILE COMPILE_FILE)

DELETING A RUN:
showq [gives you run identity]
delrun run_identity run_name [ie delrun 4139.sn6702 abouz]

To use a restart dump from a different year but the same month and day, add into RECONA just after the string: FIXHD(12)=304 the text ,FIXHD(21)=1948, FIXHD(28)=1948, RELHD(8)=1948 to start from year 1948. If the months were to be different edit FIXHD(22), FIXHD(29), RELHD(9) and for days FIXHD(23), FIXHD(30), RELHD(10).

INANCILA: Insufficient space for LOOKUP headers - could be a problem with limit on lookup headers set to 19999 in UMUI. Hand edit this in SIZES.

ftp t3e TRANSFERRING SMALL FILES FROM T3E to HP:

UNIX ######################################################

grep ^@ temp.bib | sed 'y/@{,/ /' - get lines beginning with @ from temp.bib and pipe this to sed which replaces all @{, with spaces.

grep ^@ temp.bib | awk '{print $2}' - ...or print second field using awk (spaces and : seperate?)

PARIAH ######################################################

pariahq - shows queue on IBM
ibmls cracerr.t20ri. - shows jobs on IBM (e.g. cracerr.t20ri.o.d2000014.t093216)
ibmrm cracerr.t20ri.o.d2000014.t100851 - removes job from queue

pariah using FIND:

Write a file like the one below:

crack.as.acngia.psh9djf
crack.as.acngia.psi0djf
crack.as.acngia.psi1djf
crack.as.acngia.psi2djf
crack.as.acngia.psi3djf ACNGI_Q_DJF_7983 <<
&FIND MSUSER(4)=00010 &END
&UNITS OTYPE=0 &END
&FIND MSUSER(4)=00408 &END
&UNITS OTYPE=0 &END
&FIND MSUSER(4)=30417 &END
&UNITS OTYPE=0 &END
EOF

pariah -L"mec.load(samultip)" -F multi_file
This looks for seasonal files in cracer and gets the stash codes for q(theta), p(theta) and pstar and writes to file: ACNGI_Q_DJF_7983

THE BELOW IS OLD - not sure still works! ##########
Use Pariah for large amounts of UM data:

1) Write a criteria file (e.g. aaxzc_olr.crit)
&FIND MSUSER(4)=02205 &END
&UNITS OTYPE=0 &END

2) lister2filelist expidX pattern criteria

expid is the job id (e.g. aaxcz)
X is the sub-model (e.g. a is atmosphere)
pattern selects which files (e.g. pm is monthly means)
criteria is the first part of the criteria file name (e.g. aaxzc_olr)

3) Sequential file lists will output (e.g. aaxzca.pm.aaxzc_olr.3.filelist)

4) runpariah aaxzca.pm.aaxzc_olr.3 priority

priority is i, t, o, w.

WORD ######################################################

/opt/qvp/qvpunix - load in Word doc file to quick view plus

GETTING ERA40 DATA ######################################################
1) su - clera      Change to clera account
2) export DISPLAY=hc0904:0.0      or custom d65 script...rlogin hc1000
3) elm      Check for errors in CRONJOBS. Also check that $TEMPDIR/eccopy directory is there
4) In your home account (hadri) run script:ecgate1 to Telnet to ECMWF
5) Enter username, type in pin number to SecureID card, write in code.
6) RUN ECFETCH_MONTH script (for Feb 1989, Expt version 18:
echo 'era40fetch_month 198902 18 > era40fetch_month.log 2>&1' | at now + 10 minutes
7) The data should subsequently be gathered and sent to hc0030 where it will be automatically be GRIB decoded overnight to 6 hourly pp files. 8) Run PV-WAVE job to mean the 6-hourly data (Manually)