<div dir="ltr"><div><div><div><div><div>You should include the output from  <br>     printVarSummary(eamp)<br><br></div>and compare with<br>     printVarSummary(tide_Pamp)<br><br></div>A guess is that you need to use<br><br></div>     copy_VarCoords(eamp, tide_Pamp)<br><br></div>     printBarSummary(tide_Pamp)<br><br></div>Good Luck<br><div><div><div><div><div><br><br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 6:05 PM, 朱学明 <span dir="ltr">&lt;<a href="mailto:557xiaozhu@163.com" target="_blank">557xiaozhu@163.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 class="HOEnZb"><div class="h5"><u></u>









<div style="BORDER-LEFT-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;MARGIN:12px;LINE-HEIGHT:1.3;BORDER-TOP-WIDTH:0px" marginwidth="0" marginheight="0"><u></u>
<div><font color="#000000" size="3" face="宋体">Hello all,</font></div>
<div><font color="#000000" size="3"></font> </div>
<div><font color="#000000" size="3">    I have got a warning and 
error with the code as follow. I want to add two new variables, tide_Pamp and 
tide_Pphase, to the existed file. What is the problem with my NCL code? 
</font></div>
<div><font color="#000000" size="3"></font> </div>
<div><font color="#000000" size="3">     Any 
suggestion?</font></div>
<div><font color="#000000" size="3"></font> </div>
<div>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;:8128]:Execute: Error occurred at or near line 60 
in file tidepot.ncl</div>
<div> </div>
<div>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;:8128]:Execute: Error occurred at or near line 61 
in file tidepot.ncl</div>
<div> </div>
<div> </div>
<div>begin<br>  Lp = 987 ;474  ;xi_rho<br>  Mp = 795 ;482  
;eta_rho<br>;  Lp = 542<br>;  Mp = 770</div>
<div> </div>
<div>  pots = asciiread(&quot;scs_8con.dat&quot;, (/Mp,Lp,16/), &quot;float&quot;)<br>;  
pots = asciiread(&quot;Bering_8con.dat&quot;, (/Mp,Lp,16/), &quot;float&quot;)</div>
<div> </div>
<div>  fname = &quot;<a href="http://scs_tide_20000101.nc" target="_blank">scs_tide_20000101.nc</a>&quot;<br>  ncid = addfile(fname, 
&quot;w&quot;)<br>  Ntc = 8<br>  eamp=ncid-&gt;tide_Ephase<br>  tide_Pamp = 
new(dimsizes(eamp), typeof(eamp),&quot;No_FillValue&quot;)<br>  tide_Pphase = 
new(dimsizes(eamp),typeof(eamp),&quot;No_FillValue&quot;)<br>;  tide_Pphase = 
new((/Ntc, Mp, Lp/), double)<br>   
printVarSummary(tide_Pamp)<br>   printVarSummary(pots)<br>; Fill in 
the values<br>; ROMS order is q1, o1, p1, k1, n2, m2, s2, k2 while the input 
file is <br>; q1, o1, p1, k1, n2, m2, s2, k2 in amplitude, phase pairs<br>  
tide_Pamp(0,:,:) = pots(:,:,0)<br>  tide_Pamp(1,:,:) = 
pots(:,:,2)<br>  tide_Pamp(2,:,:) = pots(:,:,4)<br>  tide_Pamp(3,:,:) 
= pots(:,:,6)<br>  tide_Pamp(4,:,:) = pots(:,:,8)<br>  
tide_Pamp(5,:,:) = pots(:,:,10)</div>
<div>  tide_Pamp(6,:,:) = pots(:,:,12)<br>  tide_Pamp(7,:,:) = 
pots(:,:,14)<br>  tide_Pphase(0,:,:) = pots(:,:,1)<br>  
tide_Pphase(1,:,:) = pots(:,:,3)<br>  tide_Pphase(2,:,:) = 
pots(:,:,5)<br>  tide_Pphase(3,:,:) = pots(:,:,7)<br>  
tide_Pphase(4,:,:) = pots(:,:,9)<br>  tide_Pphase(5,:,:) = 
pots(:,:,11)<br>  tide_Pphase(6,:,:) = pots(:,:,13)<br>  
tide_Pphase(7,:,:) = pots(:,:,15)</div>
<div> </div>
<div>  tide_Pamp!0 = &quot;tide_period&quot;<br>  tide_Pamp!1 = 
&quot;eta_rho&quot;<br>  tide_Pamp!2 = &quot;xi_rho&quot;<br>  tide_Pphase!0 = 
&quot;tide_period&quot;<br>  tide_Pphase!1 = &quot;eta_rho&quot;<br>  tide_Pphase!2 = 
&quot;xi_rho&quot;<br>    printVarSummary(tide_Pamp)</div>
<div> </div>
<div>  <a href="mailto:tide_Pamp@units" target="_blank">tide_Pamp@units</a> = 
&quot;meter&quot;<br>  <a href="mailto:tide_Pamp@long_name" target="_blank">tide_Pamp@long_name</a> = 
&quot;tidal potential elevation amplitude&quot;<br>  <a href="mailto:tide_Pamp@field" target="_blank">tide_Pamp@field</a> = &quot;tide_Eamp, 
scalar&quot;<br>  <a href="mailto:tide_Pphase@units" target="_blank">tide_Pphase@units</a> = 
&quot;degrees, time of maximum elevation with respect chosen time origin&quot;<br>  
<a href="mailto:tide_Pphase@long_name" target="_blank">tide_Pphase@long_name</a> = &quot;tidal 
potential elevation phase angle&quot;<br>  <a href="mailto:tide_Pphase@field" target="_blank">tide_Pphase@field</a> = &quot;tide_Ephase, 
scalar&quot;</div>
<div> </div>
<div>; global attributes<br>  fileAtt = True<br>  <a href="mailto:fileAtt@history" target="_blank">fileAtt@history</a> = &quot;adding potential 
tides&quot;<br>  fileattdef(ncid, fileAtt)</div>
<div> </div>
<div>; Write to file<br>  ncid-&gt;tide_Pamp = tide_Pamp<br>  
ncid-&gt;tide_Pphase = tide_Pphase</div>
<div> </div>
<div>end<br></div>
<div> </div>
<div align="left"><font color="#c0c0c0" face="Verdana">2015-01-30</font></div><font face="Verdana">
<hr style="min-height:2px;WIDTH:122px" align="left" size="2">
</font>
<div><font color="#c0c0c0" face="Verdana"><span>




<u></u>
<div>




<u></u>
<div>
<div>
<div><font face="Times New Roman">Xueming Zhu 朱学明<br>Key Laboratory of Research 
on Marine Hazards Forecasting (LoMF), SOA<br>National Marine Environmental 
Forecasting Center (NMEFC)<br>No.8, Dahuisi Road, Haidian District, Beijing, 
100081<br>People&#39;s Republic of 
China<br>Tel:<a href="tel:%2B86-10-82481923" value="+861082481923" target="_blank">+86-10-82481923</a></font></div></div></div><u></u></div><u></u></span></font></div><u></u></div></div></div><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>
<br></blockquote></div><br></div>