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 |
3959e686
|
Adam M. Wilson @ pfe
|
#PBS -l select=32:ncpus=4:mpiprocs=4:model=wes
|
15 |
807fa48c
|
Adam M. Wilson @ pfe
|
####old PBS -l select=64:ncpus=4:mpiprocs=4:model=wes
|
16 |
|
|
####### old: select=48:ncpus=8:mpiprocs=8:model=neh
|
17 |
3959e686
|
Adam M. Wilson @ pfe
|
#PBS -l walltime=1:00: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 |
3959e686
|
Adam M. Wilson @ pfe
|
#PBS -q devel
|
23 |
|
|
#PBS -o log/log_^array_index^
|
24 |
807fa48c
|
Adam M. Wilson @ pfe
|
#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 |
3959e686
|
Adam M. Wilson @ pfe
|
module load gcc mpi-sgi/mpt.2.06r6 hdf4 udunits R nco
|
47 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
## 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 |
cf724805
|
Adam M. Wilson @ pfe
|
pid=system("qsub MOD06_process",intern=T); pid; pid=strsplit(pid,split="[.]")[[1]][1]
|
58 |
807fa48c
|
Adam M. Wilson @ pfe
|
|
59 |
|
|
#system("qsub MOD06_process")
|
60 |
9d52d7e0
|
Adam M. Wilson @ pfe
|
|
61 |
807fa48c
|
Adam M. Wilson @ pfe
|
## work in interactive mode
|
62 |
3959e686
|
Adam M. Wilson @ pfe
|
#system("qsub -I -l walltime=1:00:00 -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 |
3959e686
|
Adam M. Wilson @ pfe
|
list.files("2_daily")
|
74 |
|
|
system("scp 2_daily/* adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
|
75 |
|
|
|
76 |
|
|
system("scp /tmp/Rtmp6I6tFn/MOD06_L2.A2000061.1615.051.2010273184629.hdf adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
|
77 |
|
|
system("scp 2_daily/MOD06_20000410.nc adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
|
78 |
cf724805
|
Adam M. Wilson @ pfe
|
|
79 |
|
|
|
80 |
|
|
list.files(" /tmp/Rtmp6I6tFn")
|