<div dir="ltr"><div><div><div>In my opinion the warning can be ignored.<br>-----------------------------------------------<br></div>You are using the 'simple' 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/),"float")<br> i3d_TT!0 = "lev_p"<br> i3d_TT!1 = "lat"<br> i3d_TT!2 = "lon"<br> <a target="_blank" href="mailto:i3d_TT@units">i3d_TT@units</a> = "K"<br> <a target="_blank" href="mailto:i3d_TT@long_name">i3d_TT@long_name</a> = "CAM temperature"<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&lat = lat ; associate values with the named dimension<br></div><div> i3d_TT&lon = lon<br></div><div> i3d_TT&lev_p - lev_p<br><br></div><div>Then do *only*<br><br>ncdf = addfile(odir+"netcdf/CAM_"+<wbr>date+".nc","c") <br><font color="#ff0000"><br> ncdf->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"><<a href="mailto:bianqy@tea.ac.cn" target="_blank">bianqy@tea.ac.cn</a>></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'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:["Execute.c":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 = "./ind/"<br> ;directory to contain grib files<br> odir = "./output/"<br> ;file names of each model, not including the date<br> mod1 = "cam_CESM_hist_"<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("ls "+cdir+mod1+syr+smo+"*.nc")<br> netcdf_cam_filenames = addfiles(files,"r")<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->lat<br> lon = netcdf_cam_filename->lon <br> time = netcdf_cam_filename->time<br> lev = netcdf_cam_filename->lev<br> date = netcdf_cam_filename->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->nlon<br> P0 = netcdf_cam_filename->P0<br> hyam = netcdf_cam_filename->hyam<br> hybm = netcdf_cam_filename->hybm<br> PS = netcdf_cam_filename->PS(0,:,:)<br> T = netcdf_cam_filename->T(0,:,:,:<wbr>)</p>
<p> delete(netcdf_cam_filename)</p>
<p> <a href="mailto:lat@units" target="_blank">lat@units</a> = "degrees_north"<br> <a href="mailto:lat@long_name" target="_blank">lat@long_name</a> = "latitude"<br> <a href="mailto:lon@units" target="_blank">lon@units</a> = "degrees_east"<br> <a href="mailto:lon@long_name" target="_blank">lon@long_name</a> = "longitude"</p>
<p> i3d_TT = new((/26,192,288/),"float")<br> i3d_TT!0 = "lev_p"<br> i3d_TT!1 = "lat"<br> i3d_TT!2 = "lon"<br> <a href="mailto:i3d_TT@units" target="_blank">i3d_TT@units</a> = "K"<br> <a href="mailto:i3d_TT@long_name" target="_blank">i3d_TT@long_name</a> = "CAM temperature"</p>
<p> print("Interpolating 3-d variables to pressure levels...")<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+"netcdf/CAM_"+<wbr>date+".nc","c")</p>
<p> print("Writing fields to NetCDF...")<br> ;output variables ------ only CAM output<br> ncdf->lat = lat<br> ncdf->lon = lon<br> <font color="#ff0000">ncdf->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>