<div dir="ltr"><div class="gmail_default" style="font-size:small">Amit,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your code looks correct, so it may be the input data that's the issue.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You should always do a "printVarSummary" on any variables that aren't producing the expected metadata.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What does the following report:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(tasmax)</div><div class="gmail_default" style="font-size:small">printVarSummary(b)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can try this script as an example:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><div class="gmail_default" style><font face="monospace, monospace"> infile = "$NCARG_ROOT/lib/ncarg/data/cdf/<a href="http://uv300.nc">uv300.nc</a>"</font></div><div class="gmail_default" style><font face="monospace, monospace"> outfile = "<a href="http://test.nc">test.nc</a>"</font></div><div class="gmail_default" style><font face="monospace, monospace"> f = addfile(infile,"r")</font></div><div class="gmail_default" style><font face="monospace, monospace"> u = f->U(:,{25:50},{-100:100})</font></div><div class="gmail_default" style><font face="monospace, monospace"> b = u</font></div><div class="gmail_default" style><font face="monospace, monospace"> printVarSummary(u)</font></div><div class="gmail_default" style><font face="monospace, monospace"><br></font></div><div class="gmail_default" style><font face="monospace, monospace">;---Write to new file</font></div><div class="gmail_default" style><font face="monospace, monospace"> system(" rm -rf " + outfile)</font></div><div class="gmail_default" style><font face="monospace, monospace"> ncdf = addfile(outfile,"c")</font></div><div class="gmail_default" style><font face="monospace, monospace"> filedimdef(ncdf,"time",-1,True)</font></div><div class="gmail_default" style><font face="monospace, monospace"> ncdf->u = u</font></div><div class="gmail_default" style><font face="monospace, monospace"><br></font></div><div class="gmail_default" style><font face="monospace, monospace">;---Close the file</font></div><div class="gmail_default" style><font face="monospace, monospace"> delete(ncdf) </font></div><div class="gmail_default" style><font face="monospace, monospace"><br></font></div><div class="gmail_default" style><font face="monospace, monospace">;---Open new file and read coordinate arrays</font></div><div class="gmail_default" style><font face="monospace, monospace"> a = addfile (outfile,"r")</font></div><div class="gmail_default" style><font face="monospace, monospace"> time = a->time</font></div><div class="gmail_default" style><font face="monospace, monospace"> lat = a->lat</font></div><div class="gmail_default" style><font face="monospace, monospace"> lon = a->lon</font></div><div class="gmail_default" style><font face="monospace, monospace"> print(time)</font></div><div class="gmail_default" style><font face="monospace, monospace"> printVarSummary(lat)</font></div><div class="gmail_default" style><font face="monospace, monospace"> printVarSummary(lon)</font></div><div class="gmail_default" style><font face="monospace, monospace"> printMinMax(lat,0)</font></div><div class="gmail_default" style><font face="monospace, monospace"> printMinMax(lon,0)</font></div><div style="font-size:small"><br></div></div><div class="gmail_default" style><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 10:03 AM, amit timilsina <span dir="ltr"><<a href="mailto:timilsinaamit87@huskers.unl.edu" target="_blank">timilsinaamit87@huskers.unl.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello all,<br>
<br>
I have tried to clip required domain data set and created new .nc file but there is not time co-ordinate information. Is there other code need to write while creating file??? Here is the code I have used.<br>
<br>
<br>
ncl 0> f = addfile("tasmax_Amon_MPI-ESM-LR_decadal1980_r1i1p1_198101-201012.nc","r")<br>
ncl 1> tasmax =f->tasmax(:,{25:50},{235:285})<br>
ncl 2> b = tasmax<br>
ncl 3> ncdf = addfile("tasmax_Amon_MPI-ESM-LR_decadal1980_r1_USA.nc","c")<br>
ncl 4> filedimdef(ncdf,"time",-1,True)<br>
ncl 5> ncdf->tasmax = b<br>
<br>
I could not have access to any co-rodinates using following codes:<br>
<br>
a= addfile ("tasmax_Amon_MPI-ESM-LR_decadal1980_r1_USA.nc","r")<br>
b=a->time /*output: there is no time dimension on file a<br>
c=a->lon /*output: there is no lon dimension on file a<br>
d=a->lat /*output: there is no lat demotion on file a<br>
<br>
<br>
Thank you in advance<br>
<br>
Regards,<br>
Amit<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>