<div dir="ltr"><div>Dear ncl-talk users,</div><div>I keep getting the following errors when I try to open about 70 files (HDF5 format) and opening up three arrays each of approximately length 6000:</div><div><br></div><div><div> minor: Unable to initialize object</div><div> #003: H5Dchunk.c line 1451 in H5D__create_chunk_mem_map_hyper(): unable to copy memory space</div><div> major: Dataspace</div><div> minor: Unable to copy object</div><div> #004: H5S.c line 594 in H5S_copy(): can't copy select</div><div> major: Dataspace</div><div> minor: Unable to copy object</div><div> #005: H5Sselect.c line 123 in H5S_select_copy(): can't copy selection specific information</div><div> major: Dataspace</div><div> minor: Unable to copy object</div><div> #006: H5Shyper.c line 1631 in H5S_hyper_copy(): can't allocate hyperslab info</div><div> major: Resource unavailable</div><div> minor: No space available for allocation</div><div> #007: H5FL.c line 400 in H5FL_reg_malloc(): memory allocation failed</div><div> major: Resource unavailable</div><div> minor: No space available for allocation</div><div> #008: H5FL.c line 206 in H5FL_malloc(): memory allocation failed for chunk</div><div> major: Resource unavailable</div><div> minor: No space available for allocation</div></div><div><br></div><div>-----------------------------------------------------------------------</div><div>Here is the script that accesses the files</div><div><br></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div><br></div><div>DEFAULT_CONT = 0.001</div><div>SCALE = 1000000</div><div><br></div><div>;--adjust contour levels</div><div>;--returns contour levels based on the default scale</div><div>function adjContour(data)</div><div>local max_n,min_n</div><div><br></div><div>begin</div><div>max_n = max(data)</div><div>min_n = min(data)</div><div><br></div><div><br></div><div>end</div><div><br></div><div>;--retrieves file namess</div><div>function get_file_names()</div><div>local names,tmp_str</div><div>begin</div><div><span class="" style="white-space:pre">        </span>tmp_str = systemfunc("find /home/Bama4/OCO2_DATA/July_Test_Week -name '*.h5' ") ; July </div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>return tmp_str</div><div>end</div><div><br></div><div>;--gets data from all files in the given directory</div><div>function processFiles(names)</div><div>local longs,lats,data,files_0,tmp, avg_data </div><div><br></div><div>begin</div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>files_0 = addfiles(names,"r")</div><div><span class="" style="white-space:pre">        </span>longs = files_0[:]->retrieval_longitude</div><div> <span class="" style="white-space:pre">        </span>lats = files_0[:]->retrieval_latitude </div><div> <span class="" style="white-space:pre">        </span>data = files_0[:]->xco2</div><div><span class="" style="white-space:pre">        </span>avg_data = avg(data)<span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>data = abs(data - avg_data)*SCALE ;--scale values</div><div><span class="" style="white-space:pre">        </span>delete(files_0)</div><div><span class="" style="white-space:pre">        </span>delete(avg_data)</div><div><span class="" style="white-space:pre">        </span>return ([/longs,lats,data/])</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span></div><div>end</div><div><br></div><div>function get_data_()</div><div>local n,tmp_list</div><div>begin</div><div><span class="" style="white-space:pre">        </span>n = get_file_names()</div><div><span class="" style="white-space:pre">        </span>tmp_list = processFiles(n)</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>return tmp_list</div><div>end</div></div><div><br></div><div><br></div><div>Here is the main script</div><div><br></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div><br></div><div>load "/home/Bama4/OCO2_Data/OCO2_Script.ncl"</div><div><br></div><div><br></div><div><br></div><div>begin</div><div><br></div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>;-- Bounds for Region</div><div><br></div><div><span class="" style="white-space:pre">        </span>lon0 = -153.0</div><div><br></div><div><span class="" style="white-space:pre">        </span>lon1 = -163.0</div><div><br></div><div><span class="" style="white-space:pre">        </span>lat0 = 72.4</div><div><br></div><div><span class="" style="white-space:pre">        </span>lat1 = 69.0</div><div><br></div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>;-- Region coordinates and data</div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>list_tmp = get_data_()</div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>longitudes = list_tmp[0]</div><div><br></div><div><span class="" style="white-space:pre">        </span>latitudes = list_tmp[1]</div><div><br></div><div><span class="" style="white-space:pre">        </span>var = list_tmp[2]</div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>;-- define the workstation (plot type and name)</div><div><br></div><div><span class="" style="white-space:pre">        </span>wks = gsn_open_wks("png","unstructured_grid")</div><div><br></div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>;-- set resources</div><div><br></div><div><span class="" style="white-space:pre">        </span>res = True</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@gsnMaximize = True ;-- maximize plot output</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@cnFillOn = True ;-- turn on contour fill</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@cnFillPalette = "rainbow" ;-- choose a colormap</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@tiMainString = "World Map"</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@tiMainFontHeightF = 0.02</div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>res@sfXArray = list_tmp[0]</div><div><br></div><div><span class="" style="white-space:pre">        </span>res@sfYArray = list_tmp[1]</div><div><br></div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>;--res@mpMinLatF = lat1</div><div><br></div><div><span class="" style="white-space:pre">        </span>;--res@mpMaxLatF = lat0</div><div><br></div><div><span class="" style="white-space:pre">        </span>;--res@mpMinLonF = lon1</div><div><br></div><div><span class="" style="white-space:pre">        </span>;--res@mpMaxLonF = lon0</div><div><br></div><div><span class="" style="white-space:pre">        </span>;--manually set the contour levels with the following 3 resources</div><div> res@cnLevelSelectionMode = "ManualLevels"<span class="" style="white-space:pre">        </span></div><div> res@cnMinLevelValF = 0.</div><div> res@cnMaxLevelValF = 500.<span class="" style="white-space:pre">                        </span>; set the maximum contour level</div><div> res@cnLevelSpacingF = 100.<span class="" style="white-space:pre">                        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>;-- draw the contour map</div><div><br></div><div><span class="" style="white-space:pre">        </span>plot = gsn_csm_contour_map(wks, var, res)</div><div><br></div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div>end</div><div><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Mariama Barr-Dallas</div>
<div>Meyerhoff Scholar/ NSA Scholar M23<br>Computer Science Major, History Major</div>
<div>University of Maryland Baltimore County<br>Class of 2015</div></div></div>
</div>