#!/bin/tcsh -f -v #Plots the average variable for the entire period using GMT #Substitute correct limits for ranges, variable name and file names #make a color bar for GMT makecpt -Crainbow -T0/1/0.2 -Z >! bar.cpt #Extract longitude and latitude fields ncks -s "%f\n" -C -v lon -H data_file.nc >! longitude.txt ncks -s "%f\n" -C -v lat -H data_file.nc >! latitude.txt #Produce average over all times ncra -O -c -v variable_name -d tstep,0,,1 data_file.nc average.nc #Extract average and plot the results ncks -s "%.6f\n" -C -v variable_name -H average.nc >! average.txt paste longitude.txt latitude.txt average.txt | \ psxy -JX6/4 -R-125/-67/25/53 -Cbar.cpt -Ss.02 >! plot.ps