<div dir="ltr"><div class="gmail_default" style="font-size:small">Elinor,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for providing the files. As I stated offline (and am restating here for the benefit of ncl-talk), the issue is that the two time arrays have different units. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Addfiles is not handling this gracefully. I believe it looks at the time units of the first file, and assumes that the time units are the same on subsequent files. It shouldn't seg fault, so I will a create a ticket on this.</div><div class="gmail_default"><br></div><div class="gmail_default">Meanwhile, I wrote a script to "fix" the time array on one of the files to match the time array on the other file, so that addfiles will work properly. Please see the attached fix_time.ncl script. One you run that script, you can then use read_fixed_files_and_plot.ncl to read and plot the subsetted data.</div><div class="gmail_default"><br></div><div class="gmail_default">This process uncovered a bug in cd_convert (which is why I didn't use this function to do the conversion) which doesn't recognize the "calendar" option, so I will make sure that gets fixed as well.</div><div class="gmail_default"><br></div><div class="gmail_default">Let me know if you have any questions or issues with the scripts.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div>
</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 2:47 PM, Martin, Elinor R. <span dir="ltr"><<a href="mailto:elinor.martin@ou.edu" target="_blank">elinor.martin@ou.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
I have put the two sample files in the ftp account. The names are:
<div><br>
</div>
<div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(44,103,200)">
<span>ta_6hrLev_GISS-E2-H_<wbr>historical_r6i1p1_<wbr><a href="http://195001010600-195007010000.nc">195001010600-195007010000.nc</a></span></div>
</div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(44,103,200)">
<span>ta_6hrLev_GISS-E2-H_<wbr>historical_r6i1p1_<wbr><a href="http://195007010600-195101010000.nc">195007010600-195101010000.nc</a></span></p>
</div>
<div>
<div><br>
</div>
<div>They are large files (1.5GB each), which may be the cause of the problem. If there is a straightforward way to break them up into time chunks then I can do that in the meantime.</div><span class="">
<div><br>
</div>
<div>Elinor</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div>
<div>******************************<wbr>*************</div>
<div>Dr. Elinor Martin<br>
Assistant Professor</div>
<div>School of Meteorology<br>
University of Oklahoma</div>
<div><span>120 David L. Boren Blvd. Suite 5900</span></div>
<div>Norman, OK 73072-7307</div>
<div><br>
</div>
<div>Office: NWC 5642</div>
<div>Email: <a href="mailto:elinor.martin@ou.edu" target="_blank">
elinor.martin@ou.edu</a></div>
<div>Phone: <a href="tel:405%20325%207392" value="+14053257392" target="_blank">405 325 7392</a></div>
<div>Web: <a href="http://weather.ou.edu/~ermartin" target="_blank">
http://weather.ou.edu/~<wbr>ermartin</a></div>
<div>******************************<wbr>*************</div>
</div>
<div><br>
</div>
</div>
<br>
</div>
<br>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</span><div><div class="h5"><div>
<blockquote type="cite">
<div>On Aug 29, 2016, at 3:32 PM, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Elinor,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I think we'll need to see your files to debug this one. Are the files really large? If not, you can upload them to our ftp account:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default">
<div class="gmail_default">ftp <a href="http://ftp.cgd.ucar.edu/" target="_blank">
ftp.cgd.ucar.edu</a></div>
<div class="gmail_default">anonymous</div>
<div class="gmail_default"><use your email address for the password></div>
<div class="gmail_default">cd incoming</div>
<div class="gmail_default">put <a href="http://temp_195001010600-195007010000.nc/" style="font-size:12.8px" target="_blank">temp_195001010600-19500701<wbr>0000.nc</a></div>
<div style="font-size:12.8px">put <a href="http://temp_195007010600-195107010000.nc/" target="_blank">temp_195007010600-19510701<wbr>0000.nc</a></div>
<div class="gmail_default">. <br>
</div>
<div class="gmail_default">. </div>
<div class="gmail_default">. </div>
<div class="gmail_default">quit</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Otherwise, if you can put the files somewhere that I can download them, that's okay too.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">The seg fault could either be coming from a memory issue (if the files are large), or NCL could just be struggling with organizing the time array.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Thanks,</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">--Mary</div>
<div class="gmail_default"><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Aug 29, 2016 at 1:44 PM, Martin, Elinor R. <span dir="ltr">
<<a href="mailto:elinor.martin@ou.edu" target="_blank">elinor.martin@ou.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">I have a large set of files (time,level,lat,lon and 6 hourly) that span multiple years, but they are not divided nicely into months/years. I only want to read in one month at a time (and only 00Z), which in some cases,
spans only one file, but in other cases spans two.
<div><br>
</div>
<div>My code works perfectly for the months that come from only one file, but I get a “Segmentation fault (core dumped)” when the month spans two files. See brief code example below (happy to send more and actual files if needed).</div>
<div><br>
</div>
<div>example files: </div>
<div><a href="http://temp_195001010600-195007010000.nc/" target="_blank">temp_195001010600-195007010000<wbr>.nc</a></div>
<div><a href="http://temp_195007010600-195107010000.nc/" target="_blank">temp_195007010600-195107010000<wbr>.nc</a></div>
<div><br>
</div>
<div>example code snipet:</div>
<div><br>
</div>
<div>…….</div>
<div>
<div>all_files = systemfunc ("ls “+in_path+"temp_195*.nc")</div>
<div>f = addfiles (all_files, "r") </div>
<div><br>
</div>
</div>
<div>
<div>ListSetType(f,"cat")</div>
<div>time = f[:]->time</div>
<div><br>
</div>
<div>utc_date = cd_calendar(time, 0)</div>
<div>yr<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap">
</span>tointeger(utc_date(:,0))</div>
<div>mm<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap">
</span>tointeger(utc_date(:,1))</div>
<div>hour = tointeger(utc_date(:,3))</div>
</div>
<div><br>
</div>
<div>index = ind(yr.eq.1950 .and. mm.eq.7 .and. hour.eq.00)<span style="white-space:pre-wrap">
</span></div>
<div><br>
</div>
<div>
<div>ListSetType(f,"cat")<span style="white-space:pre-wrap"> </span>
</div>
<div>ta = f[:]->ta(index,:,:,:)<span style="white-space:pre-wrap">
</span></div>
…………</div>
<div><br>
</div>
<div>As I mentioned, this works great if mm.eq.1, mm.eq.2 etc., but not when mm.eq.7. When reading in ta(index,:,:,:) I get the segmentation fault.<span style="white-space:pre-wrap">
</span></div>
<div><br>
</div>
<div><br>
</div>
<div>Thank you!</div>
<div><br>
</div>
<div>Elinor</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div>
<div>******************************<wbr>*************</div>
<div>Dr. Elinor Martin<br>
Assistant Professor</div>
<div>School of Meteorology<br>
University of Oklahoma</div>
<div><span>120 David L. Boren Blvd. Suite 5900</span></div>
<div>Norman, OK 73072-7307</div>
<div><br>
</div>
<div>Office: NWC 5642</div>
<div>Email: <a href="mailto:elinor.martin@ou.edu" target="_blank">
elinor.martin@ou.edu</a></div>
<div>Phone: <a href="tel:405%20325%207392" value="+14053257392" target="_blank">
405 325 7392</a></div>
<div>Web: <a href="http://weather.ou.edu/~ermartin" target="_blank">
http://weather.ou.edu/~ermarti<wbr>n</a></div>
<div>******************************<wbr>*************</div>
</div>
<div><br>
</div>
</div>
<br>
</div>
<br>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</div>
</div>
<br>
______________________________<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>
</div>
</blockquote>
</div>
<br>
</div></div></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>