Re: writing nc file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun, 22 Mar 2009 08:33:09 -0600

It is my speculation that in the ncl script
'data1' is 2-dimensional. Inserting
       filedimdef(ncdf,"time",-1,True)
when writing a netCDF file does *not* add a time
dimension to the to the *variable* being written.
It will write a 'time' dimension onto the *file*
but 'time' will not have any value associated with it.

      time = ; something, even, yyyymmdd
      time_at_units = "???"

      rrate = conform_dims( (/1,nlat,mlon/), data1, (/1,2/) )
      rrate!0 = "time"
      rrate!1 = "lat"
      rrate!2 = "lon"
      rrate&time= time
      rrate&lat = lat
      rrate&lon = lon
      copy_VarAtts( data1, rrate) ; contributed.ncl

      ; later

      ncdf->RRATE = rrate

Dorita Rostkier-Edelstein wrote:
> Hi,
>
> I am trying to write an netCDF file as follows:
>
> ncdf = addfile(all_files(nf)+"_00.nc" ,"c") ; open output
> netCDF file
> filedimdef(ncdf,"time",-1,True)
> ; output variables directly
> ncdf->RRATE = data1
>
> Although it nicely writes the data when I do an "ncdump -h" to the netCDF file it shows o record:
>
> dimensions:
> time = UNLIMITED ; // (0 currently)
> lat = 1649 ;
> lon = 4948 ;
> variables:
> float RRATE(lat, lon) ;
> RRATE:_FillValue = -1.f ;
>
> I can plot from this file, but I want to average a couple of them using "ncea", and in such case it complains about the 0 record:
>
>
> ncea: ERROR
> nco_lmt_sct_mk() reports record variable exists and is size
> zero, i.e., has no records yet.
> ncea: HINT: Perform record-oriented operations only after file has valid
> records.
> ncea: cnt < 0 in nco_lmt_sct_mk()
>
> Can anybody help me?
>
> Thanks,
>
> Dorita
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Mar 22 2009 - 08:33:09 MDT

This archive was generated by hypermail 2.2.0 : Mon Mar 23 2009 - 12:30:31 MDT