<div dir="ltr"><div><p class="MsoNormal">[1]</p><p class="MsoNormal">The following is incorrect. grb_list is a one-dimensional *array* of file names containing strings (text).  You have it as a single string.<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">    grb_file = addfiles("grb_list","r")  <br></p><p class="MsoNormal"><br></p><p class="MsoNormal">Use <br></p><p class="MsoNormal"><br></p><p class="MsoNormal">    grb_file = addfiles( grb_list ,"r")  ; pass the 1-d array of file names<br></p>=============<br>[2]<br></div>You want time series, N'est ce pas? Remove the following:<br><br>    ListSetType (grb_file, "join")            ; NO: NOT if you want a time serie<br>=============<br>[3]<br><br><div><br>diri = ncargpath("/depot/phig/apps/<wbr>LIS_VIC/NLDAS_Forcing/<wbr>discover/nobackup/projects/<wbr>lis/MET_FORCING/NLDAS2.<wbr>FORCING/2009/075/")<p class="MsoNormal">grb_file = addfiles("grb_list","r")</p><p class="MsoNormal">data      = grb_file[:]->DSWRF_110_SFC</p><p class="MsoNormal">printVarSummary(data)<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">ariable: data<br>Type: float<br>Total Size: 2494464 bytes<br>            623616 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat_110 | 1344] x [lon_110 | 464]<br>Coordinates: <br>            lat_110: [25.063..52.938]<br>            lon_110: [-124.938..-67.063]</p><p class="MsoNormal"><br></p><p class="MsoNormal">=====</p><p class="MsoNormal">   LAT  = (/ 48.5625 /)   ; read from text file</p><p class="MsoNormal">   LAT@units = "degrees_north"<br></p><p class="MsoNormal">   LON = (/-98.9375/)</p><p class="MsoNormal">   LON&units = "degrees_east"<br></p><p class="MsoNormal">   npts = dimsizes(LAT)<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">; Simple approx:</p><p class="MsoNormal"><br></p><p class="MsoNormal">   print( data(:,{LAT),{LON}) )</p><p class="MsoNormal">=====</p><p class="MsoNormal"><br></p><p class="MsoNormal">or better use:</p><p class="MsoNormal"><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml">https://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml</a><br></p><p class="MsoNormal"><br></p><pre>points = <strong>linint2_points</strong>(data&lon,data&lat,data, False, LON,LAT, 0)<br></pre><pre>printVarSummary(points)<br></pre><pre>print("--------------")<br></pre><p class="MsoNormal"><br></p><p class="MsoNormal">Good Luck<br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 9, 2018 at 9:37 AM, Smith, Stuart <span dir="ltr"><<a href="mailto:smit1770@purdue.edu" target="_blank">smit1770@purdue.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="EN-US"><div class="m_5558599136632736718WordSection1"><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I would like to compare two sets of forcing data. One is in a .grb file while the other is a .txt. When working the GRIB files (1 hour timesteps), I would like my .ncl script to reads in a time series of data, with the goal to plot specific weather data variables from specific locations to compare the .txt files. <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">However, when running my .ncl script listed below I receive a Segmentation fault error. I’m not sure if this is because I am not defining the latitude and longitude coordinates soon enough, causing an error by reading in too much data. I do not know how to print or plot specific latitude (48.5625) and longitude (-98.9375) points and print their forcing variables. Could you please help improve my .ncl script? I have also uploaded an example of the .grb files I am working with. Thank you for your time.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">begin<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">;Go to directory of interest <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">diri = ncargpath("/depot/phig/apps/<wbr>LIS_VIC/NLDAS_Forcing/<wbr>discover/nobackup/projects/<wbr>lis/MET_FORCING/NLDAS2.<wbr>FORCING/2009/075/")<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">;list names of all of the files and add ful file path<u></u><u></u></p><p class="MsoNormal">grb_list = systemfunc("ls "+diri+"NLDAS_FORA0125_H.*.<wbr>002.grb") <u></u><u></u></p><p class="MsoNormal">  <u></u><u></u></p><p class="MsoNormal">;print(grb_list)   ; make sure the desired files are listed in the correct order<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">; read in all files<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">grb_file = addfiles("grb_list","r")<u></u><u></u></p><p class="MsoNormal">ListSetType (grb_file, "join")<u></u><u></u></p><p class="MsoNormal">data = grb_file[:]->DSWRF_110_SFC<u></u><u></u></p><p class="MsoNormal">data@lat=grb_file[:]->lat_110  ;Lat. of interest 48.5625<u></u><u></u></p><p class="MsoNormal">data@lon=grb_file[:]->lon_110  ;Lon. of interest -98.9375<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">print(data)<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">end<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Regards,<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">-Stuart <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></font></span></div></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>