<div dir="ltr"><div><div>Hi,<br><br></div>Are there any other error messages printed -- that one is rather vague. I don't know the issue for certain, but since the variable "event" was created using the ispan() function, I don'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"><<a href="mailto:tess.parker@monash.edu" target="_blank">tess.parker@monash.edu</a>></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:["Execute.c":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'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'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("nc","Format","<wbr>NetCDF4Classic")<br><br>  outfile = "U_V_divergence_250_2006_2015.<wbr>nc" <br><br>  system("rm -f "+outfile)<br><br>  ncdf = addfile(outfile, "c")<br><br>   setfileoption(ncdf,"<wbr>DefineMode",True)<br><br>   fAtt              = True           ; assign file attributes<br>   fAtt@creation_date = systemfunc ("date")       <br>   fileattdef( ncdf, fAtt )           ; copy file attributes   <br><br>  dimNames   = (/"event","fcast_time","lat","<wbr>lon"/) <br>  dimSizes   = (/nevent,ntime,nlat,nlon/)<br>  dimUnlim   = (/False,False,False,False/)<br>  filedimdef(ncdf,dimNames,<wbr>dimSizes,dimUnlim)<br><br>  <b> filevardef(ncdf,"event",<wbr>typeof(event),getvardims(<wbr>event))</b><br>  filevardef(ncdf,"fcast_time",<wbr>typeof(fcast_time),getvardims(<wbr>fcast_time))<br>  filevardef(ncdf,"lat",typeof(<wbr>lat),getvardims(lat))<br>  filevardef(ncdf,"lon",typeof(<wbr>lon),getvardims(lon))<br>  filevardef(ncdf,"usf_arr",<wbr>typeof(usf_arr),getvardims(<wbr>usf_arr))<br>  filevardef(ncdf,"vsf_arr",<wbr>typeof(vsf_arr),getvardims(<wbr>vsf_arr))<br>  filevardef(ncdf,"uvp_arr",<wbr>typeof(uvp_arr),getvardims(<wbr>uvp_arr))<br>  filevardef(ncdf,"vvp_arr",<wbr>typeof(vvp_arr),getvardims(<wbr>vvp_arr))<br><br>  filevarattdef(ncdf,"usf_arr",<wbr>usf_arr)<br>  filevarattdef(ncdf,"event",<wbr>event)<br>  filevarattdef(ncdf,"fcast_<wbr>time",fcast_time)<br>  filevarattdef(ncdf,"lat",lat)<br>  filevarattdef(ncdf,"lon",lon)<br>  filevarattdef(ncdf,"vsf_arr",<wbr>vsf_arr)<br>  filevarattdef(ncdf,"uvp_arr",<wbr>uvp_arr)<br>  filevarattdef(ncdf,"vvp_arr",<wbr>vvp_arr)<br>   <br> setfileoption(ncdf,"<wbr>DefineMode",False)<br><br>  ncdf->event         = (/event/)<br>  ncdf->fcast_time     = (/fcast_time/)<br>  ncdf->lat          = (/lat/)<br>  ncdf->lon          = (/lon/)<br>  ncdf->usf_arr      = (/usf_arr/)<br>  ncdf->vsf_arr      = (/vsf_arr/)<br>  ncdf->uvp_arr      = (/uvp_arr/)<br>  ncdf->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>