<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>

<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>                        BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}                        body{FONT-SIZE:12.1pt; COLOR:#001; FONT-FAMILY:宋体,serif;}                </STYLE>

<META name=GENERATOR content="MSHTML 11.00.9600.17496"><BASE 
target=_blank></HEAD>
<BODY 
style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 12px; LINE-HEIGHT: 1.3; BORDER-TOP-WIDTH: 0px" 
marginheight="0" marginwidth="0"><STATIONERY>
<DIV><FONT color=#000000 size=3 face=宋体>Hello all,</FONT></DIV>
<DIV><FONT color=#000000 size=3></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=3>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV><FONT color=#000000 size=3>&nbsp;&nbsp;&nbsp;&nbsp; Any 
suggestion?</FONT></DIV>
<DIV><FONT color=#000000 size=3></FONT>&nbsp;</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:["Execute.c":8128]:Execute: Error occurred at or near line 60 
in file tidepot.ncl</DIV>
<DIV>&nbsp;</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:["Execute.c":8128]:Execute: Error occurred at or near line 61 
in file tidepot.ncl</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>begin<BR>&nbsp; Lp = 987 ;474&nbsp; ;xi_rho<BR>&nbsp; Mp = 795 ;482&nbsp; 
;eta_rho<BR>;&nbsp; Lp = 542<BR>;&nbsp; Mp = 770</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; pots = asciiread("scs_8con.dat", (/Mp,Lp,16/), "float")<BR>;&nbsp; 
pots = asciiread("Bering_8con.dat", (/Mp,Lp,16/), "float")</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; fname = "scs_tide_20000101.nc"<BR>&nbsp; ncid = addfile(fname, 
"w")<BR>&nbsp; Ntc = 8<BR>&nbsp; eamp=ncid-&gt;tide_Ephase<BR>&nbsp; tide_Pamp = 
new(dimsizes(eamp), typeof(eamp),"No_FillValue")<BR>&nbsp; tide_Pphase = 
new(dimsizes(eamp),typeof(eamp),"No_FillValue")<BR>;&nbsp; tide_Pphase = 
new((/Ntc, Mp, Lp/), double)<BR>&nbsp;&nbsp; 
printVarSummary(tide_Pamp)<BR>&nbsp;&nbsp; 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>&nbsp; 
tide_Pamp(0,:,:) = pots(:,:,0)<BR>&nbsp; tide_Pamp(1,:,:) = 
pots(:,:,2)<BR>&nbsp; tide_Pamp(2,:,:) = pots(:,:,4)<BR>&nbsp; tide_Pamp(3,:,:) 
= pots(:,:,6)<BR>&nbsp; tide_Pamp(4,:,:) = pots(:,:,8)<BR>&nbsp; 
tide_Pamp(5,:,:) = pots(:,:,10)</DIV>
<DIV>&nbsp; tide_Pamp(6,:,:) = pots(:,:,12)<BR>&nbsp; tide_Pamp(7,:,:) = 
pots(:,:,14)<BR>&nbsp; tide_Pphase(0,:,:) = pots(:,:,1)<BR>&nbsp; 
tide_Pphase(1,:,:) = pots(:,:,3)<BR>&nbsp; tide_Pphase(2,:,:) = 
pots(:,:,5)<BR>&nbsp; tide_Pphase(3,:,:) = pots(:,:,7)<BR>&nbsp; 
tide_Pphase(4,:,:) = pots(:,:,9)<BR>&nbsp; tide_Pphase(5,:,:) = 
pots(:,:,11)<BR>&nbsp; tide_Pphase(6,:,:) = pots(:,:,13)<BR>&nbsp; 
tide_Pphase(7,:,:) = pots(:,:,15)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; tide_Pamp!0 = "tide_period"<BR>&nbsp; tide_Pamp!1 = 
"eta_rho"<BR>&nbsp; tide_Pamp!2 = "xi_rho"<BR>&nbsp; tide_Pphase!0 = 
"tide_period"<BR>&nbsp; tide_Pphase!1 = "eta_rho"<BR>&nbsp; tide_Pphase!2 = 
"xi_rho"<BR>&nbsp;&nbsp;&nbsp; printVarSummary(tide_Pamp)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; <A href="mailto:tide_Pamp@units">tide_Pamp@units</A> = 
"meter"<BR>&nbsp; <A href="mailto:tide_Pamp@long_name">tide_Pamp@long_name</A> = 
"tidal potential elevation amplitude"<BR>&nbsp; <A 
href="mailto:tide_Pamp@field">tide_Pamp@field</A> = "tide_Eamp, 
scalar"<BR>&nbsp; <A href="mailto:tide_Pphase@units">tide_Pphase@units</A> = 
"degrees, time of maximum elevation with respect chosen time origin"<BR>&nbsp; 
<A href="mailto:tide_Pphase@long_name">tide_Pphase@long_name</A> = "tidal 
potential elevation phase angle"<BR>&nbsp; <A 
href="mailto:tide_Pphase@field">tide_Pphase@field</A> = "tide_Ephase, 
scalar"</DIV>
<DIV>&nbsp;</DIV>
<DIV>; global attributes<BR>&nbsp; fileAtt = True<BR>&nbsp; <A 
href="mailto:fileAtt@history">fileAtt@history</A> = "adding potential 
tides"<BR>&nbsp; fileattdef(ncid, fileAtt)</DIV>
<DIV>&nbsp;</DIV>
<DIV>; Write to file<BR>&nbsp; ncid-&gt;tide_Pamp = tide_Pamp<BR>&nbsp; 
ncid-&gt;tide_Pphase = tide_Pphase</DIV>
<DIV>&nbsp;</DIV>
<DIV>end<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 
face=Verdana>2015-01-30</FONT></DIV><FONT size=2 face=Verdana>
<HR id=SignNameHR style="HEIGHT: 2px; WIDTH: 122px" align=left SIZE=2>
</FONT>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN id=_FlashSignName>
<STYLE type=text/css>
body {
        font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\Mail\网易\\data\scrollbar.css); -->
blockquote {
        margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
        padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 10.00.9200.16686"><STATIONERY>
<DIV>
<STYLE type=text/css>
body {
        font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\Mail\网易\\data\scrollbar.css); -->
blockquote {
        margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
        padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 10.00.9200.16686"><STATIONERY>
<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's Republic of 
China<BR>Tel:+86-10-82481923</FONT></DIV></DIV></DIV></STATIONERY></DIV></STATIONERY></SPAN></FONT></DIV></STATIONERY></BODY></HTML>