Copies grids from one dataset to another.
GRDCOPY sdataset ddataset [keywords]
Individual grids are stored in grid files. Each dataset position points to a single grid file. GRDCOPY copies grids from one or more grid files in the source dataset to a single grid file in the destination dataset.
If you specify DEL=YES or a position number of a nonexistent grid file in the ddataset parameter, the grids are copied into a newly created grid file with the attributes specified in keywords MAXGRD and TITLE.
Using the DGRID keyword may result in grids being overwritten in the destination grid file. For example, if the destination grid file has 50 grids (in grids 1 to 50) and you specify NUM=10 DGRID=25, the new grids will overwrite grids 25 to 34 in the destination grid file.
The GRID keyword copies grids from the grid file specified with the sdataset position number; the default position value, ALL, is not valid. When using the GRID keyword, do not specify additional search keywords, PARAM, LEV, DAY, etc., or NUM.
If you specify PARAM=STREAML, WINDB or WINDV, GRDCOPY does not search for grids with that parameter. Instead, it locates the u-component grids that match the other search keywords, then locates the matching v-component grids, and copies both sets of grids to the destination dataset. These grids may be used to draw streamlines, plot wind barbs or plot wind vectors with the GRDDISP command. If you specify any other parameter with the PARAM keyword, the value entered is the value searched for in the grid's parameter field.
Use command GRDLIST to preview the grids to be copied with GRDCOPY.
Use the SUBSECT keyword to copy a portion of the source grid. This keyword is useful because the subsected grid is smaller and can be copied more quickly than the source grid.
Use the DERIVE keyword to create grids of a variety of common meteorological parameters. The valid options are defined in the table below. In these equations, the following variables appear often:
Use the MERIDIONAL keyword to correct for the convergence of longitude lines at the poles. When deriving divergence and stretching deformation grids (DVG and DST), specify MERIDIONAL=YES to subtract the following correction term from the calculation.
When deriving vorticity, absolute vorticity, or shear deformation grids (VOR, ABV, or DSH), specify MERIDIONAL=YES to add the following correction term to the calculation.
For both the correction terms above:
The MERIDIONAL keyword has no effect with other DERIVE keyword options.
Use the Gn keywords to specify the grids to be used with the MATH keyword. Each Gn keyword specifies a single grid. Gn is followed by a list of select clauses in single quotes. By default, subsequent Gn keywords have the same select clauses, unless specified differently. For example, to request 850 and 1000 mb height grids from the 0:00 UTC GFS run, specify
G1='LEV 850;PARAM Z;TIME 0;SRC GFS' G2='LEV 1000'
The MATH keyword defines the operation to perform on the specified grids, for example, MATH='G1**(SQRT(G2))'. The table below shows the operations available with the MATH keyword.
When specifying powers of ten, such as 102 or 10-3 in the MATH keyword, use one of the two methods shown in the examples below.
MATH='2*7.292*(1e-5)*(SIN(G1))'
MATH='2*7.292*(10**(-5))*(SIN(G1))'
In these entries both 1e-5 and 10**(-5) represent 10-5. You must include the parentheses with 10**(-5); 10**-5 will not be interpreted correctly.
When using the MATH keyword and the range of output data values is larger than five orders of magnitude, the output grid is scaled based on the maximum end of the range. This means that small data values may be replaced by zeros in the output grid.
Grids created using GRDCOPY and those created using IGG MAKE with the DERIVE or MATH keyword may not yield numerically identical results. However, the values for both are correct. The differences are the result of one of the following:
GRDCOPY NCEP/GFS MYDATA/GRIDS.1
This entry copies the first grid in the first grid file in dataset NCEP/GFS to the grid after the last grid in position 1 of dataset MYDATA/GRIDS.
GRDCOPY NCEP/GFS.5 MYDATA/GRIDS.2 LEV=850 NUM=10 DGRID=5
This entry copies the first 10 grids with a level of 850 mb in position 5 of dataset NCEP/GFS to grids 5 through 14 in position 2 of dataset MYDATA/GRIDS.
GRDCOPY NCEP/GFS.5 MYDATA/GRIDS.1 NUM=ALL DEL=YES TITLE='All grids in NCEP/GFS position 5'
This entry copies all grids in position 5 of dataset NCEP/GFS to position 1 of dataset MYDATA/GRIDS. The keyword DEL=YES deletes the existing destination grid file and creates a new file with the title All grids in NCEP/GFS position 5 for the copied grids. Since the destination grid file is new, the copied grids begin in grid 1. Be careful when using NUM=ALL; grid files can contain thousands of grids. Use the search keywords to copy only the desired grids, as shown in the following examples.
GRDCOPY NMC/ETA.ALL G/SCRATCH.10 LEV=500 PARAM=Z T TD RH ABV DAY=#Y TIME=0 NUM=ALL
This entry copies all 500 mb height, temperature, dew point temperature, relative humidity and absolute vorticity grids from today's 00 UTC run in all grid files in dataset NMC/ETA to position 10 of dataset G/SCRATCH. The grids are appended after the last grid in the destination grid file.
GRDCOPY NMC/ETA.1 G/MODEL.2 LEV=TRO PARAM=Z T FHOUR=12 36 NUM=ALL DGRID=1
This entry copies all 12- and 36-hour forecast tropopause height and temperature grids in position 1 of dataset NMC/ETA to position 2 of dataset G/MODEL. The copied grids begin in grid 1 of the destination grid file.
GRDCOPY NMC/ETA.1 G/MODEL.2 LEV=TRO PARAM=Z T FRANGE=12 36 6 NUM=ALL DGRID=100
This entry copies all 12-, 18-, 24-, 30-, and 36-hour forecast tropopause height and temperature grids in position 1 of dataset NMC/ETA to position 2 of dataset G/MODEL. The copied grids begin in grid 100 of the destination grid file.
GRDCOPY NMC/ETA.1 G/MODEL.2 LEV=TRO PARAM=Z T FDAY=#Y FTIME=18 NUM=ALL
This entry copies all forecast tropopause height and temperature grids valid at 18 UTC today in position 1 of dataset NMC/ETA to position 2 of dataset G/MODEL. The grids are appended after the last grid in the destination grid file.
GRDCOPY MODEL.5 GRD.1 GRID=1 20 DGRID=1
This entry copies grids 1 through 20 in position 5 of the dataset with the alias name MODEL to grids 1 through 20 in position 1 of the dataset with the alias name GRD.
GRDCOPY GRIDS/GFS CASE/STUDY.1 DAY=#Y TIME=12 PARAM=U V LEV=200 SUBSECT=-20 20 -180 -120 1 2 NUM=ALL
This entry copies all 200 mb height u- and v-component grids from today's 12 UTC run in dataset GRIDS/GFS to position 1 of dataset CASE/STUDY. The copied grids contain every source grid point in the row direction and every other source grid point in the column direction in the region 20°S to 20°N and 180°E to 120°E.
GRDCOPY GG.1 GRD.4000 DERIVE=SPD LEV=500 FHOUR=48
The entry creates a 500 mb wind speed grid using component grids in position 1 of the dataset with the alias GG. The grids used to derive wind speed are the u- and v-components of the wind with 48-hour forecast times. The derived grid is copied to position 4000 of the dataset with the alias GRD.
GRDCOPY RTGRIDS/GFS LOCAL/MYGRIDS.10 DERIVE=VOR LEV=500 DAY=96284 TIME=12 FHOUR=12 24 36 48 NUM=ALL
This entry creates 500 mb relative vorticity grids using component grids from dataset RTGRIDS/GFS. The grids used to derive relative vorticity are the u- and v-components of the wind from day 96284 at 12:00 UTC with 12-, 24-, 36-, and 48-hour forecast times. The derived grids are copied to position 10 of the dataset LOCAL/MYGRIDS.
GRDCOPY GRD.8000 GRD.4000 G1='PARAM Z;LEV 850;FHOUR 48' G2='LEV 1000' MATH='G1-G2' NEWPAR=THCK
This entry finds two 48-hour forecast geopotential height grids in position 8000 of the dataset with the alias GRD. The 1000 mb grid is subtracted from the 850 mb grid and the result is copied to position 4000 of the dataset with the alias GRD. The copied grid is labeled with the new parameter name THCK and units NONE.
GRDCOPY GRD.4004 GRD.4004 G1='PARAM T;LEV 1000' G2='LEV 850' G3='PARAM U;LEV 1000' G4='LEV 850' NEWPAR=M DEG MATH='(COR(G1))/9.8*((G1+G2)/2)*((G3-G4)/(G1-G2))'
This entry creates a grid of frontal slope (Margules equation) from the 1000 and 850 mb temperature grids, and the 1000 and 850 mb u-component grids in position 4004 of the dataset with the alias GRD. The grid is copied into the same dataset, and labeled M with units DEG.
GRDCOPY G/G.4000 G/G.4000 G1='PAR T;LEV 1000;TIME 12; DAY 93070;SRC GFS' G2='PAR U;SRC ROI' G3='PAR V; SRC ROI' MATH='-(G2*(DDX(G1))+G3*(DDY(G1)))' INFO='Temperature Advection at 1000 MB' NEWPAR=TADV K/S
This entry creates a grid of 1000 mb temperature advection using the 1000 millibar GFS model temperature grid, and the 1000 mb ROI model u- and v-component grids in position 4000 of the dataset G/G. The grid is copied into the same dataset, and labeled TADV with units of degrees Kelvin per second. The string Temperature Advection at 1000 MB is placed in the header of the new grid.