Re: Question about wkSpaceTime

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 14 2013 - 14:02:02 MST

Hi Charlotte,

THX.

attached:
I've added your script [typo 'endif' removed] as a comment
to an NCL script I use. The NCL sript is more verbose
because I have print statements and provide a TEST option.
I don't trust myself, I guess!!

Te script uses the newer ncks option

   %> ncks -O --mk_rec_dmn time in.nc out.nc

Regards
D

On 11/14/13 12:08 PM, Charlotte DeMott wrote:
> If it's of any help, I use the following NCO script to change the time dimension from fixed to unlimited. There may be a faster way to do it, but this has served me well.
>
> Cheers,
> Charlotte
>
> #!/bin/csh
>
> foreach i (*.nc)
> echo $i
> ncecat -O $i $i # add degenerate record dimension
> ncpdq -O -a time,record $i $i # switch "record" and "time"
> ncwa -O -a record $i $i # remove (degenerate) "record"
> endif
>
> end
>
>
>> Message: 7
>> Date: Thu, 14 Nov 2013 11:53:43 -0700
>> From: Dennis Shea <shea@ucar.edu>
>> Subject: Re: Question about wkSpaceTime
>> To: "Winston C. Chao" <winston.c.chao@nasa.gov>
>> Cc: ncl-talk@ucar.edu
>> Message-ID: <52851C37.8000601@ucar.edu>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Winston,
>>
>> FYI: I tried to download the files but I ran out of space
>> on my download partition. Subsequently, the ftp 'timed out'
>>
>> I was going to suggest that you use the netCDF operator 'ncrcat'
>> to extract the variables you want and create a single file
>> or a small set of files to hold the data. It would look like
>>
>> %> ncrcat -v var1,var2,.. g30e017.geosgcm_surf*nc4
>> G30E017.GEOSGCM_SURF.198406-??????.nc4
>>
>> Unfortunately, 'ncrcat' requires that the 'time'
>> dimension be classified as "UNLIMITED" and the 'time'
>> on your files is not classified as such.
>>
>> ncdump -v time
>>
>> etcdf g30e017.geosgcm_surf.19850211_0730z {
>> dimensions:
>> lon = 288 ;
>> lat = 181 ;
>> time = 1 ;
>> variables:
>> int time(time) ;
>> time:long_name = "time" ;
>> time:units = "minutes since 1985-02-11 07:30:00" ;
>> time:time_increment = 30000 ;
>> time:begin_date = 19850211 ;
>> time:begin_time = 73000 ;
>>
>> In NCL, you can use 'addfiles' but it would likely be more efficient
>> if a separate file was created.
>> ===
>> Note: I ran successfully ran the code for ndaywin=96,120,196
>> on a data set that spanned 1979-2011
>>
>> Cheers
>
>
>
> _______________________________________________
> 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 Thu Nov 14 14:02:14 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST