<!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><!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\Mail\网易\\data\scrollbar.css); -->
</STYLE>
<BASE target=_blank><!-- flashmail style end --></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"
marginwidth="0" marginheight="0"><STATIONERY>
<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:["Execute.c":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:["Execute.c":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("scs_8con.dat", (/Mp,Lp,16/), "float")<BR>;
pots = asciiread("Bering_8con.dat", (/Mp,Lp,16/), "float")</DIV>
<DIV> </DIV>
<DIV> fname = "scs_tide_20000101.nc"<BR> ncid = addfile(fname,
"w")<BR> Ntc = 8<BR> eamp=ncid->tide_Ephase<BR> tide_Pamp =
new(dimsizes(eamp), typeof(eamp),"No_FillValue")<BR> tide_Pphase =
new(dimsizes(eamp),typeof(eamp),"No_FillValue")<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 = "tide_period"<BR> tide_Pamp!1 =
"eta_rho"<BR> tide_Pamp!2 = "xi_rho"<BR> tide_Pphase!0 =
"tide_period"<BR> tide_Pphase!1 = "eta_rho"<BR> tide_Pphase!2 =
"xi_rho"<BR> printVarSummary(tide_Pamp)</DIV>
<DIV> </DIV>
<DIV> <A href="mailto:tide_Pamp@units">tide_Pamp@units</A> =
"meter"<BR> <A href="mailto:tide_Pamp@long_name">tide_Pamp@long_name</A> =
"tidal potential elevation amplitude"<BR> <A
href="mailto:tide_Pamp@field">tide_Pamp@field</A> = "tide_Eamp,
scalar"<BR> <A href="mailto:tide_Pphase@units">tide_Pphase@units</A> =
"degrees, time of maximum elevation with respect chosen time origin"<BR>
<A href="mailto:tide_Pphase@long_name">tide_Pphase@long_name</A> = "tidal
potential elevation phase angle"<BR> <A
href="mailto:tide_Pphase@field">tide_Pphase@field</A> = "tide_Ephase,
scalar"</DIV>
<DIV> </DIV>
<DIV>; global attributes<BR> fileAtt = True<BR> <A
href="mailto:fileAtt@history">fileAtt@history</A> = "adding potential
tides"<BR> fileattdef(ncid, fileAtt)</DIV>
<DIV> </DIV>
<DIV>; Write to file<BR> ncid->tide_Pamp = tide_Pamp<BR>
ncid->tide_Pphase = tide_Pphase</DIV>
<DIV> </DIV>
<DIV>end<BR></DIV>
<DIV> </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>