gradcomdpdefwrite.html 3.64 KB
Newer Older
Alastair McKinstry's avatar
Alastair McKinstry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<title>GrADS Commands: printim</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
	background-color: #e0f0ff;
.red {
	color: #900;
<body text="#000000">


  <p>When GrADS opens a descriptor with a <code><a href="pdef.html">PDEF</a></code> entry that  contains options such as <code>lcc</code>, <code>lccr</code>, <code>nps</code>, <code>sps</code>, 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 <span class="red">GrADS version 2.1.0</span>, the <code>pdefwrite</code> command  will write out the interpolation weights that have been calculated internally for these special types of <code><a href="pdef.html">PDEF</a></code> entries. The file it creates can be used with a ‘<code><a href="pdef.html">PDEF</a> bilin</code>’ entry instead. </p>

  <code>pdefwrite  <i>filename </i></code> 
  <code><i>filename</i>&nbsp;&nbsp;</code>The name of the output file. If this 
  file exists, it will be replaced. 
  <code> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><br>
<h3>Usage Notes</h3>

<li><code>pdefwrite</code> works with <span class="red">GrADS version 2.1.0+</span>.
<li>The <code>pdefwrite</code> command will return an error message if you use it with a default file that does not use <code><a href="pdef.html">PDEF</a></code> or already has an external <code><a href="pdef.html">PDEF</a></code> file. If there are no errors, <code>pdefwrite</code>  will return a complete <code><a href="pdef.html">PDEF</a></code> entry that points to the file it just created. 

<h3>Example </h3>

  <li>Suppose you have a descriptor that contains the following three entries:
<ul><code>pdef 4736 3000 lcc 23.00 -120 1 1 40.0 40.0 -100 1016.2360 1016.150<br>
    xdef 6650 linear -130.0 0.01<br>
    ydef 3500 linear   20.0 0.01
   <li>Open this descriptor, then invoke pdefwrite with a file name as an argument. 
     <ul> <code>ga-> pdefwrite myfile.pdef<br>
  <li>GrADS will return the syntax for the new <code><a href="pdef.html">PDEF</a></code> entry:
<code>pdef 4736 3000 bilin stream binary-little ^myfile.pdef
    <li>Rewrite your descriptor to use this new <code><a href="pdef.html">PDEF</a></code> entry instead. Don’t change the <code><a href="descriptorfile.html#XDEF">XDEF</a></code> and <code><a href="descriptorfile.html#YDEF">YDEF</a></code> statements — those match the <code><a href="pdef.html">PDEF</a></code> file you created. </li>
    <li>Keep the <code><a href="pdef.html">PDEF</a></code> file (<code>myflile.pdef</code>) and the descriptor file together in the same directory -- this is important because of the ^ before the <code><a href="pdef.html">PDEF</a></code> file's name in the <code><a href="pdef.html">PDEF</a></code> entry. If you want to put the descriptor and <code><a href="pdef.html">PDEF</a></code> files in separate locations, change the ^ in the entry to the <code><a href="pdef.html">PDEF</a></code> file's full path, like this:
<code>pdef 4736 3000 bilin stream binary-little /your/path/to/myfile.pdef</code>