<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Georgia;
panose-1:2 4 5 2 5 4 5 2 3 3;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">Hi NCL users<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">I’m trying to open/read/plot a grd file in NCL. Frist I read the file in R to identify the dimensions<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">> r<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">class : RasterLayer
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">dimensions : 424, 1327, 562648 (nrow, ncol, ncell)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">resolution : 0.2713213, 0.2713213 (x, y)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">extent : -180.1357, 179.9078, -55.13566, 59.90459 (xmin, xmax, ymin, ymax)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">crs : NA
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">source : H:/MunichRe_Wind/VIENTO_MUNDO_TR100_INT1.grd
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">names : VIENTO_MUNDO_TR100_INT1
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all">
<span style="font-size:9.0pt;font-family:"Lucida Console";color:#0070C0">values : 0, 444.2024 (min, max)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">When I read it in NCL, the max and min number are different
<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#0070C0">Variable: x<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Type: float<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Total Size: 2250592 bytes<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> 562648 values<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Number of Dimensions: 2<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Dimensions and sizes: [lat | 424] x [lon | 1327]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Coordinates:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lat: [-55.13566..59.90459]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lon: [-180.1357..179.9078]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">Number Of Attributes: 3<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> units : ??<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> long_name : 100 year windspeed<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> _FillValue : -999<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">(0) min(x)=-3.39951e+38<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">(0) max(x)=3.40086e+38<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">Max/Min number in R looks more reasonable. Here is file –<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif""><a href="https://data.humdata.org/dataset/cyclone-wind-100-years-return-period"><span style="color:blue">https://data.humdata.org/dataset/cyclone-wind-100-years-return-period</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">here is my NCL code-<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;color:#0070C0"> </span><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> diri = "./"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> fili = "VIENTO_MUNDO_TR100_INT1.grd" ; DSET<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> fName = diri+fili<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> nlat = 424 ; YDEF<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> mlon = 1327 ; XDEF<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> ; generate lat/lon<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lon = fspan(-180.1357,179.9078,1327)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lon!0 = "lon"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lon@long_name = "longitude"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lon@units = "degrees_east"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lat = fspan(-55.13566,59.90459,424)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lat!0 = "lat"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lat@long_name = "latitude"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> lat@units = "degrees_north"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> ; create an array to contain data<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> UNDEF = -999. ; UNDEF<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x = new ( (/nlat,mlon/), float, UNDEF)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x!0 = "lat"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x!1 = "lon"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x&lat = lat<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x&lon = lon<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x@long_name = "100 year windspeed" ; VARS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x@units = "??"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">;setfileoption("bin","ReadByteOrder","Native") ; a033 default<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0">;setfileoption("bin","ReadByteOrder","LittleEndian")<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> setfileoption("bin","ReadByteOrder","BigEndian")<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> ; read each record: store in x<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> ; the ::-1 changes the latitude order<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> x = fbinrecread(fName,0, (/nlat,mlon/), "float")<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> printVarSummary(x)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> print ("min(x)="+min(x))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:#0070C0"> print ("max(x)="+max(x))</span><span style="font-size:9.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Georgia","serif"">with regards<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:#00B0F0">Debasish PaiMazumder, PhD |</span></b><span style="font-size:12.0pt;color:#666666">Tel
<a href="tel:%2B1%20215%20255%206371" target="_blank"><span style="color:blue">+1 215 255 6052</span></a> | Cell
<a href="tel:%2B1%20718%20913%206946" target="_blank"><span style="color:blue">+1 267 449 5226</span></a> |</span><u><span style="font-size:12.0pt;color:blue"><a href="mailto:Debasish.Paimazumder@aig.com">Debasish.Paimazumder@aig.com</a></span></u><span style="font-size:12.0pt;color:blue">
</span><b><span style="font-size:12.0pt;color:#00B0F0"><o:p></o:p></span></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>