To start the program, write either the command
grads -p or grads -lTry both alternatives to find out what -p and -l do. For hardcopy output (e.g., for the course report) grads -p is usually better.
If you did not manage to start GrADS with one of these two commands, this is probably because you forgot to follow the X instructions.
Once you have the .grads and .ctl files available, open the file with
open filename.ctlwhere filename.ctl is the name of your data descriptor file. Thus, you do not open the grads binary file (.grads) directly, but rather the data descriptor file (.ctl) that refers to this binary file.
The data descriptor (.ctl) files can be read from the screen or within a editor. One can inspect their contents to get an idea of what the actual binary file (.grads) contains.
1. Open the necessary file(s) by using the open command 2. Do the relevant calculations and draw the figure using the display (d) command.The harder part is step (2). GraDS has a very large number of commands, which are documented here.
You can write all GrADS commands directly from the keyboard, but this is not an efficient way of working. Generally, it is preferable to write the commads to a separate command file, which is then executed in GrADS by using the exec command
1.5 Give the command enable print figurename (or whatever filename) 3. Give the command print 4. Give the command disable print 5. Give the command !gxps -i figurename -o figurename.psA disadvantage of gxps is that MS Office does not recognize the .ps format. One way to use these files in your MS Office documents is to add the header fields given in epshead.eps and modify the BoundingBox values to crop unnecessary margins:
- cat epshead.eps figurename.ps > figurename.eps - edit the values in BoundingBox, and remove the second initgraphics line.Another, possibly easier alternative is the Inkscape program, which is directly available in Linux computers in the Physicum computer classes (though not in numlab.fmi.fi). In inkscape,
- First open the file (default import settings should be OK) - Then choose file -> save as and after this Encapsulated Postscript from the lower right menu. - In the Encapsulated Postscript window which should open now, check that there is a tick mark in the "Export area is drawing" box. - You can still edit the BoundingBox in the resulting .eps file manually if you are not happy with the outcome.
To use this command, just replace the step (5) above with
5. Give the command !gxeps -i figurename -o figurename.eps
printim figure.png produces a png file on black background printim figure.jpg jpg white produces a jpg file on white backgroundprintim is only available in relatively recent versions of GrADS.
Copy the contents of the directory to a suitable place in numlab.fmi.fi. Then execute each of the three command files, i.e.
exec example1 exec example2 exec example3to see what happens on the screen. At the same time, study the contents of the command files in emacs or another editor, to learn the commands that were used to produce the output.
A longer tutorial on using GrADS is available on the GrADS home page, more specifically here.