[ncl-talk] Problem with dimensions when writing variable to netcdf

Karin Meier-Fleischer meier-fleischer at dkrz.de
Thu Aug 31 04:59:54 MDT 2017


Hi Anne,

you have to create the named dimension for time_counter and commit the 
time_counter data:

   time_counter              = tofloat(time)
   time_counter!0            = "time_counter"
   time_counter&time_counter =  time_counter

Bye,
Karin

Am 31.08.17 um 12:13 schrieb Anne:
> Hello,
>
> in the attached script I am reading in a variable from a file, and 
> want to use it to define another variable with the same dimensions, 
> except for one that needs to have a different size (time_counter; 
> length 180 instead of 12). The output of 'ncdump' (see below) after 
> reading to netcdf is nearly what I want, except of the 'ncl3' line in 
> dimensions, that is not recognised as 'time_counter' as I wanted it 
> to. In other words, it would be perfect without the 'ncl3 = 180' line. 
> I've played around with this script in various ways but I just don't 
> arrive there. Maybe I'm overlooking something?
>
> Any help appreciated!
> Anne
>
> ncdump -h masc_exag.nc <http://masc_exag.nc>:
>
> time_counter = UNLIMITED ; // (180 currently)
> y = 1021 ;
> x = 1442 ;
> ncl3 = 180 ;
> variables:
> float masc(time_counter, y, x) ;
> masc:valid_max = "33.78767f" ;
> masc:valid_min = "-2.139231f" ;
> masc:long_name = "votemper" ;
> masc:units = "C" ;
> masc:_FillValue = 9.96921e+36f ;
> float nav_lat(y, x) ;
> nav_lat:units = "degrees_north" ;
> nav_lat:valid_min = "-77.01048f" ;
> nav_lat:valid_max = "89.94787f" ;
> nav_lat:long_name = "Latitude at t-point" ;
> float nav_lon(y, x) ;
> nav_lon:units = "degrees_east" ;
> nav_lon:valid_min = "-180.f" ;
> nav_lon:valid_max = "180.f" ;
> nav_lon:long_name = "Longitude at t-point" ;
> float time_counter(ncl3) ;
> time_counter:modulo = " " ;
> time_counter:time_origin = "01-JAN-2002:00:00:00" ;
> time_counter:long_name = "Time axis" ;
> time_counter:title = "Time" ;
> time_counter:calendar = "noleap" ;
> time_counter:units = "seconds since 2002-01-01 00:00" ;
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170831/c668e07d/attachment.html>


More information about the ncl-talk mailing list