<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Barry,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Rick is out this afternoon.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Part of what Rick is suggesting is that if you are done with a variable, then you should delete it in order to free up memory for later calculations. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If I may provide some honest comments about your script overall: if you use some simple &quot;clean coding practices&quot;, this will make it *much* easier for you to debug your own code, and it will certainly make it easier for other people to debug it. It will also help you see where you might have some memory issues.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here are some suggestions for improving your script:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><b>[1] Use &quot;delete&quot; to remove variables you don&#39;t need any more:</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="white-space:pre">        </span>t_ave=t_ave-273.16  ; convert to C                                                                        </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        z_ave=z_ave/10.  ; convert to dam                                                                         </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        printMinMax(z_ave,False)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        u = u * 3.6</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        v = v * 3.6</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(u,u_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(v,v_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(z,z_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(t,t_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(rh,rh_ave)                         ; copy coord vars to speed   </font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you no longer need the &quot;u&quot;, &quot;v&quot;, &quot;z&quot;, etc variables, then delete them:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="white-space:pre">        </span>t_ave=t_ave-273.16  ; convert to C                                                                        </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        z_ave=z_ave/10.  ; convert to dam                                                                         </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        printMinMax(z_ave,False)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        u = u * 3.6</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        v = v * 3.6</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(u,u_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(v,v_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(z,z_ave)                         ; copy coord vars to speed                                </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(t,t_ave)                              </font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        copy_VarCoords(rh,rh_ave)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">        delete([/u,v,z,t,rh/])                          ;  no longer needed</font></div><div class="gmail_default" style="font-size:small">  </div><div class="gmail_default" style="font-size:small"><b>[2] You are reading several variables and not doing anything with them but printing them out. Reading them in uses memory. </b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If all you need to do is print them, then print them directly. An example:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">      lv0 = fin-&gt;lv_ISBL0</font></div><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv0 = &quot; + lv0)</font></div><div class="gmail_default"><font face="monospace, monospace">      lv8 = fin-&gt;lv_ISBL8</font></div><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv8 = &quot; + lv8)</font></div><div class="gmail_default"><font face="monospace, monospace">      lv10 = fin-&gt;lv_ISBL10</font></div><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv10 = &quot; + lv10)</font></div></div><div class="gmail_default"><br></div><div class="gmail_default">Do this instead, to save memory:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv0 = &quot; + fin-&gt;lv_ISBL0)</font></div><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv8 = &quot; + fin-&gt;lv_ISBL8)<br></font></div><div class="gmail_default"><font face="monospace, monospace">      print(&quot;lv10 = &quot; + fin-&gt;lv_ISBL10)</font><br></div><div class="gmail_default"><br></div></div><div class="gmail_default"><br></div><b>[3] Avoid putting unchanged code inside do loops.</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your script has two do loops with a bunch of code inside of them that doesn&#39;t change.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Do loops can be slow, so it&#39;s important to keep as much code *outside* of a do loop as possible.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As an example, these are your two outside do loops:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">  do n=0,n_files -1,1</font></div><div class="gmail_default"><font face="monospace, monospace">    do i_dir = 0,n_dirWRF-1</font><br></div><div class="gmail_default"><br></div><div class="gmail_default">Inside these two loops, you have code that looks like this:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"> <font face="monospace, monospace">      res1                     = True</font></div><div class="gmail_default"><font face="monospace, monospace">        res1@mpDataBaseVersion = &quot;Ncarg4_1&quot;           ; choose more recent database                                   </font></div><div class="gmail_default"><span style="font-family:monospace,monospace">        . . .<br>        res1@mpNationalLineThicknessF    = 3.0</span><br></div><div class="gmail_default"><font face="monospace, monospace">        res1@mpGeophysicalLineThicknessF = 2.0</font></div><div><font face="monospace, monospace">      . . .</font></div></div></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">        res1@tiMainString         = time_var</font></div><div class="gmail_default"><font face="monospace, monospace">        res1@gsnDraw             = False           ; don&#39;t draw                                                </font><span style="font-family:monospace,monospace">                </span><span style="font-family:monospace,monospace">res1@cnLevelSelectionMode = &quot;ExplicitLevels&quot;    ; set explicit contour levels  </span></div><div class="gmail_default"><font face="monospace, monospace">        . . .</font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">        res1@cnInfoLabelOn = False                  ; turn off contour info label                                             </font><span style="font-family:monospace,monospace">res1@lbAutoManage          = False          ; control label bar                                                       </span><span style="font-family:monospace,monospace">res1@lbOrientation         = &quot;Vertical&quot;</span></div><div class="gmail_default"><span style="font-family:monospace,monospace">        . . .                                                               </span><br></div><div class="gmail_default"><font face="monospace, monospace">        res1@lbTopMarginF = 0.001</font></div><div class="gmail_default"><font face="monospace, monospace">        res2                     = True</font></div><div class="gmail_default"><font face="monospace, monospace">        res2                     = True</font></div><div class="gmail_default"><font face="monospace, monospace">        .  . .</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@mpNationalLineThicknessF    = 3.0</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@mpGeophysicalLineThicknessF = 2.0</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@tiMainString         = time_var</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@gsnDraw             = False           ; don&#39;t draw                                                                   </font></div><div class="gmail_default"><font face="monospace, monospace">        . . .</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@lbOrientation         = &quot;Vertical&quot;</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@pmLabelBarSide        = &quot;Right&quot;</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@lbLabelAutoStride =   True</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@pmLabelBarWidthF      = 0.20</font></div><div class="gmail_default"><font face="monospace, monospace">        res2@pmLabelBarHeightF     = 0.7</font></div><div class="gmail_default"><font face="monospace, monospace">        . . .</font></div></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">None of this code changes inside the do loops, but yet it is getting set again and again for every iteration of the two do loops. In order to speed things up, move as much code as you can to outside the do loop, and only keep things that actually change inside the do loop.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I recommend creating functions to set the various resource lists: set_res1_list, set_res2_list, etc. This may not necessarily save memory, but it makes your code much cleaner.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><b>[4] Use functions for cleaner code.</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have code that is repeated in multiple locations.  This can cause extra memory usage.  If you turn these repeated code segments into NCL functions, then this can save some memory.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">An example, you have:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  i_loc = 1</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  j_loc = 1</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  GET_IJ::get_ij(lat2d,lon2d,lat_beg,lon_beg,i_loc,j_loc,nj,ni)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  x_start = i_loc</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  y_start = j_loc</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Granted, this doesn&#39;t use a lot of memory, but every time you copy these 5 lines, it makes your script harder to read, and you will slowly use more memory if you do this kind of thing frequently.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Turn the above five lines into a function:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">function get_ij_ncl(lat2d,lon2d,lat_beg,lon_beg)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">local nj, ni</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">begin<br></font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  i_loc = 1</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  j_loc = 1</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  nj = dimsizes(lat2d(:,0))</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  ni = dimsizes(lat2d(0,:))</font></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  GET_IJ::get_ij(lat2d,lon2d,lat_beg,lon_beg,i_loc,j_loc,nj,ni)</font></div><div style="font-size:small"><font face="monospace, monospace"> return([/i_loc,j_loc/])</font></div><div style="font-size:small"><font face="monospace, monospace">end</font></div><div style="font-size:small"><br></div><div style="font-size:small">and then call the function with:</div><div style="font-size:small"><br></div><div style="font-size:small"><font face="monospace, monospace">xy_start = get_ij_ncl(lat2d,lon2d,lat_beg,lon_beg)</font></div><div style="font-size:small"><br></div><div style="font-size:small">You will then need to change &quot;x_start&quot; to xy_start(0) and &quot;y_start&quot; to xy_start(1)</div><div style="font-size:small"><br></div><div style="font-size:small"><b>[5] Another place where a function would be helpful:</b></div><div style="font-size:small"><br></div><div><div style="font-size:small"><font face="monospace, monospace">  u_ave_new = u_ave(xy_start(1):xy_end(1),xy_start(0):xy_end(0))</font></div><div style="font-size:small"><font face="monospace, monospace">  v_ave_new = v_ave(xy_start(1):xy_end(1),xy_start(0):xy_end(0))</font></div><div style="font-size:small"><font face="monospace, monospace">  lat2d_new = lat2d(xy_start(1):xy_end(1),xy_start(0):xy_end(0))</font></div><div style="font-size:small"><font face="monospace, monospace">  lon2d_new = lon2d(xy_start(1):xy_end(1),xy_start(0):xy_end(0))</font></div><div style="font-size:small"><font face="monospace, monospace">; plotB   = gsn_csm_vector(wks,u_ave_new,v_ave_new,vecres)                                                                          </font></div><div style="font-size:small"><font face="monospace, monospace">;;;opy_VarCoords(dumb_ave,u_ave_new)                                                                                                </font></div><div style="font-size:small"><font face="monospace, monospace">; copy_VarCoords(dumb_ave,v_ave_new)                                                                                                </font></div><div style="font-size:small"><font face="monospace, monospace">   u_ave_new!0 = &quot;lat&quot;</font></div><div style="font-size:small"><font face="monospace, monospace">   u_ave_new!1 = &quot;lon&quot;</font></div><div style="font-size:small"><font face="monospace, monospace">   u_ave_new&amp;lat= lat(xy_start(1):xy_end(1))</font></div><div style="font-size:small"><font face="monospace, monospace">   u_ave_new&amp;lon= lon(xy_start(0):xy_end(0))</font></div><div style="font-size:small"><font face="monospace, monospace">   v_ave_new!0 = &quot;lat&quot;</font></div><div style="font-size:small"><font face="monospace, monospace">   v_ave_new!1 = &quot;lon&quot;</font></div><div style="font-size:small"><font face="monospace, monospace">   v_ave_new&amp;lat= lat(xy_start(1):xy_end(1))</font></div><div style="font-size:small"><font face="monospace, monospace">   v_ave_new&amp;lon= lon(xy_start(0):xy_end(0))</font></div><div style="font-size:small"><br></div><div style="font-size:small">Create a function to do the subsetting and attaching of the metadata:</div><div style="font-size:small"><br></div><div style="font-size:small"><font face="monospace, monospace">function average_subset(x,lat,lon,xy_start,xy_end)</font></div><div style="font-size:small"><font face="monospace, monospace">begin</font></div><div style="font-size:small"><font face="monospace, monospace">  x_ave_new = x(xy_start(1):xy_end(1),xy_start(0):xy_end(0))</font></div><div><div><font face="monospace, monospace">  x_ave_new!0 = &quot;lat&quot;</font></div><div><font face="monospace, monospace">  x_ave_new!1 = &quot;lon&quot;</font></div></div><div style="font-size:small"><font face="monospace, monospace"><div>  x_ave_new&amp;lat= lat(xy_start(1):xy_end(1))</div><div>  x_ave_new&amp;lon= lon(xy_start(0):xy_end(0))</div><div>  return(x_ave_new)</div></font></div><div style="font-size:small"><font face="monospace, monospace">end</font></div><div style="font-size:small"><br></div></div><div style="font-size:small">so now you can replace the above code with two lines:</div><div style="font-size:small"><br></div><div style="font-size:small"><font face="monospace, monospace">  u_ave_new = average_subset(u_ave,lat,lon,xy_start,xy_end)</font></div><div style="font-size:small"><div><font face="monospace, monospace">  v_ave_new = average_subset(v_ave,lat,lon,xy_start,xy_end)</font></div><div><br></div><div><b>[6] You created &quot;lat2d_new&quot; and &quot;lon2d_new&quot; but never use them. Again, this is using up memory for no purpose. Remove those two lines.</b></div><div><br></div></div><div style="font-size:small"><b>[7] If you are propagating a smaller array to a larger array, as is the case here:</b></div><div style="font-size:small"><br></div><div style="font-size:small"><div><font face="monospace, monospace">  lat2d = z</font></div><div><font face="monospace, monospace">  lon2d = z</font></div></div><div><div><font face="monospace, monospace">  do j = 0,nj-1</font></div><div><font face="monospace, monospace">  do i = 0,ni-1</font></div><div><font face="monospace, monospace">   lat2d(j,i)=lat(j)</font></div><div><font face="monospace, monospace">   lon2d(j,i)=lon(i)</font></div><div><font face="monospace, monospace">  end do</font></div><div><font face="monospace, monospace">  end do</font></div></div><div><br></div><div>then use conform_dims instead of a do loop:</div><div><br></div><div><font face="monospace, monospace">  lat2d = conform_dims(dims2d,lat,0)  </font></div><div><font face="monospace, monospace">  lon2d = conform_dims(dims2d,lon,1)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">Note that I no longer need the &quot;lat2d = z&quot; or &quot;lon2d = z&quot; code.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">[8] You have this code, and I&#39;m not sure why:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="monospace, monospace">      a = addfile(filename,&quot;r&quot;)</font></div><div><font face="monospace, monospace">      fin = a</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">This seems like an unnecessary copy of &quot;a&quot;.  Why not simply do:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><font face="monospace, monospace">  fin = addfile(filename,&quot;r&quot;)</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><b>[9] The &quot;gsn_define_colormap&quot; call should not be inside the do loop. Call this right after you call gsn_open_wks.</b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><b>[10] There&#39;s some random code I don&#39;t understand. For example:</b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><div><font face="monospace, monospace">  copy_VarCoords(z,lat2d)</font></div><div><font face="monospace, monospace">  copy_VarCoords(z,lon2d)</font></div></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">lat2d and lon2d don&#39;t need to have z&#39;s coordinate arrays attached to them for any reason that I can see, so I think you can remove those two lines.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><b>[11] Every time you have a do loop or an if statement, indent all the code inside *consistently* so you can more easily see what part of the code you&#39;re in.</b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><b>[12] Don&#39;t make extra copies of variables unless you really need to.</b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">For example, you have:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">







<p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">      </span>filename = all_files(n)</span></p><p class="gmail-p1">There&#39;s really no need to create &quot;filename&quot; since you can just use &quot;all_files(n)&quot;.</p></div><div style="font-family:arial,helvetica,sans-serif">I&#39;ve tried to clean up your code to show you what I&#39;m talking about. The attached script likely won&#39;t run because I don&#39;t have your data to test it.  But, hopefully you can see what I&#39;m doing and mimic this in your code.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">--Mary</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 17, 2017 at 11:40 AM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</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">Hi Rick:<div><br></div><div>Thank you for your suggestion.</div><div><br></div><div>Could you please give me some guidelines on how to delete resources.</div><div><br></div><div>I have included the script.  If you can provide an example, I can take it from there.</div><div><br></div><div>Thank you,</div><div><br></div><div>Barry</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 17, 2017 at 5:22 PM, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@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><div><div>Hi Barry,<br><br></div>On Linux, an errno=12 is an &quot;out of memory&quot; error.  I doubt that its related directly to the systemfunc() call, but rather due to memory being consumed by your script in previous iterations of the loop.  You might check if there are variables that can be freed (i.e., deleted()) after each iteration.<br><br></div>HTH...<br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-390945913059712367h5">On Sun, Jul 16, 2017 at 8:56 PM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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="m_-390945913059712367h5"><div dir="ltr">Hi:<div><br></div><div>I have a program that does multiple loops.</div><div><br></div><div>I had this error:</div><div><br></div><div>







<p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">0)<span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-tab-span">        </span>i_dir = 6</span></p>
<p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">fatal:systemfunc: cannot create child process:[errno=12]</span></p>
<p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">fatal:[&quot;Execute.c&quot;:8640]:Execu<wbr>te: Error occurred at or near line 84 in file ./plot_loop_700mb.ncl</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">This occurred when reading the file from the sixth directory of 20.</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">Here was the read from the 5th directory:</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">(0)<span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-tab-span">        </span>i_dir = 5</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">(0)<span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-tab-span">        </span>all_files(n) = /home/cust100021_vol1/barry/cu<wbr>st100021_vol2/GEFS/GEFS_05/gep<wbr>05.t00z.pgrb2b.0p50.f084.grb</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">









</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1">Here is a listing of both files:</p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1">They are both present, but the second attempted allocation/definition of the file fails with the read that follows:</p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><br></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">[barry@cust100021-login1 GEFS]$ ls -ltr /home/cust100021_vol1/barry/cu<wbr>st100021_vol2/GEFS/GEFS_05/gep<wbr>05.t00z.pgrb2b.0p50.f084.grb</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">-rw-r--r-- 1 barry cust100021 78985320 Jul 16 04:58 /home/cust100021_vol1/barry/cu<wbr>st100021_vol2/GEFS/GEFS_05/gep<wbr>05.t00z.pgrb2b.0p50.f084.grb</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">[barry@cust100021-login1 GEFS]$ ls -ltr /home/cust100021_vol1/barry/cu<wbr>st100021_vol2/GEFS/GEFS_06/gep<wbr>06.t00z.pgrb2b.0p50.f084.grb</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1">










</p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">-rw-r--r-- 1 barry cust100021 80466702 Jul 16 04:58 /home/cust100021_vol1/barry/cu<wbr>st100021_vol2/GEFS/GEFS_06/gep<wbr>06.t00z.pgrb2b.0p50.f084.grb</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">Here is the read:</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-converted-space">  </span>print(&quot;i_dir = &quot; + i_dir)</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-converted-space">  </span>diri = dirWRF(i_dir) + &quot;/&quot;</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">; define individual file read</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-converted-space">   </span>all_files = systemfunc(&quot;ls &quot; + diri + &quot;ge*pgrb2b*grb&quot;)</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-converted-space">   </span>print(&quot;all_files(n) = &quot; + all_files(n))</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1">












</p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-Apple-converted-space">  </span>filename = all_files(n)</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">Is the problem that I make this allocation multiple times, each directory, each file? Perhaps I should read all files at once into a two dimensional filename array?</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1">Thanks</span></p><p class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-p1"><span class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail-s1"><br></span></p><div><br></div>-- <br><div class="m_-390945913059712367m_-1244925744970829752m_-5735885267463024187gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-390945913059712367gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></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>