Re: regrid script that is a bit buggy

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 15 2013 - 15:41:49 MDT

Hi Marston,

My guess is that you defined dimensions for your array variables, but not your scalar
variables.

Everytime you write a variable to a file that you haven't defined the dimensions for,
NCL will assign a new dimension name, starting with "ncl1", and so on. It will give
a different name every time.

To get around this, you need to call filevardef for each of your scalar variables, and use the
special "ncl_scalar" dimension name:

filevardef(ncid, varname,vartype,"ncl_scalar")
where "varname" and "vartype" need to be replaced by the appropriate variable names and types.

This is covered in our FAQ:

http://www.ncl.ucar.edu/FAQ/#file_io_007

--Mary

On Apr 15, 2013, at 1:45 AM, Marston Johnston wrote:

> Hi,
>
> I'm new to NCL and jumpped right in at the deep end.
> NCL seems to be very powerful but the learning curve seems a bit steep.
> I have taken a regridding script found the NCL example website and modified it to handle very very large arrays
> and write the data, time step by time step. But, the code is buggy. It works ok but my file keeps adding these strange ncl dimensions to the output file:
>
> dimensions:
> time = UNLIMITED ; // (5848 currently)
> lev = 9 ;
> lat = 81 ;
> lon = 360 ;
> ncl4 = 1 ;
> ncl5 = 1 ;
> ncl6 = 1 ;
> ncl7 = 1 ;
> ncl8 = 1 ;
> ncl9 = 1 ;
> ncl10 = 1 ;
> ncl11 = 1 ;
> ncl12 = 1 ;
> ncl13 = 1 ;
> ncl14 = 1 ;
> ncl15 = 1 ;
> ncl16 = 1 ;
>
> I've attached the ncl script. Would appreciate some help with understanding how ncl writes netcdf files and how to write the data and data attributes to the output file. Also how to do this per time step or even per pressure level.
>
> /Marston
> --
> Only the fruitful thing is true!
> <regrid_new.ncl>_______________________________________________
> 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 Mon Apr 15 15:41:57 2013

This archive was generated by hypermail 2.1.8 : Mon Apr 15 2013 - 20:12:25 MDT