# nco script by Feng He, 4/19/04, ncdtrnd # this script calculates the mean of a data set and then detrends it by subtracting that mean. # here is the demo of this command: # say you want to calculate the anomaly of skt in ncep data skt.mon.ltm.nc # and you want to generate the skta.mon.ltm.nc that stores the anomaly you # calculate: # DEMO CAMMAND: # ncdtrnd skt skt.mon.ltm.nc skta.mon.ltm.nc # Good Luck!! ncwa -O -a time -v $1 $2 foo.nc ncrename -O -v $1,avg foo.nc ncks -A -v avg foo.nc $2 ncap -O -s "dev=$1-avg" $2 $2 ncks -O -v dev $2 $3 rm foo.nc