When GrADS opens a descriptor with a
PDEF entry that contains options such as
sps, et. al, it calculates the interpolation weights internally and stores them in memory for later use. These calculations can take some time for high resolution grids. There is a significant performance advantage gained from reading in the interpolation weights from an external file instead of calculating them every time you open the descriptor. Introduced in GrADS version 2.1.0, the
pdefwrite command will write out the interpolation weights that have been calculated internally for these special types of
PDEF entries. The file it creates can be used with a ‘
PDEF bilin’ entry instead.
filenameThe name of the output file. If this file exists, it will be replaced.
pdefwriteworks with GrADS version 2.1.0+.
pdefwritecommand will return an error message if you use it with a default file that does not use
PDEFor already has an external
PDEFfile. If there are no errors,
pdefwritewill return a complete
PDEFentry that points to the file it just created.
pdef 4736 3000 lcc 23.00 -120 1 1 40.0 40.0 -100 1016.2360 1016.150
xdef 6650 linear -130.0 0.01
ydef 3500 linear 20.0 0.01
ga-> pdefwrite myfile.pdef
pdef 4736 3000 bilin stream binary-little ^myfile.pdef
PDEFentry instead. Don’t change the
YDEFstatements — those match the
PDEFfile you created.
myflile.pdef) and the descriptor file together in the same directory -- this is important because of the ^ before the
PDEFfile's name in the
PDEFentry. If you want to put the descriptor and
PDEFfiles in separate locations, change the ^ in the entry to the
PDEFfile's full path, like this:
pdef 4736 3000 bilin stream binary-little /your/path/to/myfile.pdef