Project

General

Profile

Download (2.58 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=2: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 /u/awilso10/.bashrc
37
  source /u/awilso10/moduleload
38
  source /usr/local/lib/global.profile
39
## export a few important variables
40
  export NCORES=16  # use to limit mclapply() to set nubmer of cores, should be select*ncpus above
41
  export R_LIBS=\"/u/awilso10/R/x86_64-unknown-linux-gnu-library/2.15/\"
42
## load modules
43
  module load gcc hdf4 udunits R nco mpi-intel #mpi-sgi/mpt.2.06r6
44
## Run the script!
45
## current version not parallelizing across nodes!
46
  TMPDIR=$TMPDIR Rscript --verbose --vanilla /u/awilso10/environmental-layers/climate/procedures/MOD06_L2_process.r 
47
exit 0
48
exit 0
49

    
50
",sep=""),file="MOD06_process")
51

    
52
### Check the file
53
system("cat MOD06_process")
54
#system("cat ~/environmental-layers/climate/procedures/MOD06_L2_process.r")
55

    
56
## check queue status
57
system("/u/scicon/tools/bin/node_stats.sh")
58

    
59
## Submit it (and keep the pid)!
60
system("qsub MOD06_process")
61

    
62
## work in interactive mode
63
# 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

    
66
## check progress
67
system("qstat -u awilso10")
68
system(paste("/u/scicon/tools/bin/qps ",pid))
69
system(paste("qstat -t -x",pid))
70

    
71
system("qstat devel ") 
72
#system("qstat | grep awilso10") 
73

    
74

    
75
### copy the files back to Yale
76
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

    
82

    
83
list.files(" /tmp/Rtmp6I6tFn")
(12-12/15)