#!/bin/bash # # set the bounds # R=-R124.5W/115W/31.0N/40.5N # # clean out old files # rm -f *.nc rm -f *.grd rm -f gmt* # # Use blockmean to avoid aliasing gmt blockmean $R -I1m data.lluv -fg -i0,1,2,4 -W+s > blk.llu gmt blockmean $R -I1m data.lluv -fg -i0,1,3,5 -W+s > blk.llv gmt convert -A blk.llu blk.llv -o0-2,6,3,7 > blk.lluv # # do the gridding # gmt gpsgridder $R -I1m -Gtmp_%s.nc blk.lluv -fg -Vl -Fd8 -r -Cv99.9999+eigen.txt -S0.50 # # mask the grids # gmt grdlandmask -Gmask.grd -Rtmp_u.nc -Df gmt grdmath tmp_u.nc mask.grd MUL = GPS_u.grd gmt grdmath tmp_v.nc mask.grd MUL = GPS_v.grd echo "Created GPS_u.grd and GPS_v.grd"