diff -uNr GMT4.0/share/pslib/PSL_prologue.ps GMT4.0_barb/share/pslib/PSL_prologue.ps --- GMT4.0/share/pslib/PSL_prologue.ps 2004-01-13 04:18:13.000000000 +0900 +++ GMT4.0_barb/share/pslib/PSL_prologue.ps 2005-03-13 08:17:16.000000000 +0900 @@ -39,6 +39,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.0/src/GMT.in GMT4.0_barb/src/GMT.in --- GMT4.0/src/GMT.in 2004-01-03 12:30:02.000000000 +0900 +++ GMT4.0_barb/src/GMT.in 2005-03-13 08:17:16.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.0/src/Makefile GMT4.0_barb/src/Makefile --- GMT4.0/src/Makefile 2004-08-25 09:19:15.000000000 +0900 +++ GMT4.0_barb/src/Makefile 2005-03-13 08:17:16.000000000 +0900 @@ -108,7 +108,7 @@ 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 \ sample1d.c spectrum1d.c splitxyz.c surface.c trend1d.c trend2d.c \ - triangulate.c xyz2grd.c + triangulate.c xyz2grd.c grdbarb.c first: all @@ -149,7 +149,7 @@ all: init libs $(PROGS) 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.0/src/grdbarb.c GMT4.0_barb/src/grdbarb.c --- GMT4.0/src/grdbarb.c 1970-01-01 09:00:00.000000000 +0900 +++ GMT4.0_barb/src/grdbarb.c 2005-03-13 08:16:50.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[