1 |
3682f238
|
Adam M. Wilson @ pfe
|
#### Script to facilitate processing of MOD06 data
|
2 |
|
|
|
3 |
|
|
setwd("/nobackupp1/awilso10/mod06")
|
4 |
|
|
|
5 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
## get MODLAND tile information
|
6 |
|
|
tb=read.table("http://landweb.nascom.nasa.gov/developers/sn_tiles/sn_bound_10deg.txt",skip=6,nrows=648,header=T)
|
7 |
|
|
tb$tile=paste("h",sprintf("%02d",tb$ih),"v",sprintf("%02d",tb$iv),sep="")
|
8 |
807fa48c
|
Adam M. Wilson @ pfe
|
save(tb,file="modlandTiles.Rdata")
|
9 |
3682f238
|
Adam M. Wilson @ pfe
|
|
10 |
|
|
### Submission script
|
11 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
|
12 |
|
|
cat(paste("
|
13 |
807fa48c
|
Adam M. Wilson @ pfe
|
#PBS -S /bin/bash
|
14 |
|
|
#PBS -l select=1:ncpus=4:mpiprocs=4:model=wes
|
15 |
|
|
####old PBS -l select=64:ncpus=4:mpiprocs=4:model=wes
|
16 |
|
|
####### old: select=48:ncpus=8:mpiprocs=8:model=neh
|
17 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
#PBS -l walltime=0:10:00
|
18 |
3682f238
|
Adam M. Wilson @ pfe
|
#PBS -j oe
|
19 |
|
|
#PBS -m e
|
20 |
807fa48c
|
Adam M. Wilson @ pfe
|
#PBS -V
|
21 |
|
|
####PBS -W group_list=s1007
|
22 |
|
|
#PBS -q devel
|
23 |
|
|
###PBS -o log/log_^array_index^
|
24 |
|
|
#PBS -o log/log_DataCompile
|
25 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
#PBS -M adam.wilson@yale.edu
|
26 |
|
|
#PBS -N MOD06
|
27 |
|
|
|
28 |
807fa48c
|
Adam M. Wilson @ pfe
|
source /usr/share/modules/init/bash
|
29 |
|
|
|
30 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
## cd to working directory
|
31 |
|
|
cd /nobackupp1/awilso10/mod06
|
32 |
|
|
|
33 |
|
|
## set some memory limits
|
34 |
|
|
# ulimit -d 1500000 -m 1500000 -v 1500000 #limit memory usage
|
35 |
|
|
source /usr/local/lib/global.profile
|
36 |
807fa48c
|
Adam M. Wilson @ pfe
|
source /u/awilso10/.bashrc
|
37 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
## export a few important variables
|
38 |
|
|
export PATH=$PATH:/nobackupp1/awilso10/bin:/nobackupp1/awilso10/software/bin
|
39 |
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nobackupp1/awilso10/software/lib
|
40 |
|
|
export MRTDATADIR=/nobackupp1/awilso10/software/heg/data
|
41 |
|
|
export PGSHOME=/nobackupp1/awilso10/software/heg
|
42 |
807fa48c
|
Adam M. Wilson @ pfe
|
export MRTBINDIR=/nobackupp1/awilso10/software/TOOLKIT_MTD
|
43 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
export R_LIBS=\"/u/awilso10/R/x86_64-unknown-linux-gnu-library/2.15/\"
|
44 |
807fa48c
|
Adam M. Wilson @ pfe
|
export TMPDIR=/nobackupp1/awilso10/mod06/tmp
|
45 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
## load modules
|
46 |
|
|
module load gcc mpi-sgi/mpt.2.06r6 hdf4 udunits R
|
47 |
|
|
## Run the script!
|
48 |
807fa48c
|
Adam M. Wilson @ pfe
|
TMPDIR=$TMPDIR Rscript --verbose --vanilla /u/awilso10/environmental-layers/climate/procedures/MOD06_L2_process.r
|
49 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
exit 0
|
50 |
|
|
",sep=""),file="MOD06_process")
|
51 |
|
|
|
52 |
|
|
### Check the file
|
53 |
|
|
system("cat MOD06_process")
|
54 |
807fa48c
|
Adam M. Wilson @ pfe
|
#system("cat ~/environmental-layers/climate/procedures/MOD06_L2_process.r")
|
55 |
|
|
|
56 |
|
|
## Submit it (and keep the pid)!
|
57 |
|
|
pid=system("qsub -q devel MOD06_process",intern=T); pid; pid=strsplit(pid,split="[.]")[[1]][1]
|
58 |
|
|
|
59 |
|
|
#system("qsub MOD06_process")
|
60 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
|
61 |
807fa48c
|
Adam M. Wilson @ pfe
|
## work in interactive mode
|
62 |
|
|
#system("qsub -I -lselect=1:ncpus=2:model=wes -q devel")
|
63 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
|
64 |
|
|
## check progress
|
65 |
|
|
system("qstat -u awilso10")
|
66 |
807fa48c
|
Adam M. Wilson @ pfe
|
system(paste("qstat -t -x",pid))
|
67 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
|
68 |
807fa48c
|
Adam M. Wilson @ pfe
|
system("qstat devel ")
|
69 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
#system("qstat | grep awilso10")
|
70 |
|
|
|
71 |
|
|
|
72 |
807fa48c
|
Adam M. Wilson @ pfe
|
### copy the files back to Yale
|
73 |
|
|
system("scp 2_daily/* adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/")
|