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

Anne anne.seidenglanz at unive.it
Thu Aug 31 04:13:15 MDT 2017


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:

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" ;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170831/3f78fb60/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_variable.ncl
Type: application/octet-stream
Size: 1630 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170831/3f78fb60/attachment.obj>


More information about the ncl-talk mailing list