modifying WRF geo_em.d01.nc file

From: Jinwoong Yoo <jyoo2_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 06 2011 - 17:57:41 MST

Hello, NCL users.

I'd like to get some tips how to modify an geo_em.d0X.nc file to modify
topography of the WRF model domain.
I know somebody had similar question in the ncl-talk previously and I
followed their ideas but I'm still struggling to modify my geo_em.d0X.ncfile.
First, I used NCL method, "Change netCDF file" as described in
http://www.ncl.ucar.edu/Applications/change_netCDF.shtml.

 I collected HGT_M values from "ncdump -v HGT_M geo_em.d01.nc" for my
198 by 261 grid domain and pasted the HGT_M values

    begin
      in = addfile("./geo_em.d01.nc","w")
      HGT_M = (/30,40,89,78,45,234,98,23,456,294,12,17,40,56,17,32,85,93,72,\
                ... ... \
               20,46,24,90,89,25/)

      in->HGT_M=(/HGT_M/)

    end

 where I put my modified elevation values in the HGT_M = (/.../).
However, this failed due to the dimension mismatch about which I could not
find any help or explanation on the web.
Because the domain is 198 by 261 array, there should be some (NCL) way to
specify the HGT_M = (/.../) instead of just putting numbers separated by
comma as I did.
If you know how, please let me know.

Second, I tried PyNIO to modify the geo_em.d01.nc file.
Actually, I could get array values with it and could modify the values on
the memory.
However, it seems that I cannot modify the original geo_em.d01.nc even when
I used the "w" mode although you can create a new nc file.
I found this line from PyNGL and PyNIO webpage: "Note that *PyNIO* never
overwrites an existing file with an entirely new file."
If I'm wrong and an existing nc file can be overwritten with new values,
please let me know how to.
Personally, I'd like to use PyNIO to modify the nc file if possible.
Maybe PyNIO developers can change the code to let users overwrite their nc
file directly in the future if it has not been done yet.

Thank you in advance.

Best,

Jinwoong Yoo, Ph.D.
University of South Florida

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 6 17:57:53 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 09 2011 - 13:09:09 MST