Project

General

Profile

Download (2.95 KB) Statistics
| Branch: | Revision:
1
#### Script to facilitate processing of MOD06 data
2

    
3
setwd("/nobackupp1/awilso10/mod06")
4

    
5
## 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
save(tb,file="modlandTiles.Rdata")
9

    
10
### Submission script
11

    
12
cat(paste("
13
#PBS -S /bin/bash
14
##PBS -l select=1:ncpus=16:model=san
15
###PBS -l select=4:ncpus=8:model=neh
16
#PBS -l select=1:ncpus=12:model=wes
17
####### old: select=48:ncpus=8:mpiprocs=8:model=neh
18
#PBS -l walltime=10:00:00
19
#PBS -j oe
20
#PBS -m e
21
#PBS -V
22
####PBS -W group_list=s1007
23
###PBS -q devel
24
#PBS -o log/log_^array_index^
25
#PBS -o log/log_DataCompile
26
#PBS -M adam.wilson@yale.edu
27
#PBS -N MOD06
28

    
29
source /usr/share/modules/init/bash
30

    
31
## 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
  source /usr/local/lib/global.profile
37
  source /u/awilso10/.bashrc
38
## export a few important variables
39
  export NCORES=24  # use to limit mclapply() to set nubmer of cores, should be select*ncpus above
40
  export PATH=$PATH:/nobackupp1/awilso10/bin:/nobackupp1/awilso10/software/bin
41
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nobackupp1/awilso10/software/lib
42
  export R_LIBS=\"/u/awilso10/R/x86_64-unknown-linux-gnu-library/2.15/\"
43
  export TMPDIR=/nobackupp1/awilso10/mod06/tmp
44
## HEG related variables
45
  export MRTDATADIR=/nobackupp1/awilso10/software/heg/data
46
  export PGSHOME=/nobackupp1/awilso10/software/heg/TOOLKIT_MTD
47
  export HEGUSER=ME
48
## load modules
49
  module load gcc mpi-sgi/mpt.2.06r6 hdf4 udunits R nco
50
## Run the script!
51
## current version not parallelizing across nodes!
52
  TMPDIR=$TMPDIR Rscript --verbose --vanilla /u/awilso10/environmental-layers/climate/procedures/MOD06_L2_process.r 
53
exit 0
54
exit 0
55
",sep=""),file="MOD06_process")
56

    
57
### Check the file
58
system("cat MOD06_process")
59
#system("cat ~/environmental-layers/climate/procedures/MOD06_L2_process.r")
60

    
61
## check queue status
62
system("/u/scicon/tools/bin/node_stats.sh")
63

    
64
## Submit it (and keep the pid)!
65
pid=system("qsub MOD06_process",intern=T); pid; pid=strsplit(pid,split="[.]")[[1]][1]
66

    
67
#system("qsub MOD06_process")
68

    
69
## work in interactive mode
70
# system("qsub -I -l walltime=1:00:00 -lselect=2:ncpus=16:model=san -q devel")
71

    
72
## check progress
73
system("qstat -u awilso10")
74
system(paste("/u/scicon/tools/bin/qps ",pid))
75
system(paste("qstat -t -x",pid))
76

    
77
system("qstat devel ") 
78
#system("qstat | grep awilso10") 
79

    
80

    
81
### copy the files back to Yale
82
list.files("2_daily")
83
system("scp 2_daily/* adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
84

    
85
system("scp  /tmp/Rtmp6I6tFn/MOD06_L2.A2000061.1615.051.2010273184629.hdf adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
86
system("scp 2_daily/MOD06_20000410.nc adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/Venezuela")
87

    
88

    
89
list.files(" /tmp/Rtmp6I6tFn")
(9-9/11)