[Thread Prev][Thread Next][Index]

Re: [ferret_users] Changing the field of a NetCDF file to zero.



Hi Douglas,
The way to do this is to rename the input variable with SET VAR/NAME=, then define the new variable but using the original name.  For example,
yes? use input_dataset.nc
yes? set var/name=dummy old_name

yes? let old_name = 0*dummy
You can inherit attributes from the old variable to the newly defined one.  This command will inherit all attributes from the file variable,
yes? set att/like=dummy  old_name
or use qualifiers to set individual attributes,
yes? set var/units="`dummy,return=units`"/title=`dummy,return=title`"  old_name
And also have a look at  DEFINE VAR/DATASET=  This lets you assign the new variable to the dataset, so that it's treated as a member of that dataset.

-Ansley

On 5/4/2013 8:20 AM, Douglas Hamilton [RPG] wrote:
Hi,

I have a .nc file with emission data in a 4D array (x,y,h,t) and want to set all the emission field values to zero without changing the field name (as the model picks this up).

I can use the format:

 new_field_name = old_field_name - old_field_name

but this changes the emission field name. Is there a simpler way to do this than saving this "new_emission" output and then re-loading it to change the field name back to its"old_emission" name?

Thanks

Douglas


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement