<div dir="ltr"><div><div><div><div><div>If you wrote the binary using:<br><br><div>     open(2,file=ofile,status=&#39;unkn<wbr>own&#39;,form=&#39;unformatted&#39;)<br></div><div>     write(2) (((hgtm(i,j,k),i=1,imx),j=1,jm<wbr>x),k=1,lx)</div><br></div>I believe this is a fortran <b>sequential</b> write *not* fortran <b>direct</b> access write.<br><br></div>Sequential writes contain &#39;hidden&#39; bytes. <br><br></div>You are using <br><br>    hgt       = fbindirread(path_prs, 0, dims, &quot;float&quot;)<br></div><div>   printMinMax(hgt, 0)     ; what does this indicate&lt;====<br></div><div><br></div>The &quot; fbindirread&quot; is for direct access *not* for sequential files.<br><br></div>Please look at:<br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/fbinrecread.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/fbinrecread.shtml</a><br><br>   hgt       = fbinrecread(path_prs, 0, dims, &quot;float&quot;)<br>   printMinMax(hgt, 0)     ; what does this indicate&lt;====   </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 14, 2017 at 10:29 AM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have defined your 3D array dimensions as nlat x nlon x nlev, but then you are defining the dimensions of &quot;hgt&quot; in a different order:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span class=""><div style="font-size:12.8px">hgt!0                   = &quot;level&quot;</div><div style="font-size:12.8px">hgt!1                   = &quot;lat&quot;</div><div style="font-size:12.8px">hgt!2                   = &quot;lon&quot;</div><div style="font-size:12.8px"><br></div></span><div style="font-size:12.8px">The above implies your hgt array is ordered nlev x nlat x nlon.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I don&#39;t know how your data is ordered on the binary file, but you either need to fix your &quot;dims&quot; array:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span style="font-size:12.8px">  dims  = (/nlev,nlat,nlon/)</span><br></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">or you need to fix the order that you name the &quot;hgt&quot; dimensions:</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><div style="font-size:12.8px">hgt!0                   = &quot;lat&quot;</div><div style="font-size:12.8px">hgt!1                   = &quot;lon&quot;</div><div style="font-size:12.8px">hgt!2                   = &quot;level&quot;</div><div style="font-size:12.8px"><br>I think everything else in your script looks okay, but this code is redundant:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span class=""><div style="font-size:12.8px">hgt&amp;level@units         = &quot;hPa&quot;</div><div style="font-size:12.8px">hgt&amp;lat@units           = &quot;degrees_north&quot;</div><div style="font-size:12.8px">hgt&amp;lon@units           = &quot;degrees_east&quot;</div><div style="font-size:12.8px"><br></div></span><div style="font-size:12.8px">You&#39;ve already attached the &quot;units&quot; to the level, lat, and lon arrays, so you don&#39;t need to do it again.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">--Mary</div><div style="font-size:12.8px"><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Mar 13, 2017 at 11:41 PM, 김가은 <span dir="ltr">&lt;<a href="mailto:gaeun.kim0921@gmail.com" target="_blank">gaeun.kim0921@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello, world!<div><br></div><div>I want to draw several plots with data which is a binary file contains 6 variables(3-dimensional) and made like below:</div><div><br></div><div>open(2,file=ofile,status=&#39;unkn<wbr>own&#39;,form=&#39;unformatted&#39;)<br></div><div><div>     write(2) (((hgtm(i,j,k),i=1,imx),j=1,jm<wbr>x),k=1,lx)</div><div>     write(2) (((ugrdm(i,j,k),i=1,imx),j=1,j<wbr>mx),k=1,lx)</div><div>     write(2) (((vgrdm(i,j,k),i=1,imx),j=1,j<wbr>mx),k=1,lx)</div><div>     write(2) (((vvelm(i,j,k),i=1,imx),j=1,j<wbr>mx),k=1,lx)</div><div>     write(2) (((tmpm(i,j,k),i=1,imx),j=1,jm<wbr>x),k=1,lx)</div><div>     write(2) (((rhm(i,j,k),i=1,imx),j=1,jmx<wbr>),k=1,lx)</div><div>  close(2)</div></div><div><br></div><div>And then I wrote a NCL script to read and plot them. </div><div>Here is the prob: <br>fatal:No coordinate variable exists for dimension (level) in variable (hgt)</div><div><br></div><div>My script:</div><div><br></div><div><div>  nlon = 659</div><div>  nlat = 539</div><div>  nlev = 17</div></div><div><br></div><div><div>  dims  = (/nlat,nlon,nlev/)</div><div>  lat      = fspan(slat,elat,nlat)</div><div>  lon      = fspan(slon,elon,nlon)</div><div> level = (/1000.,925.,850.,700.,600.,50<wbr>0.,400.,300.,\</div><div>           250.,200.,150.,100.,70.,50.,3<wbr>0.,20.,10./)</div><div><br></div><div>  hgt       = fbindirread(path_prs, 0, dims, &quot;float&quot;)</div><div>  u       = fbindirread(path_prs, 1, dims, &quot;float&quot;)</div><div>  v       = fbindirread(path_prs, 2, dims, &quot;float&quot;)</div><div>  vvel       = fbindirread(path_prs, 3, dims, &quot;float&quot;)</div><div>  temp       = fbindirread(path_prs, 4, dims, &quot;float&quot;)</div><div>  rh      = fbindirread(path_prs, 5, dims, &quot;float&quot;)</div></div><div><br></div><div><div>  lon!0         = &quot;lon&quot;</div><div>  lon@long_name = &quot;lon&quot;</div><div>  lon@units     = &quot;degrees_east&quot;</div><div>  lon&amp;lon       = lon</div><div><br></div><div>  lat!0         = &quot;lat&quot;</div><div>  lat@long_name = &quot;lat&quot;</div><div>  lat@units     = &quot;degrees_north&quot;</div><div>  lat&amp;lat       = lat</div><div><br></div><div>  level!0                 = &quot;level&quot;</div><div>  level@units             = &quot;hPa&quot;</div><div>  level@long_name         = &quot;isobaric_surface&quot;</div><div>  level&amp;level           = level</div><div><br></div><div>hgt!0                   = &quot;level&quot;</div><div>hgt!1                   = &quot;lat&quot;</div><div>hgt!2                   = &quot;lon&quot;</div><div>hgt&amp;level               = level &lt;--- this one makes error!</div><div>hgt&amp;lat                 = lat</div><div>hgt&amp;lon                 = lon</div><div>hgt&amp;level@units         = &quot;hPa&quot;</div><div>hgt&amp;lat@units           = &quot;degrees_north&quot;</div><div>hgt&amp;lon@units           = &quot;degrees_east&quot;</div><div>hgt@units               = &quot;gpm&quot;</div><div>hgt@long_name           = &quot;geopotential height&quot;</div></div><div><br></div><div><br></div><div><br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>