diff -uNr GMT4.1.1/share/pslib/PSL_prologue.ps GMT4.1.1_barb/share/pslib/PSL_prologue.ps --- GMT4.1.1/share/pslib/PSL_prologue.ps 2006-01-17 06:56:31.000000000 +0900 +++ GMT4.1.1_barb/share/pslib/PSL_prologue.ps 2006-03-31 20:08:18.000000000 +0900 @@ -41,6 +41,8 @@ /A4 {0 exch M 0 D D D D D 0 D P S} bind def /A5 {0 exch M 0 D D D D D 0 D P V K F U N} bind def /A6 {0 exch M 0 D D D D D 0 D P V K F U S} bind def +/Bt {0 M D D P F} bind def +/Bl {0 M D S} bind def /C0 {0 360 arc V A F U N} bind def /C1 {0 360 arc V A F U S} bind def /C2 {0 360 arc V C F U N} bind def diff -uNr GMT4.1.1/share/pslib/PSL_prologue.ps.orig GMT4.1.1_barb/share/pslib/PSL_prologue.ps.orig --- GMT4.1.1/share/pslib/PSL_prologue.ps.orig 1970-01-01 09:00:00.000000000 +0900 +++ GMT4.1.1_barb/share/pslib/PSL_prologue.ps.orig 2006-03-31 20:08:18.000000000 +0900 @@ -0,0 +1,138 @@ +% $Id: PSL_prologue.ps,v 1.9 2006/01/13 20:31:19 pwessel Exp $ +%%BeginProlog + +% Begin pslib header + +250 dict begin +/A /setgray load def +/B /setdash load def +/C /setrgbcolor load def +/D /rlineto load def +/E {dup stringwidth pop} bind def +/F /fill load def +/G /rmoveto load def +/K /setcmykcolor load def +/L /lineto load def +/M {stroke moveto} bind def +/m {moveto} bind def +/N /newpath load def +/O {M W 0 0 D S} bind def +/P /closepath load def +/R /rotate load def +/S /stroke load def +/T /translate load def +/U /grestore load def +/V /gsave load def +/W /setlinewidth load def +/X {M dup 0 D dup 2 div neg dup G 0 exch D S} bind def +/Y {findfont exch scalefont setfont} bind def +/Z /show load def +/a0 {0 0 M D D 0 D D D D D 0 D D P V A F U N} bind def +/a1 {0 0 M D D 0 D D D D D 0 D D P V A F U S} bind def +/a2 {0 0 M D D 0 D D D D D 0 D D P V C F U N} bind def +/a3 {0 0 M D D 0 D D D D D 0 D D P V C F U S} bind def +/a4 {0 0 M D D 0 D D D D D 0 D D P S} bind def +/a5 {0 0 M D D 0 D D D D D 0 D D P V K F U N} bind def +/a6 {0 0 M D D 0 D D D D D 0 D D P V K F U S} bind def +/A0 {0 exch M 0 D D D D D 0 D P V A F U N} bind def +/A1 {0 exch M 0 D D D D D 0 D P V A F U S} bind def +/A2 {0 exch M 0 D D D D D 0 D P V C F U N} bind def +/A3 {0 exch M 0 D D D D D 0 D P V C F U S} bind def +/A4 {0 exch M 0 D D D D D 0 D P S} bind def +/A5 {0 exch M 0 D D D D D 0 D P V K F U N} bind def +/A6 {0 exch M 0 D D D D D 0 D P V K F U S} bind def +/C0 {0 360 arc V A F U N} bind def +/C1 {0 360 arc V A F U S} bind def +/C2 {0 360 arc V C F U N} bind def +/C3 {0 360 arc V C F U S} bind def +/C4 {0 360 arc S} bind def +/C5 {0 360 arc V K F U N} bind def +/C6 {0 360 arc V K F U S} bind def +/D0 {M 5 {dup} repeat D neg exch D neg exch neg D P V A F U N} bind def +/D1 {M 5 {dup} repeat D neg exch D neg exch neg D P V A F U S} bind def +/D2 {M 5 {dup} repeat D neg exch D neg exch neg D P V C F U N} bind def +/D3 {M 5 {dup} repeat D neg exch D neg exch neg D P V C F U S} bind def +/D4 {M 5 {dup} repeat D neg exch D neg exch neg D P S} bind def +/D5 {M 5 {dup} repeat D neg exch D neg exch neg D P V K F U N} bind def +/D6 {M 5 {dup} repeat D neg exch D neg exch neg D P V K F U S} bind def +/R0 {M dup 0 D exch 0 exch D neg 0 D P V A F U N} bind def +/R1 {M dup 0 D exch 0 exch D neg 0 D P V A F U S} bind def +/R2 {M dup 0 D exch 0 exch D neg 0 D P V C F U N} bind def +/R3 {M dup 0 D exch 0 exch D neg 0 D P V C F U S} bind def +/R4 {M dup 0 D exch 0 exch D neg 0 D P S} bind def +/R5 {M dup 0 D exch 0 exch D neg 0 D P V K F U N} bind def +/R6 {M dup 0 D exch 0 exch D neg 0 D P V K F U S} bind def +/S0 {M dup dup 0 D 0 exch D neg 0 D P V A F U N} bind def +/S1 {M dup dup 0 D 0 exch D neg 0 D P V A F U S} bind def +/S2 {M dup dup 0 D 0 exch D neg 0 D P V C F U N} bind def +/S3 {M dup dup 0 D 0 exch D neg 0 D P V C F U S} bind def +/S4 {M dup dup 0 D 0 exch D neg 0 D P S} bind def +/S5 {M dup dup 0 D 0 exch D neg 0 D P V K F U N} bind def +/S6 {M dup dup 0 D 0 exch D neg 0 D P V K F U S} bind def +/T0 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V A F U N} bind def +/T1 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V A F U S} bind def +/T2 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V C F U N} bind def +/T3 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V C F U S} bind def +/T4 {M dup 0 D dup 2 div neg exch 0.866025 mul D P S} bind def +/T5 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V K F U N} bind def +/T6 {M dup 0 D dup 2 div neg exch 0.866025 mul D P V K F U S} bind def +/I0 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V A F U N} bind def +/I1 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V A F U S} bind def +/I2 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V C F U N} bind def +/I3 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V C F U S} bind def +/I4 {M dup 0 D dup 2 div neg exch -0.866025 mul D P S} bind def +/I5 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V K F U N} bind def +/I6 {M dup 0 D dup 2 div neg exch -0.866025 mul D P V K F U S} bind def +/E0 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V A F U N U} bind def +/E1 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V A F U S U} bind def +/E2 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V C F U N U} bind def +/E3 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V C F U S U} bind def +/E4 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P S U} bind def +/E5 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V K F U N U} bind def +/E6 {V T dup 0 exch M 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop P V K F U S U} bind def +/H0 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V A F U N U} bind def +/H1 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V A F U S U} bind def +/H2 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V C F U N U} bind def +/H3 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V C F U S U} bind def +/H4 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P S U} bind def +/H5 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V K F U N U} bind def +/H6 {V T dup dup 2 div exch 0.866025404 mul M 5 {-60 R dup 0 D} repeat pop P V K F U S U} bind def +/N0 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V A F U N U} bind def +/N1 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V A F U S U} bind def +/N2 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V C F U N U} bind def +/N3 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V C F U S U} bind def +/N4 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P S U} bind def +/N5 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V K F U N U} bind def +/H6 {V T dup 1.175570504 mul exch dup 0.587785252 mul exch -0.809016994 mul M 4 {72 R dup 0 D} repeat pop P V K F U S U} bind def +/O0 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V A F U N U} bind def +/O1 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V A F U S U} bind def +/O2 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V C F U N U} bind def +/O3 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V C F U S U} bind def +/O4 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P S U} bind def +/O5 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V K F U N U} bind def +/O6 {V T dup dup 0.414213562 mul exch M 0.828427125 mul 7 {-45 R dup 0 D} repeat pop P V K F U S U} bind def +/P0 {arc P V A F U N} bind def +/P1 {arc P V A F U S} bind def +/P2 {arc P V C F U N} bind def +/P3 {arc P V C F U S} bind def +/P4 {arc P S} bind def +/P5 {arc P V K F U N} bind def +/P6 {arc P V K F U S} bind def +/a {P V A F U N} def +/b {P V A F U S} def +/c {P V C F U N} def +/d {P V C F U S} def +/k {P V K F U N} def +/l {P V K F U S} def +/p {P S} def +/q {M {D} repeat P V A F U N} def +/r {M {D} repeat P V A F U S} def +/s {M {D} repeat P V C F U N} def +/t {M {D} repeat P V C F U S} def +/u {M {D} repeat P V K F U N} def +/v {M {D} repeat P V K F U S} def +/w {M {D} repeat P S} def +/bby {tcf pathbbox N exch pop sub abs exch pop} bind def +/tcf {true charpath flattenpath} bind def + +%%EndProlog diff -uNr GMT4.1.1/src/GMT.in GMT4.1.1_barb/src/GMT.in --- GMT4.1.1/src/GMT.in 2005-12-17 14:59:21.000000000 +0900 +++ GMT4.1.1_barb/src/GMT.in 2006-03-31 20:08:18.000000000 +0900 @@ -73,6 +73,7 @@ grd2cpt Make a color palette table from a grdfile grdblend Blend several partially over-lapping grdfiles onto one grid grd2xyz Conversion from 2-D gridded file to table data + grdbarb Plot wind barbs from grdfiles grdclip Limit the z-range in gridded data grdcontour Contouring of 2-D gridded data grdcut Cut a sub-region from a grd file diff -uNr GMT4.1.1/src/Makefile GMT4.1.1_barb/src/Makefile --- GMT4.1.1/src/Makefile 2005-12-22 14:10:03.000000000 +0900 +++ GMT4.1.1_barb/src/Makefile 2006-03-31 20:08:45.000000000 +0900 @@ -113,7 +113,7 @@ PROGSPS_C = gmt2rgb.c grdcontour.c grdimage.c grdvector.c grdview.c psbasemap.c psclip.c \ pscoast.c pshistogram.c psimage.c pslegend.c psmask.c psrose.c psscale.c pstext.c pscontour.c \ - pswiggle.c psxy.c psxyz.c + pswiggle.c psxy.c psxyz.c grdbarb.c first: all @@ -166,7 +166,7 @@ all: init libs $(ALLPROGS) init: gmtmacros gmt_notposix.h gmt_nan.h - + gmtmacros: if [ `cat makegmt.macros | wc -c` = 0 ]; then \ echo "src/makegmt.macros is empty - you must rerun configure in the main GMT directory"; \ diff -uNr GMT4.1.1/src/grdbarb.c GMT4.1.1_barb/src/grdbarb.c --- GMT4.1.1/src/grdbarb.c 1970-01-01 09:00:00.000000000 +0900 +++ GMT4.1.1_barb/src/grdbarb.c 2006-03-31 20:08:18.000000000 +0900 @@ -0,0 +1,409 @@ +/*-------------------------------------------------------------------- + * $Id: grdvector.c,v 1.14 2004/08/17 01:48:06 pwessel Exp $ + * + * Copyright (c) 1991-2004 by P. Wessel and W. H. F. Smith + * See COPYING file for copying and redistribution conditions. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Contact info: gmt.soest.hawaii.edu + *--------------------------------------------------------------------*/ +/* + grdvector reads 2 grdfiles that contains the 2 components of a vector + field (cartesian or polar) and plots vectors at the grid positions. + This is basically a short-hand for using grd2xyz | psxy -SV and is + more convenient for such plots on a grid. + + Author: Paul Wessel + Date: 12-JUN-1995 + Revised: 15-FEB-2000 + Version: 4 + + grdbarb ( based source code is grdvector.c ) reads 2 grd files that + contains the 2 components of a vector field ( cartesian or polar ) + and plots wind barbs at the grid positions. This is basically a + short-hand for using grd2xyz | psxy -SU and is more convenient for + such plots on a grid. + + Author: KATO Masay + Date: 13-MAR-2005 + Version: 0.6 ( for GMT4.0 ) + + */ + + +#include "gmt.h" + +float *r, *theta; + +main (int argc, char **argv) +{ + + int i, j, n = 0, nm, nx, ny, ij, i0, j0, di, dj, off; + int dummy[4], knot_or_ms = 0; + + BOOLEAN convert_angles = FALSE, get_rgb = FALSE, cartesian = TRUE, shrink = FALSE, set_fill = FALSE; + BOOLEAN error = FALSE, center = FALSE, outline = FALSE, azimuth = FALSE, inc_set = FALSE; + BOOLEAN clip = TRUE, got_fix_length = FALSE; + + char *file[2], *cpt, txt_a[32], txt_b[32], txt_c[32], unit = 0; + + double dx2, dy2, b_width = 0.1, b_length = 0.2, b_angle = 120., b_scale = 5.; + double v_w, h_l, h_w, v_shrink, v_norm = 0.0, tmp, x, y, plot_x, plot_y, x_off, y_off; + double west, east, south, north, x2, y2, scale = 1.0, fix_length = 0.0; + double data_west, data_east, data_south, data_north, value, c, s; + + struct GRD_HEADER h[2]; + struct GMT_FILL fill; + struct GMT_PEN pen; + + GMT_init_pen (&pen, GMT_PENWIDTH); + GMT_init_fill (&fill, -1, -1, -1); + west = east = south = north = 0.0; + dummy[0] = dummy[1] = dummy[2] = dummy[3] = 0; + di = dj = 1; + i0 = j0 = 0; + dx2 = dy2 = 0.0; + + argc = GMT_begin (argc, argv); + + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + switch (argv[i][1]) { + /* Common parameters */ + + case 'B': + case 'J': + case 'K': + case 'O': + case 'P': + case 'R': + case 'U': + case 'V': + case 'X': + case 'x': + case 'Y': + case 'y': + case 'c': + case '\0': + error += GMT_get_common_args (argv[i], &west, &east, &south, &north); + break; + + /* Supplemental parameters */ + + case 'A': + cartesian = FALSE; + break; + case 'E': + center = TRUE; + break; + case 'I': /* Only use gridnodes dx2,dy2 apart */ + GMT_getinc (&argv[i][2], &dx2, &dy2); + inc_set = TRUE; + break; + case 'N': /* Do not clip at border */ + clip = FALSE; + break; + case 'Q': + if (argv[i][2] && argv[i][3] != 'n') { + if (sscanf (&argv[i][2], "%[^/]/%[^/]/%lf/%lf", txt_a, txt_b, &b_angle, &b_scale) != 4) { + fprintf (stderr, "%s: GMT SYNTAX ERROR -Q option: Could not decode barbwidth/barblength/barbangle/barbscale\n", GMT_program); + error++; + } + else { + b_width = GMT_convert_units (txt_a, GMT_INCH); + b_length = GMT_convert_units (txt_b, GMT_INCH); + } + } + break; + case 'T': + convert_angles = TRUE; + break; + case 'W': /* Set line attributes */ + if (argv[i][2] && GMT_getpen (&argv[i][2], &pen)) { + GMT_pen_syntax ('W'); + error++; + } + outline = TRUE; + break; + case 'Z': + azimuth = TRUE; + break; + case 'C': + case 'G': + case 'S': + break; + default: + error = TRUE; + GMT_default_error (argv[i][1]); + break; + } + } + else if (n < 2) + file[n++] = argv[i]; + else + n++; + } + + if (argc == 1 || GMT_quick) { + fprintf (stderr, "grdbarb %s - Plot wind barb fields from grdfiles\n\n", GMT_VERSION); + fprintf (stderr, "usage: grdbarb compx.grd compy.grd -J -R [-A]\n"); + fprintf (stderr, "\t[-B] [-E] [-I] [-K] [-O] [-P] [-Q] [-N] [-T]\n"); + fprintf (stderr, "\t[-U[