Re: editing a netcdf file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 31 2011 - 08:14:16 MDT

I think it might be more straight forward to use NCL.

   f = addfile ("wrfout_d01_000000.nc", "w") ; "w" means over write
   lu = f->LU_INDEX
   xlat = f->XLAT
   xlon = f->XLONG

   printVarSummary(lu)
   print("============")

   print(sprintf("%5.0f", lu)+" "+sprintf("%8.2f", xlat) \
                             +" "+sprintf("%8.2f", xlon) )

subscript LU LAT LON
time,lat,lon
[snip]
(0,0,15) 2 40.51 -93.59
(0,0,16) 2 40.51 -93.47
(0,0,17) 2 40.50 -93.35
[snip]

====================

NCL subscripts are opposite of fortran. Also, subscripts start at
zero rather than one.

Make changes ... eg

     lu(0,0,16) = 9

Then, overwrite to file.

     f->LU_INDEX = lu

On 3/30/11 10:38 PM, rekha bharali wrote:
> Thanks for your reply.
>
> I am trying to change the LU_INDEX values. Using a fortran program I
> made some modification of LU_INDEX values. Now I want to put those
> values in the wrfinoput_d01 file using a NCL script. I dint make any
> change in the number of categories, for example suppose at a specific
> location I get LU_INDEX as no. 16, instead of that I replaced it with 17
> or any other no. from 1 to 24. Now I want to put these modified values
> in the wrf file.
>
> Thanking you
> Rekha
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 31 08:14:25 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2011 - 09:01:21 MDT