<div dir="ltr">Hi,<div>Thanks for your reply.</div><div>I made the time dimension unlimited but it didn&#39;t work. I just checked that lat and lon dimension is missing in the output file. I don&#39;t know how to add the lat and lon dimension using NCL. I was thinking that it is will take from tasmax array.</div><div>Could you please modify my code to add lat and lon dimension.</div><div><br></div><div><b>Output file:</b></div><div><br></div><div><div>ncdump -h tas_aave_Asia_bandpass30-100.nc</div><div>netcdf tas_aave_Asia_bandpass30-100 {</div><div>dimensions:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>time = UNLIMITED ; // (1000 currently)</div><div>variables:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double tasmax(time) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmax:_FillValue = -999000000. ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmax:lon = 0. ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmax:lat = 0. ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmax:missing_value = -999000000. ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double time(time) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:standard_name = &quot;time&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:long_name = &quot;Time&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:units = &quot;years since 850-1-1 00:00:00&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:calendar = &quot;standard&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:axis = &quot;T&quot; ;</div></div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</div><div><b>Input file:</b></div><div><div>ncdump -h tas_aave_Asia.nc</div><div>netcdf tas_aave_Asia {</div><div>dimensions:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>lon = 1 ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>lat = 1 ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>time = UNLIMITED ; // (1000 currently)</div><div>variables:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double lon(lon) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lon:standard_name = &quot;longitude&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lon:long_name = &quot;longitude&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lon:units = &quot;degrees_east&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lon:axis = &quot;X&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double lat(lat) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lat:standard_name = &quot;latitude&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lat:long_name = &quot;latitude&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lat:units = &quot;degrees_north&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>lat:axis = &quot;Y&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double time(time) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:standard_name = &quot;time&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:long_name = &quot;Time&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:units = &quot;years since 850-1-1 00:00:00&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:calendar = &quot;standard&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>time:axis = &quot;T&quot; ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>double tasmask(time, lat, lon) ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmask:_FillValue = -999000000. ;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>tasmask:missing_value = -999000000. ;</div></div><div><b>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</b></div><div><b>NCL code:</b></div><div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</div><div>begin</div><div><br></div><div>   fn  = &quot;tas_aave_Asia.nc&quot; ; define filename</div><div>   in  = addfile(fn,&quot;r&quot;)                                 ; open netcdf file</div><div>    x  = in-&gt;tasmask(:,0,0)                                       ; get data</div><div><br></div><div>; ***********************************************</div><div>; create the filter weights and apply</div><div>; ***********************************************</div><div><br></div><div>  ihp     = 2                             ; band pass</div><div>  sigma   = 1.0                           ; Lanczos sigma</div><div><br></div><div>  nWgt    = 201                           ; loose 100 each end</div><div>  fca     = 1./100.                       ; start freq</div><div>  fcb     = 1./30.                        ; last  freq</div><div>  wgt     = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )</div><div>  xBPF    = wgt_runave ( x, wgt, 0 )      ; 30-100 days</div><div><br></div><div>   copy_VarMeta(x,xBPF)</div><div>   dNames= getvardims(xBPF)</div><div>   dSIZES=dimsizes(xBPF)</div><div>   print (dNames)</div><div>   print (dSIZES)</div><div><br></div><div>; ***********************************************</div><div>; create new date array for use on the plot</div><div>; ***********************************************</div><div>  filo = &quot;tas_aave_Asia_bandpass30-100.nc&quot;</div><div>  system (&quot;/bin/rm &quot;+filo) ; remove any pre-existing file</div><div>  fo = addfile(filo , &quot;c&quot;) ; open output file</div><div>  filedimdef(fo,&quot;time&quot;,-1,True)       ; make &#39;time&#39; unlimited</div><div>  tasmax=xBPF</div><div>  fo-&gt;tasmax = tasmax ; write ud to a file</div><div>end</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 6, 2017 at 12:07 AM, Adam Phillips <span dir="ltr">&lt;<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.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">Hi SB,<div>Dennis is correct, in that this type of question would be better posed to the GrADS user forum. However, I have some limited experience with GrADS, and in my experience GrADS will not open a file unless there is a X (latitude) and Y (longitude) array present. The arrays do not have to have anything to do with your tasmax array. Thus, I would recommend writing some random latitude/longitude arrays to your file along with your tasmax array.</div><div><br></div><div>If that advice does not help, I would suggest posing your query to the GrADS user forum.</div><div>Adam</div><div><br></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Jul 5, 2017 at 4:57 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.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><div>In my view, this question should be sent to the GrADS User forum not ncl-talk.<br><br></div>Did you look at the created nc file?<br><br></div>%&gt; ncdump  tas_aave_Asia_bandpass30-100.n<wbr>c  |  less<br><div><br>==============================<wbr>=============<br></div><div>Maybe try making the &#39;time&#39; dimension unlimited.<br><br><br></div><div><div>  filo = &quot;tas_aave_Asia_bandpass30-100.<wbr>nc&quot;</div><div>  system (&quot;/bin/rm &quot;+filo) ; remove any pre-existing file</div><div>  fo  = addfile(filo , &quot;c&quot;) ; open output file<br>  <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml" target="_blank"><strong>filedimdef</strong></a>(fo,&quot;time&quot;,-1,True) <wbr>      ; make &#39;time&#39; unlimited<br></div><div>  tasmax = xBPF<br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 5, 2017 at 10:13 AM, S Br <span dir="ltr">&lt;<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</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">Hi,<div>I have applied bandpass filter to my one dimentional NetCDF file. I have written the output to a NetCDF file but this output file is not opening in GrADS. I get the following error.</div><div><br></div><div>ga-&gt; sdfopen tas_aave_Asia_bandpass30-100.n<wbr>c</div><div><div>Scanning self-describing file:  tas_aave_Asia_bandpass30-100.<wbr>nc</div><div>gadsdf: SDF file has no discernable X coordinate.</div><div>  To open this file with GrADS, use a descriptor file with an XDEF entry.</div><div>  Documentation is at <a href="http://cola.gmu.edu/grads/gadoc/SDFdescriptorfile.html" target="_blank">http://cola.gmu.edu/grads/gado<wbr>c/SDFdescriptorfile.html</a></div></div><div><br></div><div>Could you please suggest if I am doing somewhere wrong in my NCL script . The input file is perfectly fine with GrADS.<br></div><div><br></div><div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl&quot;</div><div>begin</div><div><br></div><div>   fn  = &quot;tas_aave_Asia.nc&quot; ; define filename</div><div>   in  = addfile(fn,&quot;r&quot;)                                 ; open netcdf file</div><div>    x  = in-&gt;tasmask(:,0,0)                                       ; get data</div><div><br></div><div>; ******************************<wbr>*****************</div><div>; create the filter weights and apply</div><div>; ******************************<wbr>*****************</div><div><br></div><div>  ihp     = 2                             ; band pass</div><div>  sigma   = 1.0                           ; Lanczos sigma</div><div><br></div><div>  nWgt    = 201                           ; loose 100 each end</div><div>  fca     = 1./100.                       ; start freq</div><div>  fcb     = 1./30.                        ; last  freq</div><div>  wgt     = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )</div><div>  xBPF    = wgt_runave ( x, wgt, 0 )      ; 30-100 days</div><div><br></div><div>   copy_VarMeta(x,xBPF)</div><div>   dNames= getvardims(xBPF)</div><div>   dSIZES=dimsizes(xBPF)</div><div>   print (dNames)</div><div>   print (dSIZES)</div><div><br></div><div>; ******************************<wbr>*****************</div><div>; create new date array for use on the plot</div><div>; ******************************<wbr>*****************</div><div>  filo = &quot;tas_aave_Asia_bandpass30-100.<wbr>nc&quot;</div><div>  system (&quot;/bin/rm &quot;+filo) ; remove any pre-existing file</div><div>  fo = addfile(filo , &quot;c&quot;) ; open output file</div><div>  tasmax=xBPF(:)</div><div>  fo-&gt;tasmax = tasmax ; write ud to a file</div><div>end</div></div><div><br></div><div><br></div><div>Thanks.</div><span class="m_8167875092267344794m_-6603637538672453442HOEnZb"><font color="#888888"><div>SB</div><div><br></div><div><br></div></font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_8167875092267344794gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/<wbr>asphilli/</a>   </font></span><span><font color="#888888"><a href="tel:(303)%20497-1726" value="+13034971726" target="_blank">303-497-1726</a> </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div>
</blockquote></div><br></div>