Re: Rewriting nc files

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 21 2010 - 13:29:05 MDT

The 1st rule of data processing is to "look at your data" before
proceeding:

%> ncdump -h olr.day.mean.nc

or

%> ncl_filedump olr.day.mean.nc

shows the following:

short olr(time, lat, lon) < olr is of type "short integer"

You must unpack the olr

http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml

===
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

   f = addfile("olr.day.mean.nc" , "r")
   olr = short2flt( f->olr )
or
   olr = short2flt( f->olr(200:400,:,:) )

   printVarSummary(olr)

On 06/21/2010 01:18 PM, Enver Ramirez Gutierrez wrote:
> Hi,
>
> I used the following commands to extract a given period of the
> 'olr.day.mean.nc <http://olr.day.mean.nc>' file and write it out as a
> new NetCDF file
>
> fi = addfile("olr.day.mean.nc <http://olr.day.mean.nc>","r")
> fo = addfile("test.nc <http://test.nc>","c")
>
> fo->testolr=fi->olr(200:400,:,:)
>
> Even when the new file (test.nc <http://test.nc>) can be open with grads
> and with ncl as well. When I used this new file as input of the
> wkSpaceTime_cam() appears:
>
> fatal: Assignment type mismatch, right hand side can't be coerced to
> type of left hand side.
> fatal:Execute:Error ocurred at or near line 626 in file
> $NCARG_ROOT/lib/mcarg/nclscripts/csm/diagnostics_cam.ncl
> fatal:Execute:Error ocurred at or near line 1459 in file
> $NCARG_ROOT/lib/mcarg/nclscripts/csm/diagnostics_cam.ncl
>
> When I do
>
> print(fo->testolr&time)
>
> the only thing that draw my attention is that the numbers in the
>
> actual_range : (HERE,HERE)
>
> continues to be the same as the olr.day.mean.nc <http://olr.day.mean.nc>
>
> Does any body has an idea to solve this problem?
> Enver
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 21 13:29:11 2010

This archive was generated by hypermail 2.1.8 : Thu Jun 24 2010 - 14:10:27 MDT