<div dir="ltr"><div>Hi,</div><div><br></div><div>They are very nearly the same. The NCL output is sorted along lines of constant latitude, while the fortran output is sorted along lines of constant longitude. I have attached a version of the fortran output that has been resorted and had extraneous whitespace removed to match the formatting of the NCL output. Out of 27,000+ lines, they are very nearly the same. Oddly however, in the middle of the files, there are 4 bands of constant latitude that differ by the last two digits between the two files. This can be seen clearly with a graphical diff tool, such as tkdiff.  For example, NCL outputs 1.3252<span style="color:rgb(255,0,0)">72,</span> whereas the fortran code writes 1.3252<span style="color:rgb(255,0,0)">64<span style="color:rgb(0,0,0)">. I don't know how/why they should be different at those places, and I haven't seen the fortran code.</span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)"><br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">Hope this helps...</span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">Rick</span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)"></span></span><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 20, 2021 at 12:47 AM ali mughal via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Dear NCL users <div><br></div><div>I want to get all lat lons from the geogrid file in WRF. I am using the following code. </div><div><br></div><div>Can you kindly let me know if the code is correct ? When I compare the output to a fortran code the values are different.</div><div><br></div><div><div>a=addfile("<a href="http://geo_em.d05.nc" target="_blank">geo_em.d05.nc</a>","r")</div><div>lat2d = wrf_user_getvar(a,"XLAT_M",0)</div><div>lon2d = wrf_user_getvar(a,"XLONG_M",0)</div><div><br></div><div>filename = "test_lat_lon.csv"</div><div>system("rm -rf " + filename)</div><div>write_table(filename,"w",[/lat2d,lon2d/],"%1.6f %3.4f")</div></div><div><br></div><div>I am attaching the output from both the fortran and NCL codes for convenience.</div><div><br></div><div><br></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>