login

Scripts

Top / GrADS / script

Japanese / English

Download

Copyright etc.

Scripts below are now copyrighted under the terms of the GPL. See GNU General Public License for details.

Note that the released scripts and reference manual may have some gaps because the manual is updated first. If you need scripts that follow the manual, see develop version (it may be changed in the released version).

Download

(Scripts have been managed in GitHub since 14 June 2015.)

Main files

Sample data

Sample data (NCEP/NCAR Reanalysis) sometimes used for the script documents on this website. Please download if necessary.

How to install scripts

Script Reference

A-Z

Color, Color Bar

Script Name Brief document
color.gs Set color table for drawing.
allcolor.gs Display all the colors and color numbers.
xcbar.gs Draw a colorbar where you specify.

Panel Setting

Script Name Brief document
mul.gs Specify a plotting area in a simple manner.
mul2.gs Specify a plotting area in a simple manner.
mulval.gs Draw min/max values with mul.gs.

Data Handling

Script Name Brief document
clave.gs Make climatological mean.
lreg.gs Linear regression and correlation.
max.gs Get maximum value from two field variables.
min.gs Get minimum value from two field variables.
dlev.gs Differentiate variable with respect to lev.
shift.gs Horizontally shift values of variable.
cutdata.gs Cut data and save as a binary file.

Drawing Diagram and Character

Script Name Brief document
arrow.gs Draw arrow.
drawline.gs Draw line.
drawmark.gs Draw mark.
drawpoly.gs Draw polygon.
draws.gs Draw string at the position specified relative to the figure.
tbox.gs Draw string using text-box.
grid.gs Draw grid.
ico.gs Draw grid in icosahedral model.

Misc

Script Name Brief document
xopen.gs Automatically choose appropriate open command (open/sdfopen/xdfopen).
allclose.gs Close all the control files.
dshade.gs Draw two shading figures.
tile.gs Draw tile (hatch).
shade.gs Shading region of the specified value range.
zero.gs Draw zero line.
setshift.gs Set dimension relative to the current one.
loglabel.gs Label the vertical axis appropriately.
setlabs.gs Set axis label.
setfont.gs Set font property.
save.gs Save the current figures as eps.

Deprecated

Script Name Brief document
hatch.gs Draw hatch.
line.gs Draw line in various coordinate.

Script Function Reference

For use in GrADS script. Please execute "rc = gsfallow('on')" in the script before these script functions are invoked.

A-Z

Character Conversion

Script Function Name Brief document
atoi.gsf Convert character to ascii code.
itoa.gsf Convert ascii code to character.
chcase.gsf Convert to upper/lower case.

Character Handling

Script Function Name Brief document
rgnwrd.gsf Get strings separated by a string.
sublw.gsf sublin() + subwrd().
find.gsf Get position of the string in the string.
strrep.gsf Replace string.
printf.gsf C-printf-style formatting.
strtrim.gsf Trim white space in the string.
comarg.gsf Interpret arguments.

Space Dimension Conversion

Script Function Name Brief document
x2lon.gsf Convert longitudinal grid number (x) to longitudinal level (lon).
lon2x.gsf Convert longitudinal level (lon) to longitudinal grid number (x).
y2lat.gsf Convert latitudinal grid number (y) to latitudinal level (lat).
lat2y.gsf Convert latitudinal level (lat) to latitudinal grid number (y).
z2lev.gsf Convert vertical grid number (z) to vertical level (lev).
lev2z.gsf Convert vertical level (lev) to vertical grid number (z).
qw2xy.gsf Convert from world coordinate to XY coordinate on the drawing display.
qxy2w.gsf Convert from XY coordinate to world coordinate on the drawing display.
qw2gr.gsf Convert from world coordinate on the drawing display to grid coordinate in the data.
qgr2w.gsf Convert from grid coordinate in the data to world coordinate on the drawing display.
qxy2gr.gsf Convert from XY coordinate on the drawing display to grid coordinate in the data.
qgr2xy.gsf Convert from grid coordinate in the data to XY coordinate on the drawing display.

Time Handling

Script Function Name Brief document
t2time.gsf Convert time step to time.
time2t.gsf Convert time to time step.
dayofyear.gsf Get day of year, assuming January 1st to be 1.
days.gsf Get days of one particular month or year.
tsteps.gsf Get number of time steps for one particular month or year.
cmonth.gsf Convert integer to alphabetical month or vice versa.

Query

Script Function Name Brief document
qattr.gsf Get a part of "q attr".
qctlinfo.gsf Get a part of "q ctlinfo".
qdims.gsf Get a part of "q dims".
qgxinfo.gsf Get a part of "q gxinfo".
qgxout.gsf Get a part of "q gxout".
gradsver.gsf Obtain/Compare GrADS version.

Math Function

Script Function Name Brief document
arg.gsf Get argument.
xmath_max.gsf Get maximum value from two script variables.
xmath_min.gsf Get minimum value from two script variables.

Misc

Script Function Name Brief document
last.gsf Obtain number of files opened.
pwd.gsf Get Current Working Directory.
v2s.gsf Convert GrADS variable to GrADS script variable.
prex.gsf Print the command before it is executed.
setstr.gsf Store strings.
getstr.gsf Load stored strings.
strmem.gsf Store/Load strings.
libbase.gsf Standard Functions.

Links