For most users of WRF and MET, using the predefined NCEP grids will not suffice. Instead, you will often want to interpolate to the domain on which your model data resides. This is easy to do with COPYGB but will require you to define the grid to be used on the command line. The grid definition arguments to COPYGB differ based on the type of projection used. Listed below are the arguments for user-defined Lat/Lon grids:
copygb -g"255 0 NX NY LAT0 LON0 128 LAT1 LON1 DX DY 64" -x in.grb out.grb
where | ||
255 0 | User-defined Lat/Lon grid | |
NX | Number of points on latitude circle | |
NY | Number of points on longitude meridian | |
LAT0 | Latitude of origin * 1000 (lat = -90 ... 90) | |
LON0 | Longitude of origin * 1000 (lon = -180 ... 180) | |
128 | ||
LAT1 | Latitude of extreme (last) point * 1000 | |
LON1 | Longitude of extreme (last) point * 1000 | |
DX | Longitudinal increment in millidegrees | |
DY | Latitudinal increment in millidegrees | |
64 |
Please note that all of the grid definition parameters must be integers. All latitude, longitude, and increments values are given in thousandths of a degree.
User-Defined Lat/Lon Grid
Let's define a Lat/Lon grid over the central United States as follows:
- Latitude ranging from 35N to 45N
- Longitude ranging from 105W to 90W
- 0.5 degree grid spacing
Translate this definition to the COPYGB grid specification as follows:
- NX = 30
- NY = 20
- LAT0 = 35000
- LON0 = -105000
- LAT1 = 45000
- LON1 = -90000
- DX = 500
- DY = 500
Plug these numbers into the grid specification and run COPYGB as follows:
-xg"255 0 30 20 35000 -105000 128 45000 -90000 500 500 64" \
$MET_TUTORIAL_DATA/input/sample_obs/ST2ml/ST2ml2005080712.Grb_G212 \
$MET_TUTORIAL_DATA/output/copygb/ST2ml2005080712.Grb_latlon
Lastly, run wgrib on the COPYGB output and make sure the grid definition matches what you expected: