<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi NCL users,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>How can I get a variable with latitude and longitude of another variable?</div>
<div>For example, I want var2 to have the same lat and lon of var1, without changing resolution.</div>
<div><br>
</div>
<div><span>I tried this way, but don't work</span><br>
</div>
<div><span><br>
</span></div>
<div><span><br>
</span></div>
<div><span>
<div> minlat = -37.44693</div>
<div> maxlat = -31.94739</div>
<div> minlon = -73.65259</div>
<div> maxlon = -66.7254</div>
<div><br>
</div>
<span> var2_zoom = var2(:,minlat:maxlat,minlon:maxlon)</span><br>
</span></div>
<div><span><br>
</span></div>
<div><span>
<div>fatal:Illegal subscript. Subscripts must be integer when not using coordinate indexing</div>
<div><br>
</div>
<br>
</span></div>
<div>Variable: var2</div>
<div>Type: float</div>
<div>Total Size: 4570560 bytes</div>
<div> 1142640 values</div>
<div>Number of Dimensions: 3</div>
<div>Dimensions and sizes:<span style="white-space:pre"> </span>[time | 240] x [latitude | 69] x [longitude | 69]</div>
<div>Coordinates: </div>
<div> time: [ 369..174945]</div>
<div> latitude: [-37.44693..-31.94739]</div>
<div> longitude: [-73.65259..-66.7254]</div>
<div>Number Of Attributes: 5</div>
<div> units :<span style="white-space:pre"> </span>mm</div>
<div> lon2d :<span style="white-space:pre"> </span><ARRAY of 4761 elements></div>
<div> lat2d :<span style="white-space:pre"> </span><ARRAY of 4761 elements></div>
<div> time :<span style="white-space:pre"> </span>( 0, 6, 12, 18 )</div>
<div> description :<span style="white-space:pre"> </span>Total Precipitation</div>
<div><br>
</div>
<div>
<div>Variable: var1</div>
<div>Type: float</div>
<div>Total Size: 19319040 bytes</div>
<div> 4829760 values</div>
<div>Number of Dimensions: 3</div>
<div>Dimensions and sizes:<span style="white-space:pre"> </span>[time | 240] x [latitude | 156] x [longitude | 129]</div>
<div>Coordinates: </div>
<div> time: [370.5..174946.5]</div>
<div> latitude: [-35.31664..-33.92255]</div>
<div> longitude: [-70.89447..-69.48352]</div>
<div>Number Of Attributes: 5</div>
<div> units :<span style="white-space:pre"> </span>mm</div>
<div> lon2d :<span style="white-space:pre"> </span><ARRAY of 20124 elements></div>
<div> lat2d :<span style="white-space:pre"> </span><ARRAY of 20124 elements></div>
<div> time :<span style="white-space:pre"> </span>( 0, 3, 6, 9, 12, 15, 18, 21 )</div>
<div> description :<span style="white-space:pre"> </span>Total Precipitation</div>
<div><br>
</div>
<br>
</div>
<div><br>
</div>
<br>
<p></p>
</div>
</body>
</html>