<div dir="ltr">Hi:<div><br></div><div>I don&#39;t have a moment to look at what you did, but what I write below may help.</div><div><br></div><div>Change the filename and variables to the ones you want.</div><div><br></div><div>You can substitute for the &quot;0&quot; any time variable you want. I think you can set it to -1 to get all times.</div><div><div><br></div><div>  filename=&quot;<a href="http://wrfinput_d02.nc">wrfinput_d02.nc</a>&quot;</div><div>  a = addfile(filename,&quot;r&quot;)</div><div>  t2 =wrf_user_getvar(a,&quot;T2&quot;,0)</div><div>  printVarSummary(t2)</div><div>  xlat2d=wrf_user_getvar(a,&quot;XLAT&quot;,0)</div><div>  xlon2d=wrf_user_getvar(a,&quot;XLONG&quot;,0)</div><div><br></div><div><div>system(&quot;rm -f <a href="http://file_for_you.nc">file_for_you.nc</a>&quot;)</div><div>fout = addfile(&quot;<a href="http://file_for_you.nc">file_for_you.nc</a>&quot;,&quot;c&quot;)</div><div>fout-&gt;t2  = t2</div><div>fout-&gt;xlat      = xlat</div><div>fout-&gt;xlong     = xlong</div></div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 16, 2017 at 4:24 AM, Wang,Yu <span dir="ltr">&lt;<a href="mailto:wangyu8722@ufl.edu" target="_blank">wangyu8722@ufl.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 id="m_-5953232094749748635divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Dear NCL users,</p>
<p><br>
</p>
<p>I am trying to use ncl to extract one variable from wrf output to a separate netcdf files for further analysis. I was trying to modify the script here provided by the UCAR website. <a href="http://www.ncl.ucar.edu/Applications/netcdf4.shtml" class="m_-5953232094749748635OWAAutoLink" id="m_-5953232094749748635LPlnk23067" target="_blank">http://www.ncl.ucar.<wbr>edu/Applications/netcdf4.shtml</a><wbr>.
 So I have created a script attached with this email. However, I am having an error as below:</p>
<p></p>
<div><br>
</div>
<div>fatal:Number of dimensions in parameter (2) of (filedimdef) is (2), (1) dimensions were expected</div>
<div>fatal:[&quot;Execute.c&quot;:8575]:<wbr>Execute: Error occurred at or near line 58 in file wrf_op_1.ncl</div>
<div><br>
</div>
<div>I understand this is showing a mismatching dimension, in this case is the lat and lon. The example case is a one dimension netcdf file for its lat and lon, but my file should have 2d for lat and lon. Is there a different way of doing what I am doing? </div>
<div><br>
</div>
<div>Hope someone could provide some help.</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>Yu</div>
<p></p>
<div id="m_-5953232094749748635LPBorder_GT_14896306247450.8337959031423823" style="margin-bottom:20px;overflow:auto;width:100%;text-indent:0px">
<table id="m_-5953232094749748635LPContainer_14896306247420.8105389483599279" cellspacing="0" style="width:90%;background-color:rgb(255,255,255);overflow:auto;padding-top:20px;padding-bottom:20px;margin-top:20px;border-top:1px dotted rgb(200,200,200);border-bottom:1px dotted rgb(200,200,200)">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td id="m_-5953232094749748635TextCell_14896306247430.6689998337642498" colspan="2" style="vertical-align:top;padding:0px;display:table-cell">
<div id="m_-5953232094749748635LPRemovePreviewContainer_14896306247430.4100041202760838"></div>
<div id="m_-5953232094749748635LPTitle_14896306247440.10221918094671634" style="color:rgb(0,120,215);font-weight:normal;font-size:21px;font-family:wf_segoe-ui_light,&quot;Segoe UI Light&quot;,&quot;Segoe WP Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;line-height:21px">
<a id="m_-5953232094749748635LPUrlAnchor_14896306247440.2982852028756018" href="http://www.ncl.ucar.edu/Applications/netcdf4.shtml" style="text-decoration:none" target="_blank">Reading and writing NetCDF-4 - ncl.ucar.edu</a></div>
<div id="m_-5953232094749748635LPMetadata_14896306247440.11452900932194954" style="margin:10px 0px 16px;color:rgb(102,102,102);font-weight:normal;font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;font-size:14px;line-height:14px">
<a href="http://www.ncl.ucar.edu" target="_blank">www.ncl.ucar.edu</a></div>
<div id="m_-5953232094749748635LPDescription_14896306247440.8553183031828786" style="display:block;color:rgb(102,102,102);font-weight:normal;font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;font-size:14px;line-height:20px;max-height:100px;overflow:hidden">
NCL Home&gt; Application examples&gt; File IO || Data files for some examples. Example pages containing: tips | resources | functions/procedures Reading and writing NetCDF-4</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>