Project

General

Profile

Download (2.58 KB) Statistics
| Branch: | Revision:
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 827b4b87 Adam M. Wilson @ pfe
#PBS -l select=1:ncpus=16:model=san
15 92fd8a10 Adam M. Wilson @ pfe
###PBS -l select=4:ncpus=8:model=neh
16 827b4b87 Adam M. Wilson @ pfe
##PBS -l select=1:ncpus=12:model=wes
17 807fa48c Adam M. Wilson @ pfe
####### old: select=48:ncpus=8:mpiprocs=8:model=neh
18 827b4b87 Adam M. Wilson @ pfe
#PBS -l walltime=2:00:00
19 3682f238 Adam M. Wilson @ pfe
#PBS -j oe
20
#PBS -m e
21 807fa48c Adam M. Wilson @ pfe
#PBS -V
22
####PBS -W group_list=s1007
23 827b4b87 Adam M. Wilson @ pfe
#PBS -q devel
24 3959e686 Adam M. Wilson @ pfe
#PBS -o log/log_^array_index^
25 807fa48c Adam M. Wilson @ pfe
#PBS -o log/log_DataCompile
26 9d52d7e0 Adam M. Wilson @ pfe
#PBS -M adam.wilson@yale.edu
27
#PBS -N MOD06
28
29 827b4b87 Adam M. Wilson @ pfe
#source /usr/share/modules/init/bash
30 807fa48c Adam M. Wilson @ pfe
31 9d52d7e0 Adam M. Wilson @ pfe
## cd to working directory
32
cd /nobackupp1/awilso10/mod06
33
34
## set some memory limits
35
#  ulimit -d 1500000 -m 1500000 -v 1500000  #limit memory usage
36 807fa48c Adam M. Wilson @ pfe
  source /u/awilso10/.bashrc
37 827b4b87 Adam M. Wilson @ pfe
  source /u/awilso10/moduleload
38
  source /usr/local/lib/global.profile
39 9d52d7e0 Adam M. Wilson @ pfe
## export a few important variables
40 827b4b87 Adam M. Wilson @ pfe
  export NCORES=16  # use to limit mclapply() to set nubmer of cores, should be select*ncpus above
41 9d52d7e0 Adam M. Wilson @ pfe
  export R_LIBS=\"/u/awilso10/R/x86_64-unknown-linux-gnu-library/2.15/\"
42
## load modules
43 827b4b87 Adam M. Wilson @ pfe
  module load gcc hdf4 udunits R nco mpi-intel #mpi-sgi/mpt.2.06r6
44 9d52d7e0 Adam M. Wilson @ pfe
## Run the script!
45 92fd8a10 Adam M. Wilson @ pfe
## current version not parallelizing across nodes!
46 807fa48c Adam M. Wilson @ pfe
  TMPDIR=$TMPDIR Rscript --verbose --vanilla /u/awilso10/environmental-layers/climate/procedures/MOD06_L2_process.r 
47 9d52d7e0 Adam M. Wilson @ pfe
exit 0
48 92fd8a10 Adam M. Wilson @ pfe
exit 0
49 827b4b87 Adam M. Wilson @ pfe
50 9d52d7e0 Adam M. Wilson @ pfe
",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 92fd8a10 Adam M. Wilson @ pfe
## check queue status
57
system("/u/scicon/tools/bin/node_stats.sh")
58
59 807fa48c Adam M. Wilson @ pfe
## Submit it (and keep the pid)!
60 827b4b87 Adam M. Wilson @ pfe
system("qsub MOD06_process")
61 9d52d7e0 Adam M. Wilson @ pfe
62 807fa48c Adam M. Wilson @ pfe
## work in interactive mode
63 827b4b87 Adam M. Wilson @ pfe
# system("qsub -I -l walltime=2:00:00 -lselect=2:ncpus=16:model=san -q devel")
64
# mpirun -np 1 -r ssh R --no-save
65 9d52d7e0 Adam M. Wilson @ pfe
66
## check progress
67
system("qstat -u awilso10")
68 92fd8a10 Adam M. Wilson @ pfe
system(paste("/u/scicon/tools/bin/qps ",pid))
69 807fa48c Adam M. Wilson @ pfe
system(paste("qstat -t -x",pid))
70 9d52d7e0 Adam M. Wilson @ pfe
71 807fa48c Adam M. Wilson @ pfe
system("qstat devel ") 
72 9d52d7e0 Adam M. Wilson @ pfe
#system("qstat | grep awilso10") 
73
74
75 807fa48c Adam M. Wilson @ pfe
### copy the files back to Yale
76 3959e686 Adam M. Wilson @ pfe
list.files("2_daily")
77
system("scp 2_daily/* adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
78
79
system("scp  /tmp/Rtmp6I6tFn/MOD06_L2.A2000061.1615.051.2010273184629.hdf adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
80
system("scp 2_daily/MOD06_20000410.nc adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
81 cf724805 Adam M. Wilson @ pfe
82
83
list.files(" /tmp/Rtmp6I6tFn")