[ncl-talk] warning:Right hand side has no coordinate variable can not delete coordinate variable of a file
朱学明
557xiaozhu at 163.com
Fri Jan 30 07:24:32 MST 2015
Hello all,
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?
Any suggestion?
warning:Right hand side has no coordinate variable can not delete coordinate variable of a file, use (/ .. /) to avoid this message
warning:["Execute.c":8128]:Execute: Error occurred at or near line 60 in file tidepot.ncl
warning:Right hand side has no coordinate variable can not delete coordinate variable of a file, use (/ .. /) to avoid this message
warning:["Execute.c":8128]:Execute: Error occurred at or near line 61 in file tidepot.ncl
begin
Lp = 987 ;474 ;xi_rho
Mp = 795 ;482 ;eta_rho
; Lp = 542
; Mp = 770
pots = asciiread("scs_8con.dat", (/Mp,Lp,16/), "float")
; pots = asciiread("Bering_8con.dat", (/Mp,Lp,16/), "float")
fname = "scs_tide_20000101.nc"
ncid = addfile(fname, "w")
Ntc = 8
eamp=ncid->tide_Ephase
tide_Pamp = new(dimsizes(eamp), typeof(eamp),"No_FillValue")
tide_Pphase = new(dimsizes(eamp),typeof(eamp),"No_FillValue")
; tide_Pphase = new((/Ntc, Mp, Lp/), double)
printVarSummary(tide_Pamp)
printVarSummary(pots)
; Fill in the values
; ROMS order is q1, o1, p1, k1, n2, m2, s2, k2 while the input file is
; q1, o1, p1, k1, n2, m2, s2, k2 in amplitude, phase pairs
tide_Pamp(0,:,:) = pots(:,:,0)
tide_Pamp(1,:,:) = pots(:,:,2)
tide_Pamp(2,:,:) = pots(:,:,4)
tide_Pamp(3,:,:) = pots(:,:,6)
tide_Pamp(4,:,:) = pots(:,:,8)
tide_Pamp(5,:,:) = pots(:,:,10)
tide_Pamp(6,:,:) = pots(:,:,12)
tide_Pamp(7,:,:) = pots(:,:,14)
tide_Pphase(0,:,:) = pots(:,:,1)
tide_Pphase(1,:,:) = pots(:,:,3)
tide_Pphase(2,:,:) = pots(:,:,5)
tide_Pphase(3,:,:) = pots(:,:,7)
tide_Pphase(4,:,:) = pots(:,:,9)
tide_Pphase(5,:,:) = pots(:,:,11)
tide_Pphase(6,:,:) = pots(:,:,13)
tide_Pphase(7,:,:) = pots(:,:,15)
tide_Pamp!0 = "tide_period"
tide_Pamp!1 = "eta_rho"
tide_Pamp!2 = "xi_rho"
tide_Pphase!0 = "tide_period"
tide_Pphase!1 = "eta_rho"
tide_Pphase!2 = "xi_rho"
printVarSummary(tide_Pamp)
tide_Pamp at units = "meter"
tide_Pamp at long_name = "tidal potential elevation amplitude"
tide_Pamp at field = "tide_Eamp, scalar"
tide_Pphase at units = "degrees, time of maximum elevation with respect chosen time origin"
tide_Pphase at long_name = "tidal potential elevation phase angle"
tide_Pphase at field = "tide_Ephase, scalar"
; global attributes
fileAtt = True
fileAtt at history = "adding potential tides"
fileattdef(ncid, fileAtt)
; Write to file
ncid->tide_Pamp = tide_Pamp
ncid->tide_Pphase = tide_Pphase
end
2015-01-30
Xueming Zhu 朱学明
Key Laboratory of Research on Marine Hazards Forecasting (LoMF), SOA
National Marine Environmental Forecasting Center (NMEFC)
No.8, Dahuisi Road, Haidian District, Beijing, 100081
People's Republic of China
Tel:+86-10-82481923
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150130/ebf26501/attachment.html
More information about the ncl-talk
mailing list