Re: Question on writing many series to a netcdf file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 13 Feb 2007 09:01:16 -0700 (MST)

> I'm using ncl to output some time series (with different time span) in a netcdf format.
> Here below is a part of my simple script.
>
> x = asciiread("/home/linx/work/indices/PDO_Mantua_Obs_1900-2005_ANN.MAM.dat",(/106,2/),"float")
> pdo1 = x(:,0) ; ANN PDO from Mantua
> pdo1!0 = "time"
> ntime = dimsizes(pdo1)
> pdo1&time = fspan(1900,2005,ntime)
> pdo1_at_units = "standard value"
> pdo1_at_long_name = "PDO.ANN Obs" ; for leftstring
> pdo1_at_reference = "(Mantua et.al,1997)"
>
> system("rm ./ClimateIndices.nc")
> fout = addfile("./ClimateIndices.nc","c")
> fout_at_title="Climate Indices (Both Obs and Proxy record, Including PDO,ENSO,NHI&SHI,AO&NAO..)"
> fout_at_creation_date = systemfunc("date")
>
> ; make time and UNLIMITED dimension ; recommended for most applications
> filedimdef(fout,"time",-1,True) ; when I turn off this line, the script
> ; will report the error of dimsizes
> ; inconsitence for different series
> fout->pdo_ann_mantua = pdo1
> ........
>
> But I find that the outputed series (in nc file) are longer than the
> exact time span , and filled with missing value
>
> just outside the real time span.
>
> Anyone can help me? Thank a lot!
===========================================================

[1] netCDF3 allows only one unlimited dimenson.
    On this type of file, I recommend that no
    dimension be "unlimited".

[2] You name the record dimension "time" the same for
    each time series even though each has a different
    length. You can not do this. It is not NCL it is the
    netCDF software.

[3] Give each time dimension a unique name.

       pdo_ann_mantua(time_pdo_ann_mantua)
       enso_34(time_n34)

good luck
    
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 13 2007 - 09:01:16 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 14:07:37 MST