#! /bin/bash # Global 8-day LAI data, 1-km resolution; conservative remapping to 0.5 degree; from Dai group # huge, amounts to 1TB. export modis_ROOT=/home/gwang/Data/modis cd $modis_ROOT mkdir LAI_monthly
for year in 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 do
cd $modis_ROOT
tar -xvf global_30s_${year}.tar bunzip2 *${year}*.bz2 mkdir global_30s_${year} mv *${year}*.nc $modis_ROOT/global_30s_${year} cp $modis_ROOT/weights.nc $modis_ROOT/global_30s_${year} cd $modis_ROOT/global_30s_${year}
# March for dates in 065 073 081 089 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# April for dates in 097 105 113 121 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# May for dates in 129 137 145 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# June for dates in 153 161 169 177 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# July for dates in 185 193 201 209 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# August for dates in 217 225 233 241 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# September for dates in 249 257 265 273 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# October for dates in 281 289 297 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# November for dates in 305 313 321 329 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done
# December for dates in 337 345 353 361 do cdo sellonlatbox,-20,50,-40,40 global_30s_${year}_${dates}.nc africa_30s_${year}_${dates}.nc # Africa domain cdo remap,mygrid,weights.nc africa_30s_${year}_${dates}.nc africa_30s_${year}_${dates}_mygrid.nc done