<div dir="ltr"><div><div>Hi,<br><br></div>Are there any other error messages printed -- that one is rather vague.  I don&#39;t know the issue for certain, but since the variable &quot;event&quot; was created using the ispan() function, I don&#39;t see where it would have a named dimension, and thus the function call getvardims(event) may be returning a missing value.<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 19, 2017 at 8:38 AM, Tess Parker <span dir="ltr">&lt;<a href="mailto:tess.parker@monash.edu" target="_blank">tess.parker@monash.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>Hi -<br><br></div>I am trying to write some variables to a netcdf file. The attached script returns an error message:<br><br><div><div><div><i>fatal:[&quot;Execute.c&quot;:8578]:</i><i>Execu<wbr>te: Error occurred at or near line 272 in file test.ncl<br></i><br></div><div>Basically, I have a list of 41 target dates (<i>init_date</i>). I read in the u250 and v250 data for each of these target dates and the 10 days thereafter (for 61 x 6-hrly timesteps, or <i>fcast_time</i>), do the calculations, and store the sf and vp values to new variables (<i>usf_arr, vsf_arr, uvp_arr, vvp_arr</i>) which are dimensioned 41 x 61 x lat x lon. The <i>event</i> and <i>fcast_time</i> coordinate variables are integer type, and monotonically increasing.<br><br><i>Variable: usf_arr<br>Type: float<br>Total Size: 1311244288 bytes<br>            327811072 values<br>Number of Dimensions: 4<br>Dimensions and sizes:    [event | 41] x [fcast_time | 61] x [lat | 256] x [lon | 512]<br>Coordinates: <br>            event: [0..40]<br>            fcast_time: [0..360]<br>            lat: [-89.46294..89.46294]<br>            lon: [ 0..359.2969]<br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br></i><br><br></div><div>I then try to write out the new variables to a netcdf file using the file predefintion method. The error occurs at the line in bold type: the first filevardef call.<br><br></div><div>I&#39;ve tried a number of things but no luck. Any suggestions? Only thing I could think of is perhaps the lack of a specific date attribute, but I don&#39;t need that, just the 41 target dates with their sets of 61 timesteps....<br><br></div><div><br>******************************<wbr>*********<br>if (dofile) then<br><br>   nevent = 41<br>   ntime  = 61<br>   nlat   = latdims<br>   nlon   = londims<br><br>   setfileoption(&quot;nc&quot;,&quot;Format&quot;,&quot;<wbr>NetCDF4Classic&quot;)<br><br>   outfile = &quot;U_V_divergence_250_2006_2015.<wbr>nc&quot; <br><br>   system(&quot;rm -f &quot;+outfile)<br><br>   ncdf = addfile(outfile, &quot;c&quot;)<br><br>    setfileoption(ncdf,&quot;<wbr>DefineMode&quot;,True)<br><br>    fAtt               = True            ; assign file attributes<br>    fAtt@creation_date = systemfunc (&quot;date&quot;)        <br>    fileattdef( ncdf, fAtt )            ; copy file attributes    <br><br>   dimNames    = (/&quot;event&quot;,&quot;fcast_time&quot;,&quot;lat&quot;,&quot;<wbr>lon&quot;/)  <br>   dimSizes    = (/nevent,ntime,nlat,nlon/)<br>   dimUnlim    = (/False,False,False,False/)<br>   filedimdef(ncdf,dimNames,<wbr>dimSizes,dimUnlim)<br><br>  <b> filevardef(ncdf,&quot;event&quot;,<wbr>typeof(event),getvardims(<wbr>event))</b><br>   filevardef(ncdf,&quot;fcast_time&quot;,<wbr>typeof(fcast_time),getvardims(<wbr>fcast_time))<br>   filevardef(ncdf,&quot;lat&quot;,typeof(<wbr>lat),getvardims(lat))<br>   filevardef(ncdf,&quot;lon&quot;,typeof(<wbr>lon),getvardims(lon))<br>   filevardef(ncdf,&quot;usf_arr&quot;,<wbr>typeof(usf_arr),getvardims(<wbr>usf_arr))<br>   filevardef(ncdf,&quot;vsf_arr&quot;,<wbr>typeof(vsf_arr),getvardims(<wbr>vsf_arr))<br>   filevardef(ncdf,&quot;uvp_arr&quot;,<wbr>typeof(uvp_arr),getvardims(<wbr>uvp_arr))<br>   filevardef(ncdf,&quot;vvp_arr&quot;,<wbr>typeof(vvp_arr),getvardims(<wbr>vvp_arr))<br><br>   filevarattdef(ncdf,&quot;usf_arr&quot;,<wbr>usf_arr)<br>   filevarattdef(ncdf,&quot;event&quot;,<wbr>event)<br>   filevarattdef(ncdf,&quot;fcast_<wbr>time&quot;,fcast_time)<br>   filevarattdef(ncdf,&quot;lat&quot;,lat)<br>   filevarattdef(ncdf,&quot;lon&quot;,lon)<br>   filevarattdef(ncdf,&quot;vsf_arr&quot;,<wbr>vsf_arr)<br>   filevarattdef(ncdf,&quot;uvp_arr&quot;,<wbr>uvp_arr)<br>   filevarattdef(ncdf,&quot;vvp_arr&quot;,<wbr>vvp_arr)<br>    <br>  setfileoption(ncdf,&quot;<wbr>DefineMode&quot;,False)<br><br>   ncdf-&gt;event           = (/event/)<br>   ncdf-&gt;fcast_time      = (/fcast_time/)<br>   ncdf-&gt;lat            = (/lat/)<br>   ncdf-&gt;lon            = (/lon/)<br>   ncdf-&gt;usf_arr        = (/usf_arr/)<br>   ncdf-&gt;vsf_arr        = (/vsf_arr/)<br>   ncdf-&gt;uvp_arr        = (/uvp_arr/)<br>   ncdf-&gt;vvp_arr        = (/vvp_arr/)<br><br>end if<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br clear="all"><div><div class="m_-7418101984197420931gmail-m_-5406591978742435497gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>-- <br>Tess Parker<br>Associate Researcher<br>School of Earth, Atmosphere and Environment<br>Room 225, Building 28<br></div><div>9 Rainforest Walk<br></div><div>Monash University, Clayton VIC 3800<br><br></div><a href="http://users.monash.edu.au/%7Etess/index.html" target="_blank">http://users.monash.edu.au/~te<wbr>ss/index.html</a><br></div></div></div></div></div></div></div>
</div></font></span></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>