<div dir="ltr"><div><div><div>In my opinion the warning can be ignored.<br>-----------------------------------------------<br></div>You are using the &#39;simple&#39; method of creating netCDF<br><br></div>This method takes advantage of the fact that in NCL a variable is an internal data structure that is based upon the netCDF data model. The data structure has an array of values; string information such as long_name and units and, often, coordinate information such as  time, level, lat, lon<br><br></div><div>When you did:<br><br>  i3d_TT = new((/26,192,288/),&quot;float&quot;)<br>  i3d_TT!0 = &quot;lev_p&quot;<br>  i3d_TT!1 = &quot;lat&quot;<br>  i3d_TT!2 = &quot;lon&quot;<br>  <a target="_blank" href="mailto:i3d_TT@units">i3d_TT@units</a> = &quot;K&quot;<br>  <a target="_blank" href="mailto:i3d_TT@long_name">i3d_TT@long_name</a> = &quot;CAM temperature&quot;<br><br></div><div>you *named* the dimension <br>...BUT...<br></div><div>you did not associate any coordinate values with the named dimension<br><br></div><div>You need: <br><br>   i3d_TT&amp;lat = lat      ; associate values with the named dimension<br></div><div>   i3d_TT&amp;lon = lon<br></div><div>   i3d_TT&amp;lev_p - lev_p<br><br></div><div>Then do *only*<br><br>ncdf = addfile(odir+&quot;netcdf/CAM_&quot;+<wbr>date+&quot;.nc&quot;,&quot;c&quot;)  <br><font color="#ff0000"><br>  ncdf-&gt;TT = i3d_TT<br><br></font></div><div><div> NCL software will write out all meta data.<br><br></div><div>Good luck<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 8:59 AM, Bian Qingyun <span dir="ltr">&lt;<a href="mailto:bianqy@tea.ac.cn" target="_blank">bianqy@tea.ac.cn</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<p>Hi,</p>
<p>I met the following problem when running NCL. Although this warning exists, it seems the script still works. Could I ignore this warning? Or it&#39;s a serious problem? If so, how to fix it? Any suggestions are appreciated!</p>
<p>------------------------------<wbr>--------</p>
<p>warning:Right hand side has no coordinate variable can not delete coordinate variable of a file, use (/ .. /) to avoid this message<br>warning:Right hand side has no coordinate variable can not delete coordinate variable of a file, use (/ .. /) to avoid this message<br>warning:[&quot;Execute.c&quot;:8575]:<wbr>Execute: Error occurred at or near line 475 in file CAM_netcdf_to_GRIB.ncl</p>
<p>------------------------------<wbr>--------</p>
<p>My ncl version is ncl_ncarg/6.3.0 on SUSE Linux Enterprise Server 11 (x86_64).</p>
<p>Followed is an extract of my script<strong> (the red part is where the warning occurred):</strong></p>
<p>begin</p>
<p>; Main input parameters:<br>;*****************************<wbr>******************************<wbr>*************<br>  ;directory containing individual time step data<br>  cdir = &quot;./ind/&quot;<br>  ;directory to contain grib files<br>  odir = &quot;./output/&quot;<br>  ;file names of each model, not including the date<br>  mod1 = &quot;cam_CESM_hist_&quot;<br>  pnew = (/1000.0,975.0,950.0,925.0,<wbr>900.0,850.0,\<br>            800.0,750.0,700.0,650.0,600.0,<wbr>\<br>            550.0,500.0,450.0,400.0,350.0,<wbr>300.0,250.0,\<br>            200.0,150.0,100.0,70.0,\<br>             50.0,30.0,20.0,10.0/)</p>
<p>; Open data<br>;*****************************<wbr>******************************<wbr>*************<br>  files = systemfunc(&quot;ls &quot;+cdir+mod1+syr+smo+&quot;*.nc&quot;)<br>  netcdf_cam_filenames = addfiles(files,&quot;r&quot;)<br>  ;get the number of files for do loop below<br>  numfil = dimsizes(files) - 1<br>  delete(files)</p>
<p>; Begin loop over daily files in the month<br>;*****************************<wbr>******************************<wbr>*************<br>  do f=0, numfil<br>  netcdf_cam_filename = netcdf_cam_filenames[f]</p>
<p>;*****************************<wbr>******************************<wbr>*************<br>  ;CAM<br>  lat = netcdf_cam_filename-&gt;lat<br>  lon = netcdf_cam_filename-&gt;lon    <br>  time = netcdf_cam_filename-&gt;time<br>  lev = netcdf_cam_filename-&gt;lev<br>  date = netcdf_cam_filename-&gt;date<br>  date_to_str = tostring(date)<br>  dtime_map = (/4,2,2/)<br>  st_dtime = str_split_by_length(date_to_<wbr>str, dtime_map)<br>  YYYY = st_dtime(0)<br>  MM = st_dtime(1)<br>  DD = st_dtime(2)<br>  nlon = netcdf_cam_filename-&gt;nlon<br>  P0 = netcdf_cam_filename-&gt;P0<br>  hyam = netcdf_cam_filename-&gt;hyam<br>  hybm = netcdf_cam_filename-&gt;hybm<br>  PS = netcdf_cam_filename-&gt;PS(0,:,:)<br>  T = netcdf_cam_filename-&gt;T(0,:,:,:<wbr>)</p>
<p>  delete(netcdf_cam_filename)</p>
<p>  <a href="mailto:lat@units" target="_blank">lat@units</a> = &quot;degrees_north&quot;<br>  <a href="mailto:lat@long_name" target="_blank">lat@long_name</a> = &quot;latitude&quot;<br>  <a href="mailto:lon@units" target="_blank">lon@units</a> = &quot;degrees_east&quot;<br>  <a href="mailto:lon@long_name" target="_blank">lon@long_name</a> = &quot;longitude&quot;</p>
<p>  i3d_TT = new((/26,192,288/),&quot;float&quot;)<br>  i3d_TT!0 = &quot;lev_p&quot;<br>  i3d_TT!1 = &quot;lat&quot;<br>  i3d_TT!2 = &quot;lon&quot;<br>  <a href="mailto:i3d_TT@units" target="_blank">i3d_TT@units</a> = &quot;K&quot;<br>  <a href="mailto:i3d_TT@long_name" target="_blank">i3d_TT@long_name</a> = &quot;CAM temperature&quot;</p>
<p>  print(&quot;Interpolating 3-d variables to pressure levels...&quot;)<br>  P0 = P0/100. ;vinth2p wants P0 in hpa<br>  i3d_TT = vinth2p(T,hyam,hybm,pnew,PS,1,<wbr>P0,2,True)</p>
<p>  delete([/T,PS/])</p>
<p>;Writing fields to NetCDF...<br>;*****************************<wbr>******************************<wbr>**************<br> ;open a new file<br>  ncdf = addfile(odir+&quot;netcdf/CAM_&quot;+<wbr>date+&quot;.nc&quot;,&quot;c&quot;)</p>
<p>  print(&quot;Writing fields to NetCDF...&quot;)<br> ;output variables   ------ only  CAM output<br>  ncdf-&gt;lat = lat<br>  ncdf-&gt;lon = lon<br>  <font color="#ff0000">ncdf-&gt;TT = i3d_TT</font></p>
<p>  ;Clean up<br>  delete([/ncdf,i3d_TT/])</p>
<p>  ;daily loop<br>  end do</p>
<p>end<br></p>
<p><br>-----</p>
<p>Thank you very much!</p>
<p>Best,</p>
<p>Qingyun<br><br><span><br></span></p><br><br><br><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>