Revision e4e30b86
Added by Adam Wilson over 11 years ago
climate/procedures/Pleiades_MOD35.R | ||
---|---|---|
16 | 16 |
save(tb,file="modlandTiles.Rdata") |
17 | 17 |
load("modlandTiles.Rdata") |
18 | 18 |
|
19 |
## delete temporary log file that can grow to GB |
|
20 |
system("rm /nobackupp1/awilso10/software/heg/TOOLKIT_MTD/runtime/LogStatus") |
|
21 |
|
|
19 |
## Choose some tiles to process |
|
22 | 20 |
### list of tiles to process |
23 | 21 |
tiles=c("h10v08","h11v08","h12v08","h10v07","h11v07","h12v07") # South America |
24 | 22 |
## a northern block of tiles |
25 |
expand.grid(paste("h",11:17,sep=""),v=c("v00","v01","v02","v03","v04")) |
|
23 |
tiles=apply(expand.grid(paste("h",11:17,sep=""),v=c("v00","v01","v02","v03","v04")),1,function(x) paste(x,collapse="",sep="")) |
|
24 |
## subset to MODLAND tiles |
|
25 |
alltiles=system("ls -r MODTILES/ | grep tif$ | cut -c1-6 | sort | uniq - ",intern=T) |
|
26 | 26 |
|
27 |
b## subset to MODLAND tiles |
|
28 |
modlandtiles=system("ls -r /nobackupp4/datapool/modis/MOD11A1.005/2010* | grep hdf$ | cut -c18-23 | sort | uniq - ",intern=T) |
|
29 |
tb$land=tb$tile%in%modlandtiles |
|
30 |
tiles=tb$tile[tb$land] |
|
27 |
## subset to tiles in global region (not outside global boundary in sinusoidal projection) |
|
28 |
tiles=tiles[tiles%in%alltiles] |
|
31 | 29 |
|
32 | 30 |
## subset tile corner matrix to tiles selected above |
33 | 31 |
tile_bb=tb[tb$tile%in%tiles,] |
... | ... | |
109 | 107 |
#x=x[order(rownames(x)),] |
110 | 108 |
|
111 | 109 |
script="/u/awilso10/environmental-layers/climate/procedures/MOD35_L2_process.r" |
112 |
|
|
110 |
|
|
113 | 111 |
## write the table processed by mpiexec |
112 |
tp=T # rerun everything |
|
114 | 113 |
tp=((!proclist$done)&proclist$avail) #date-tiles to process |
115 | 114 |
table(Available=proclist$avail,Completed=proclist$done) |
116 | 115 |
|
... | ... | |
161 | 160 |
####################################################### |
162 | 161 |
### Now submit the script to generate the climatologies |
163 | 162 |
|
163 |
## report 'mostly' finished tiles |
|
164 |
## this relyies on proclist above so be sure to update above before running |
|
165 |
md=table(tile=proclist$tile[!proclist$done],year=proclist$year[!proclist$done]) |
|
166 |
mdt=names(md[md<10,]) |
|
167 |
tiles=mdt |
|
164 | 168 |
|
165 | 169 |
tiles |
166 | 170 |
ctiles=c("h10v08","h11v08","h12v08","h10v07","h11v07","h12v07") # South America |
... | ... | |
191 | 195 |
### qsub script |
192 | 196 |
cat(paste(" |
193 | 197 |
#PBS -S /bin/bash |
194 |
#PBS -l select=40:ncpus=8:mem=94
|
|
198 |
#PBS -l select=10:ncpus=8:mem=94
|
|
195 | 199 |
#PBS -l walltime=2:00:00 |
196 | 200 |
#PBS -j n |
197 | 201 |
#PBS -m be |
... | ... | |
202 | 206 |
#PBS -V |
203 | 207 |
",if(delay) paste("#PBS -W depend=afterany:",job,sep="")," |
204 | 208 |
|
205 |
CORES=320
|
|
209 |
CORES=80
|
|
206 | 210 |
HDIR=/u/armichae/pr/ |
207 | 211 |
source $HDIR/etc/environ.sh |
208 | 212 |
source /pleiades/u/awilso10/environ.sh |
... | ... | |
238 | 242 |
|
239 | 243 |
system("ssh lou") |
240 | 244 |
#scp `find MOD35/summary -name "MOD35_h[0-9][0-9]v[0-9][0-9].nc"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/ |
241 |
system("rsync -cavv `find summary -name \"MOD35_h[0-9][0-9]v[0-9][0-9]_2009mean.nc\"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/")
|
|
245 |
system("rsync -cavv `find summary -name \"MOD35_h[0-9][0-9]v[0-9][0-9]_mean.nc\"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/") |
|
242 | 246 |
system("rsync -cavv `find summary -name \"MOD35_h[0-9][0-9]v[0-9][0-9].nc\"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/") |
243 | 247 |
|
244 | 248 |
|
Also available in: Unified diff
updated swtif error checking to use r.neighbor instead of r.mapcalc. Submitted job for northern block of tiles