<div dir="ltr"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">Hi ncl-talk,</font><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">I'm writing a number of variables to netcdf-4. The variables are a mix of intengers, strings, and floats so I thought netcdf4 is the right way to go.</font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">I followed instructions on the ncl support page, but appear to be getting issues with writing the data.</font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><b>I have this written below. More is written after it but it fails before getting to the rest.</b></font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">filo = "/home/arsenic1/scripts/gfs/" + utc_start + "z/<a href="http://saved_14er_variables_gfs_new.nc">saved_14er_variables_gfs_new.nc</a>"</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">;===================================================================</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>setfileoption("nc", "Format",<span class="gmail-Apple-converted-space">  </span>"NetCDF4")</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fon = filo</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>system("/bin/rm -f " + fon) ; remove if exists</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fo = addfile(fon, "c")</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">; explicitly declare file definition mode. Improve efficiency.</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>setfileoption(fo,"DefineMode",True)</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>; create global attributes of the file</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fAtt <span class="gmail-Apple-converted-space">              </span>= True<span class="gmail-Apple-converted-space">            </span>; assign file attributes</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fAtt@title <span class="gmail-Apple-converted-space">        </span>= "GFS 14er Data File"</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fAtt@source_file <span class="gmail-Apple-converted-space">  </span>= filo</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fAtt@Conventions <span class="gmail-Apple-converted-space">  </span>= "None"</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fAtt@creation_date = systemfunc ("date")</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fileattdef(fo, fAtt)<span class="gmail-Apple-tab-span" style="white-space:pre">    </span> <span class="gmail-Apple-converted-space">  </span>; copy file attributes</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">; predefine the coordinate variables and their dimensionality</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">; Note: to get an UNLIMITED record dimension, we set the dimensionality</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">; to -1 (or the actual size) and set the dimension name to True.</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>dimNames = (/"peaks","time"/)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>dimSizes = (/dimsizes(names_14ers),dimsizes(fcst_hr)/)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>dimUnlim = (/False,False/)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>filedimdef(fo, dimNames, dimSizes, dimUnlim)</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>mtim = dimsizes(fcst_hr)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>mname = dimsizes(names_14ers)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>chunkSizes = (/ mtim, mname/)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>filechunkdimdef(fo,dimNames,chunkSizes,dimUnlim)</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>grpnames = (/"grp1", "group2", "g3"/)</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>filegrpdef(fo,grpnames)</font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;min-height:18px"><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></font></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>; predefine the the dimensionality of the variables to be written out</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>; Here we are using NCL functions to facilitate defining</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>; each variable's dimension name(s) and type.</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>;===================================================================</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif" color="#000000" style=""><span class="gmail-Apple-converted-space" style="background-color:rgb(255,255,255)"> </span><span style="background-color:rgb(106,168,79)">filevardef(fo, "peaks", typeof(names_14ers), getvardims(names_14ers))</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>filevarattdef(fo,"peaks", names_14ers) <span class="gmail-Apple-converted-space">                  </span>; copy time attributes</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><span class="gmail-Apple-converted-space"> </span>fo->peaks <span class="gmail-Apple-converted-space">  </span>= (/names_14ers/)</font></span></p><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div><font face="arial, sans-serif" style="" color="#000000"><span style="background-color:rgb(255,255,255)">The program gives a fatal error at the green line, and I'm not sure why. My actual dims of my variables are name by time so I'm confused. When I do an ncl_filedump on the file, I get this message in the report:</span></font></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"><br></font></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><b>ERROR: Invalid _NCProperties attribute</b></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">Any help on this is much appreciated, as I have tried a number of different ways to rectify this.</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, sans-serif" color="#000000">Thanks!</font></span></p></div><div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000"> </font></div><font face="arial, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">-- <br></font><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Andrew Kren<br>Assistant Scientist<br>University of Miami CIMAS - NOAA/AOML</div><div dir="ltr"><div><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">Global Observing Systems Analysis (GOSA) Group</font></div><div><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)" color="#000000">NOAA/AOML Quantitative Observing System Assessment Program (QOSAP)</font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>