Hello
After
ft = fo(pts|:,time|:) ;a time series for each station
I would replace the code you have with "write_matrix"
http://www.ncl.ucar.edu/Document/Functions/Built-in/write_matrix.shtml
opt = True
opt_at_fout = "foo.txt"
fmtx = ntim + "f10.3"
opt_at_row = True
write_matrix (ft, fmtx, opt)
Good luck
yanling_1220 wrote:
> Dear Dennis,
> Thanks for your last letter,it deepened my understanding of the
> linint2_points function.
> But I still have a problem of outputing the time series of each
> station as ascii data for father analysis.My script is as below:
> ======================================================================================================================
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
> stain= asciiread("station.asc",(/747,2/), "float")
> printVarSummary(stain )
> lat2d = stain(:,0) ; (N,M)
> lon2d = stain(:,1)
> in = addfile("pcmdi.ipcc4.mpi_echam5.sresa2.run1.monthly.tas_A1.nc","r")
> printVarSummary(in)
> orig = in->tas(0:359,:,:)
> printVarSummary(orig)
> lat = in->lat
> lon = in->lon
> fo = linint2_points_Wrap(lon,lat,orig,True,lon2d,lat2d,0) ;
> fo!0 = "time"
> fo!1 = "pts"
> ft = fo(pts|:,time|:) ;a time series for each station
> dim_ft =dimsizes(ft)
> npts = dim_ft(0)
> ntim = dim_ft(1)
> fName = "foo.txt"
> data = new( npts, "string")
>
> npt = -1
> do nl=0,npts-1
> npt = npt + 1
> data(npt) = sprinti("%0.5i", (npt+1) )
> data(npt) = data(npt) + sprintf("%7.1f ",pts(nl))
> do nt=0,ntim-1
> data(npt) = data(npt) + sprintf("%10.3f ", ft(nl,nt))
> end do
> end do
> asciiwrite (fName , data)
> end
> ======================================================================================================================
>
> when I run this script,it gave me the error message:
> fatal:Undefined identifier: (pts) is undefined, can't continue
> fatal:Execute: Error occurred at or near line 51 in file
> linint2_points_ASCII.ncl
> It resulted from error using of the "pts" ,I know the pts is build up
> by "xcoord" and "ycoord" in fact,it is coordinate pair array.
> but don't know how shoud I define it in the outputing process. On the
> other hand,if I just want to out the time series of some special
> point, and put them in individual files respectively,I think I should
> compare the pts value with the "lat" "lon" of the special points who's
> time series I want to get,then do some loop,but also because of the
> define problem of "pts",I don't know how can obtain Such results either.
> Can you give me some advise? Thank you in advance.
> Regards,
> sunflower
>
>
> ------------------------------------------------------------------------
> 200 万种商品,最低价格,疯狂诱惑你
> <http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com>
-- ====================================================== Dennis J. Shea tel: 303-497-1361 | P.O. Box 3000 fax: 303-497-1333 | Climate Analysis Section | Climate & Global Dynamics Div. | National Center for Atmospheric Research | Boulder, CO 80307 | USA email: shea 'at' ucar.edu | ======================================================Received on Wed Jul 15 2009 - 11:42:27 MDT
This archive was generated by hypermail 2.2.0 : Fri Jul 17 2009 - 15:27:02 MDT