![]() | ![]() | Home | ![]() | My BADC | ![]() | Data | ![]() | Search | ![]() | Community | ![]() | Help | ![]() |
![]() | Guided Tour | Getting data | Formats | Software | 10 FAQ | ![]() |
Below are some key features of GrADS:
Figure 1. GrADS example output.
GrADS writes output to GrADS binary format as standard.
http://grads.iges.org/grads/downloads.html
Note that you can download either the source code or a pre-compiled binary. Use the latter if you are not sure about building the software yourself, the binary executable should work straight away on your system.
This tutorial requires that you have a sample NetCDF file. You can download the sample file here (84KB). The file (called 'wind_comps.nc') is a NetCDF file containing u-wind and v-wind data over the globe at a 2.5° resolution at the 1000hPA level. Save the NetCDF in the directory you are working in before you start the tutorial.
The following commands should allow you to calculate the wind-speed ('wspd') from the u-wind ('u') and v-wind ('v'), plot the resulting variable and write it to an output NetCDF file.
The command to type is shown in bold and the output in plain type. The commands are annotated in normal font in the right-hand column. The tutorial follows:
| ga-> grads | This starts the GrADS shell. Windows users will need to click on the GrADS icon to start it, or select it from the 'Start' menu. |
| Grid Analysis and Display System (GrADS) Version 1.8SL11
Copyright (c) 1988-2001 by Brian Doty Center for Ocean-Land-Atmosphere Studies Institute for Global Environment and Society All Rights Reserved Config: v1.8SL11 32-bit little-endian readline sdf/xdf netcdf lats printim Issue 'q config' command for more information. Landscape mode? (no for portrait): y GX Package Initialization: Size = 11 8.5 |
|
| ga-> sdfopen 'wind_comps.nc' | Opens the NetCDF file. |
| Scanning self-describing file: wind_comps.nc
Found 2 data variables in SDF file. Found displayable variable u with 0 levels in SDF file. Found displayable variable v with 0 levels in SDF file. SDF file wind_comps.nc is open as file 1 LON set to 0 360 LAT set to -90 90 LEV set to 0 0 Time values set: 2003:1:1:0 2003:1:1:0 |
|
| ga-> q file | Gives details of the file contents. |
| File 1 : BADC test data: u and v wind component.
Descriptor: wind_comps.nc Binary: wind_comps.nc Type = Gridded Xsize = 144 Ysize = 73 Zsize = 1 Tsize = 1 Number of Variables = 2 u 0 -999 ** U-velocity m s**-1 v 0 -999 ** V-velocity m s**-1 |
|
| ga-> wspd=mag(u,v) | Calculates the combined wind speed and assigns it to the variable 'wspd'. The function mag(u,v) is a built function equivalent to sqrt(uexpr*uexpr+vexpr*vexpr). |
| Define memory allocation size = 42340 bytes | |
| > d wspd | Plot the wind speed variable. |
![]() |
|
| > set fwrite output.dat | Open a file to write to called 'output.dat' in GrADS binary format. |
| FWrite file name = out2.dat FWwrite byte order is little_endian; format is stream | |
| > set gxout fwrite | Direct the output to the file. |
| > d wspd | Writes output to the file. |
| Wrote 10585 elements to out2.dat as Stream Little_Endian | |
| > quit | Closes GrADS. |
If you have problems with the tutorial please contact BADC Support.
![]() | Home | Contact | Disclaimer | Last Modified:
| ![]() |