Re: How to change global attributes in a netCDF file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 7 Mar 2006 15:37:39 -0700 (MST)

I posted message only because " it worked " :-)

FYI: Frequently I use the netCDF operators [NCO]
     as suggested by Kate and Xianglei. In this
     particular instance, NCL was the simplest
     solution.
     
The "w" approach with the addfile function only works
when replacing something of the same size.

     
D

>Hi Dennis,
>
> Yes, your method worked quite well. Thank you so much.
>
>Yongxin
>
>On Mar 7, 2006, at 3:22 PM, Dennis Shea wrote:
>
>>>
>>> I need to make changes in START_DATE in my netCDF file and then
>>> write back to this file. Specifically, I need to do the following:
>>>
>>> Change from:
>>>
>>> :START_DATE = "2005-05-01_00:00:00"
>>>
>>> to:
>>>
>>> :START_DATE = "2005-06-01_00:00:00"
>>>
>>> Please let me know how I can do this or where I can find an
>>> example to do this.
>>>
>>> Thanks,
>>> Yongxin
>> ------------------------------------------------
>> Not untested
>>
>> Make a copy of your original file,
>> then [you can do this interactively]
>>
>> ncl > f = addfile ("foo.nc", "w") ; note "w"
>> ncl > f_at_START_DATE = "2005-06-01_00:00:00"
>>
>>
>> You are done.
>>
>> Do a ncdump -h on the file.
>>
>> D
>>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 07 2006 - 15:37:39 MST

This archive was generated by hypermail 2.2.0 : Tue Mar 07 2006 - 16:44:45 MST