#!/bin/tcsh # # gp2d is like gp1d (see that file) except that it sorts the summary files # according to both key values, and writes the output files in a format for # making 2D plots with Gnuplot. # # Usage: # gp2d <"input files"> # # See gp1d for more info, but remember that the "input files" pattern # must be quoted on the command line. # echo $#argv if ($#argv > 3 || $#argv < 3) then echo "Usage:" echo 'gp2d <"input files"> ' exit endif foreach param (emit_y orbit_y eta_y cbar12 param) cat $1 | grep "^ *$2 *$param" | sort -g -k3 -k4 | \ awk \ 'BEGIN {firstLine=1} \ { if (firstLine == 1) {firstLine = 0; currentNum = $3;} \ if ($3 == currentNum) {print $0;} \ if ($3 != currentNum) {currentNum = $3; print ""; print $0;}}' \ > $3.$param.all end