[gradsusr] multiple variables in one netCDF
Jennifer Adams
jma at cola.iges.org
Fri Sep 3 13:52:39 EDT 2010
Hi, Teddy --
The ncks -A command merges files with different variables having
identical grids. Concatenating files with netcdf operators (i.e.,
extending the time steps) is something different. The NCO docs
describe how to do this, I am working on a merge of their docs to add
to the sdfwrite docs to make it easier for GrADS users, but haven't
finished testing it out to make sure it works. It is a bit more
involved, since you have to change the time dimension to a 'record'
dimension, so that it can be extended. You have to use ncecat followed
by ncpdq followed by ncwa and then ncrcat.
I will think about how to add an option to 'sdfwrite' to set a
dimension to be a record dimension; this will save some trouble when
concatenating files. In the newer versions of the netcdf library you
can have more than one record dimension.
--Jennifer
On Sep 3, 2010, at 1:17 PM, Teddy Allen wrote:
> Is this procedure similar to combining files found in NCO? Or, is it
> only a way to combine multiple variables into one file without
> extending the time steps?
> does this make sense?
> thanks,
> teddy
>
> http://www.teddyallen.com
>
> "To move quickly, go alone. To move far, go together."
>
> African Proverb
>
>
>
> From: Jennifer Adams <jma at cola.iges.org>
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Sent: Fri, September 3, 2010 12:59:48 PM
> Subject: Re: [gradsusr] multiple variables in one netCDF
>
> The netcdf operator 'ncks' can do this with a simple one-line command:
> ncks -h -A file1.nc file2.nc
>
> The -h option does not modify the global attribute 'history', the -A
> options means the variables in file1 are appended to file2. There is
> no need for me to write a whole lot of code in GrADS to do this when
> it is so easy with ncks.
> --Jennifer
>
>
> On Sep 2, 2010, at 8:35 PM, Don.VanDyke at noaa.gov wrote:
>
>> Hello,
>>
>> Is there a way to write multiple variables to one netCDF file
>> through GrADS instead of having to do separate files? I've tried
>> the obvious way of simply issuing two sdfwrite commands to the same
>> file, but it didn't work. The second variable just overwrote the
>> first. Thanks for any help given!
>>
>> Don Van Dyke
>> NWS Tallahassee, FL
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100903/7d3e4fb3/attachment-0003.html
More information about the gradsusr
mailing list