When GrADS opens a descriptor with a PDEF entry that contains options such as lcc, lccr, nps, 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.



Usage Notes

  1. pdefwrite works with GrADS version 2.1.0+.
  2. The pdefwrite command will return an error message if you use it with a default file that does not use PDEF or already has an external PDEF file. If there are no errors, pdefwrite will return a complete PDEF entry that points to the file it just created.


  1. Suppose you have a descriptor that contains the following three entries:
  2. Open this descriptor, then invoke pdefwrite with a file name as an argument.
  3. GrADS will return the syntax for the new PDEF entry:
  4. Rewrite your descriptor to use this new PDEF entry instead. Don’t change the XDEF and YDEF statements — those match the PDEF file you created.
  5. Keep the PDEF file (myflile.pdef) and the descriptor file together in the same directory -- this is important because of the ^ before the PDEF file's name in the PDEF entry. If you want to put the descriptor and PDEF files in separate locations, change the ^ in the entry to the PDEF file's full path, like this: